From 37841e64a6f980f537a52787b6f943c263ff961c Mon Sep 17 00:00:00 2001 From: rahuel Date: Tue, 30 Aug 2005 08:23:28 +0000 Subject: [PATCH] Many new examples specially for test of Switches --- examples/GeomGraph.py | 54 +- examples/GeomGraph.xml | 66 +- examples/GraphBadInputInLoop.py | 72 +- examples/GraphBadInputInLoop.xml | 118 +- examples/GraphBadInputInLoop1.py | 68 +- examples/GraphBadInputInLoop1.xml | 100 +- examples/GraphBadInputInLoop2.py | 24 +- examples/GraphBadInputInLoop2.xml | 86 +- examples/GraphBadInputInLoop3.py | 24 +- examples/GraphBadInputInLoop3.xml | 86 +- examples/GraphBadOutputOfLoop.py | 28 +- examples/GraphBadOutputOfLoop.xml | 95 +- examples/GraphBadOutputOfLoop1.py | 25 +- examples/GraphBadOutputOfLoop1.xml | 100 +- examples/GraphBadOutputOfLoop2.py | 28 +- examples/GraphBadOutputOfLoop2.xml | 109 +- examples/GraphBugEditor.py | 97 ++ examples/GraphBugEditor.xml | 207 +++ .../GraphConvertObjRefCheckNotCompatible.py | 112 ++ .../GraphConvertObjRefCheckNotCompatible.xml | 264 ++++ examples/GraphEditGraphSwitchs.py | 61 + examples/GraphEditGraphSwitchs_1.py | 204 +++ examples/GraphEditGraphSwitchs_1.xml | 493 +++++++ examples/GraphEditGraphSwitchs_2.py | 205 +++ examples/GraphEditGraphSwitchs_2.xml | 496 +++++++ examples/GraphEditGraphSwitchs_3.py | 205 +++ examples/GraphEditGraphSwitchs_3.xml | 502 +++++++ examples/GraphEditGraphSwitchs_4.py | 206 +++ examples/GraphEditGraphSwitchs_4.xml | 499 +++++++ examples/GraphEditGraphSwitchs_5.py | 196 +++ examples/GraphEditGraphSwitchs_5.xml | 475 +++++++ examples/GraphEmbeddedComponents.py | 50 +- examples/GraphEmbeddedComponents.xml | 432 +++--- examples/GraphEmbeddedComponentsCrash.py | 155 +++ examples/GraphEmbeddedComponentsCrash.xml | 475 +++++++ examples/GraphEmbeddedComponentsCrash1.py | 151 ++ examples/GraphEmbeddedComponentsCrash1.xml | 461 ++++++ examples/GraphErrMsgs.py | 1234 +++++++++++++++++ examples/GraphGOTO1.py | 88 +- examples/GraphGOTO1.xml | 54 +- examples/GraphGOTOAborted.py | 90 +- examples/GraphGOTOAborted.xml | 54 +- examples/GraphGOTOAddMemory.py | 68 + examples/GraphGOTOAddMemory.xml | 159 +++ examples/GraphGOTOMemory.py | 47 + examples/GraphGOTOMemory.xml | 91 ++ examples/GraphInputInLoop.py | 60 +- examples/GraphInputInLoop.xml | 74 +- examples/GraphLoop1.py | 38 +- examples/GraphLoop1.xml | 28 +- examples/GraphLoop2.py | 126 ++ examples/GraphLoop2.xml | 328 +++++ examples/GraphLoopAddMemory.py | 114 ++ examples/GraphLoopAddMemory.xml | 291 ++++ examples/GraphLoopGates.py | 20 +- examples/GraphLoopGates.xml | 74 +- examples/GraphLoopGatesNOTValid.py | 179 +++ examples/GraphLoopGatesNOTValid.xml | 514 +++++++ examples/GraphLoopMemory.py | 93 ++ examples/GraphLoopMemory.xml | 235 ++++ examples/GraphLoopPyAddAddMemory.py | 135 ++ examples/GraphLoopPyAddAddMemory.xml | 342 +++++ examples/GraphLoopSwitch.py | 96 +- examples/GraphLoopSwitch.xml | 142 +- examples/GraphLoopSwitchDefault.py | 144 ++ examples/GraphLoopSwitchDefault.xml | 336 +++++ examples/GraphLoopSwitchDefaultAborted.py | 161 +++ examples/GraphLoopSwitchDefaultAborted.xml | 374 +++++ examples/GraphLoopSwitchGateDefault.py | 165 +++ examples/GraphLoopSwitchGateDefault.xml | 386 ++++++ .../GraphLoopSwitchGatesDefaultNOTValid.py | 167 +++ .../GraphLoopSwitchGatesDefaultNOTValid.xml | 392 ++++++ examples/GraphLoopSwitchOddEven.py | 162 +++ examples/GraphLoopSwitchOddEven.xml | 377 +++++ examples/GraphLoopSwitchOfSwitch.py | 2 +- examples/GraphLoopSwitchOfSwitch.xml | 44 +- examples/GraphLoopSwitchOfSwitch1.py | 249 ++++ examples/GraphLoopSwitchOfSwitch1.xml | 590 ++++++++ examples/GraphLoopSwitchOfSwitchAborted.py | 244 ++++ examples/GraphLoopSwitchOfSwitchAborted.xml | 575 ++++++++ examples/GraphLoopSwitchs.py | 135 +- examples/GraphLoopSwitchs.xml | 185 +-- examples/GraphLoopSwitchsAborted.py | 231 +++ examples/GraphLoopSwitchsAborted.xml | 553 ++++++++ examples/GraphLoopSwitchsBranches.py | 290 ++++ examples/GraphLoopSwitchsBranches.xml | 692 +++++++++ .../GraphLoopSwitchsBranchesDefaultAborted.py | 346 +++++ ...GraphLoopSwitchsBranchesDefaultAborted.xml | 814 +++++++++++ examples/GraphLoopSwitchsBranchesdefault.py | 350 +++++ examples/GraphLoopSwitchsBranchesdefault.xml | 826 +++++++++++ examples/GraphLoopSwitchsNOTValid.py | 229 +++ examples/GraphLoopSwitchsNOTValid.xml | 559 ++++++++ examples/GraphLoopTwoBranches.py | 326 +++++ examples/GraphLoopTwoBranches.xml | 767 ++++++++++ examples/GraphLoopsGates.py | 5 +- examples/GraphLoopsGates.xml | 47 +- examples/GraphLoopsStupidCoupledSwitchs.py | 273 ++++ examples/GraphLoopsStupidCoupledSwitchs.xml | 706 ++++++++++ examples/GraphMacroNodes.py | 52 +- examples/GraphMacroNodes.xml | 218 +-- examples/GraphObjRef.py | 224 +-- examples/GraphObjRef.xml | 654 +++++---- examples/GraphObjRefOMNIORB4.py | 229 +++ examples/GraphObjRefOMNIORB4.xml | 625 +++++++++ examples/GraphObjRefOMNIORB4_StandAlone.py | 27 + examples/GraphPyFunctions.py | 450 +++--- examples/GraphPyFunctions.xml | 974 ++++++------- examples/GraphStreamInLines.py | 447 +++--- examples/GraphStreamInLines.xml | 775 +++++------ examples/GraphSwitch.py | 2 +- examples/GraphSwitch.xml | 24 +- examples/GraphSwitchBranchGates.py | 147 ++ examples/GraphSwitchBranchGates.xml | 351 +++++ examples/GraphSwitchBranchGates1.py | 149 ++ examples/GraphSwitchBranchGates1.xml | 357 +++++ examples/GraphSwitchBugAborted.py | 146 ++ examples/GraphSwitchBugAborted.xml | 345 +++++ examples/GraphSwitchBugDefault.py | 149 ++ examples/GraphSwitchBugDefault.xml | 352 +++++ examples/GraphSwitchCheckBranch1.py | 88 +- examples/GraphSwitchCheckBranch1.xml | 117 +- examples/GraphSwitchCheckBranch1Default.py | 236 ++++ examples/GraphSwitchCheckBranch1Default.xml | 541 ++++++++ examples/GraphSwitchCheckBranch1NoDefault.py | 231 +++ examples/GraphSwitchCheckBranch1NoDefault.xml | 532 +++++++ examples/GraphSwitchCheckBranch2NOTValid.py | 237 ++++ examples/GraphSwitchCheckBranch2NOTValid.xml | 548 ++++++++ examples/GraphSwitchCheckDefault.py | 107 +- examples/GraphSwitchCheckDefault.xml | 134 +- examples/GraphSwitchCheckDefault2NOTValid2.py | 102 +- .../GraphSwitchCheckDefault2NOTValid2.xml | 84 +- examples/GraphSwitchCheckNoDefault2.py | 332 +++++ examples/GraphSwitchCheckNoDefault2.xml | 781 +++++++++++ examples/GraphSwitchCrash.py | 485 ++++--- examples/GraphSwitchCrash.xml | 1031 +++++++------- examples/GraphSwitchErrExec.py | 50 +- examples/GraphSwitchErrExec.xml | 34 +- examples/GraphSwitchExecutable.py | 148 ++ examples/GraphSwitchExecutable.xml | 351 +++++ examples/GraphSwitchGates.py | 156 +++ examples/GraphSwitchGates.xml | 354 +++++ examples/GraphSwitchGatesDefault.py | 159 +++ examples/GraphSwitchGatesDefault.xml | 361 +++++ examples/GraphSwitchGatesNoDefaultAborted.py | 157 +++ examples/GraphSwitchGatesNoDefaultAborted.xml | 355 +++++ examples/GraphSwitchGatesdefault.py | 163 +++ examples/GraphSwitchGatesdefault.xml | 367 +++++ examples/GraphSwitchGatesdefaultBranch.py | 178 +++ examples/GraphSwitchGatesdefaultBranch.xml | 399 ++++++ examples/GraphSwitchManyCases.py | 233 ++++ examples/GraphSwitchManyCases.xml | 656 +++++++++ examples/GraphSwitchManyCasesNOTValid.py | 250 ++++ examples/GraphSwitchManyCasesNOTValid.xml | 567 ++++++++ examples/GraphSwitchNOTExecutable.py | 142 ++ examples/GraphSwitchNOTExecutable.xml | 344 +++++ examples/GraphSwitchNOTExecutable1.py | 144 ++ examples/GraphSwitchNOTExecutable1.xml | 350 +++++ examples/GraphSwitchNOTExecutable2.py | 147 ++ examples/GraphSwitchNOTExecutable2.xml | 353 +++++ examples/GraphSwitchOutputNOTValid.py | 68 +- examples/GraphSwitchOutputNOTValid.xml | 56 +- examples/GraphSyrControl.py | 12 +- examples/GraphSyrControl.xml | 58 +- examples/GraphSyrControl1.py | 74 +- examples/GraphSyrControl1.xml | 48 +- examples/GraphSyrControlAborted.py | 278 ++++ examples/GraphSyrControlAborted.xml | 683 +++++++++ examples/GraphSyrControlAve.py | 145 +- examples/GraphSyrControlAve.xml | 323 +++-- examples/GraphSyrControlAveAborted.py | 413 ++++++ examples/GraphSyrControlAveAborted.xml | 1107 +++++++++++++++ examples/GraphSyrControlAveExecutable.py | 415 ++++++ examples/GraphSyrControlAveExecutable.xml | 1113 +++++++++++++++ examples/GraphSyrControlAveNOTValid.py | 415 ++++++ examples/GraphSyrControlAveNOTValid.xml | 1107 +++++++++++++++ examples/GraphSyrControlAveValid.py | 412 ++++++ examples/GraphSyrControlAveValid.xml | 1104 +++++++++++++++ examples/GraphTwoLoops1.py | 133 ++ examples/GraphTwoLoops1.xml | 315 +++++ examples/GraphUnValid.py | 188 +-- examples/GraphUnValid.xml | 369 ++--- examples/GraphWrongContainerOrComponent.py | 54 + examples/GraphWrongContainerOrComponent.xml | 145 ++ examples/GraphWrongPythonFunctions.py | 165 +++ examples/GraphWrongPythonFunctions.xml | 382 +++++ examples/TestSupervMedfieldLoopFori.py | 336 ++--- examples/TestSupervMedfieldLoopFori.xml | 681 ++++----- examples/TestSupervMedfieldLoopForiVisu.py | 451 +++--- examples/TestSupervMedfieldLoopForiVisu.xml | 835 +++++------ examples/testvisu20.xml | 769 +++++----- examples/testvisu20_multi.py | 78 +- examples/testvisu20_multi.xml | 46 +- 192 files changed, 48256 insertions(+), 6728 deletions(-) create mode 100644 examples/GraphBugEditor.py create mode 100644 examples/GraphBugEditor.xml create mode 100644 examples/GraphConvertObjRefCheckNotCompatible.py create mode 100644 examples/GraphConvertObjRefCheckNotCompatible.xml create mode 100644 examples/GraphEditGraphSwitchs.py create mode 100644 examples/GraphEditGraphSwitchs_1.py create mode 100644 examples/GraphEditGraphSwitchs_1.xml create mode 100644 examples/GraphEditGraphSwitchs_2.py create mode 100644 examples/GraphEditGraphSwitchs_2.xml create mode 100644 examples/GraphEditGraphSwitchs_3.py create mode 100644 examples/GraphEditGraphSwitchs_3.xml create mode 100644 examples/GraphEditGraphSwitchs_4.py create mode 100644 examples/GraphEditGraphSwitchs_4.xml create mode 100644 examples/GraphEditGraphSwitchs_5.py create mode 100644 examples/GraphEditGraphSwitchs_5.xml create mode 100644 examples/GraphEmbeddedComponentsCrash.py create mode 100644 examples/GraphEmbeddedComponentsCrash.xml create mode 100644 examples/GraphEmbeddedComponentsCrash1.py create mode 100644 examples/GraphEmbeddedComponentsCrash1.xml create mode 100644 examples/GraphErrMsgs.py create mode 100644 examples/GraphGOTOAddMemory.py create mode 100644 examples/GraphGOTOAddMemory.xml create mode 100644 examples/GraphGOTOMemory.py create mode 100644 examples/GraphGOTOMemory.xml create mode 100644 examples/GraphLoop2.py create mode 100644 examples/GraphLoop2.xml create mode 100644 examples/GraphLoopAddMemory.py create mode 100644 examples/GraphLoopAddMemory.xml create mode 100644 examples/GraphLoopGatesNOTValid.py create mode 100644 examples/GraphLoopGatesNOTValid.xml create mode 100644 examples/GraphLoopMemory.py create mode 100644 examples/GraphLoopMemory.xml create mode 100644 examples/GraphLoopPyAddAddMemory.py create mode 100644 examples/GraphLoopPyAddAddMemory.xml create mode 100644 examples/GraphLoopSwitchDefault.py create mode 100644 examples/GraphLoopSwitchDefault.xml create mode 100644 examples/GraphLoopSwitchDefaultAborted.py create mode 100644 examples/GraphLoopSwitchDefaultAborted.xml create mode 100644 examples/GraphLoopSwitchGateDefault.py create mode 100644 examples/GraphLoopSwitchGateDefault.xml create mode 100644 examples/GraphLoopSwitchGatesDefaultNOTValid.py create mode 100644 examples/GraphLoopSwitchGatesDefaultNOTValid.xml create mode 100644 examples/GraphLoopSwitchOddEven.py create mode 100644 examples/GraphLoopSwitchOddEven.xml create mode 100644 examples/GraphLoopSwitchOfSwitch1.py create mode 100644 examples/GraphLoopSwitchOfSwitch1.xml create mode 100644 examples/GraphLoopSwitchOfSwitchAborted.py create mode 100644 examples/GraphLoopSwitchOfSwitchAborted.xml create mode 100644 examples/GraphLoopSwitchsAborted.py create mode 100644 examples/GraphLoopSwitchsAborted.xml create mode 100644 examples/GraphLoopSwitchsBranches.py create mode 100644 examples/GraphLoopSwitchsBranches.xml create mode 100644 examples/GraphLoopSwitchsBranchesDefaultAborted.py create mode 100644 examples/GraphLoopSwitchsBranchesDefaultAborted.xml create mode 100644 examples/GraphLoopSwitchsBranchesdefault.py create mode 100644 examples/GraphLoopSwitchsBranchesdefault.xml create mode 100644 examples/GraphLoopSwitchsNOTValid.py create mode 100644 examples/GraphLoopSwitchsNOTValid.xml create mode 100644 examples/GraphLoopTwoBranches.py create mode 100644 examples/GraphLoopTwoBranches.xml create mode 100644 examples/GraphLoopsStupidCoupledSwitchs.py create mode 100644 examples/GraphLoopsStupidCoupledSwitchs.xml create mode 100644 examples/GraphObjRefOMNIORB4.py create mode 100644 examples/GraphObjRefOMNIORB4.xml create mode 100644 examples/GraphObjRefOMNIORB4_StandAlone.py create mode 100644 examples/GraphSwitchBranchGates.py create mode 100644 examples/GraphSwitchBranchGates.xml create mode 100644 examples/GraphSwitchBranchGates1.py create mode 100644 examples/GraphSwitchBranchGates1.xml create mode 100644 examples/GraphSwitchBugAborted.py create mode 100644 examples/GraphSwitchBugAborted.xml create mode 100644 examples/GraphSwitchBugDefault.py create mode 100644 examples/GraphSwitchBugDefault.xml create mode 100644 examples/GraphSwitchCheckBranch1Default.py create mode 100644 examples/GraphSwitchCheckBranch1Default.xml create mode 100644 examples/GraphSwitchCheckBranch1NoDefault.py create mode 100644 examples/GraphSwitchCheckBranch1NoDefault.xml create mode 100644 examples/GraphSwitchCheckBranch2NOTValid.py create mode 100644 examples/GraphSwitchCheckBranch2NOTValid.xml create mode 100644 examples/GraphSwitchCheckNoDefault2.py create mode 100644 examples/GraphSwitchCheckNoDefault2.xml create mode 100644 examples/GraphSwitchExecutable.py create mode 100644 examples/GraphSwitchExecutable.xml create mode 100644 examples/GraphSwitchGates.py create mode 100644 examples/GraphSwitchGates.xml create mode 100644 examples/GraphSwitchGatesDefault.py create mode 100644 examples/GraphSwitchGatesDefault.xml create mode 100644 examples/GraphSwitchGatesNoDefaultAborted.py create mode 100644 examples/GraphSwitchGatesNoDefaultAborted.xml create mode 100644 examples/GraphSwitchGatesdefault.py create mode 100644 examples/GraphSwitchGatesdefault.xml create mode 100644 examples/GraphSwitchGatesdefaultBranch.py create mode 100644 examples/GraphSwitchGatesdefaultBranch.xml create mode 100644 examples/GraphSwitchManyCases.py create mode 100644 examples/GraphSwitchManyCases.xml create mode 100644 examples/GraphSwitchManyCasesNOTValid.py create mode 100644 examples/GraphSwitchManyCasesNOTValid.xml create mode 100644 examples/GraphSwitchNOTExecutable.py create mode 100644 examples/GraphSwitchNOTExecutable.xml create mode 100644 examples/GraphSwitchNOTExecutable1.py create mode 100644 examples/GraphSwitchNOTExecutable1.xml create mode 100644 examples/GraphSwitchNOTExecutable2.py create mode 100644 examples/GraphSwitchNOTExecutable2.xml create mode 100644 examples/GraphSyrControlAborted.py create mode 100644 examples/GraphSyrControlAborted.xml create mode 100644 examples/GraphSyrControlAveAborted.py create mode 100644 examples/GraphSyrControlAveAborted.xml create mode 100644 examples/GraphSyrControlAveExecutable.py create mode 100644 examples/GraphSyrControlAveExecutable.xml create mode 100644 examples/GraphSyrControlAveNOTValid.py create mode 100644 examples/GraphSyrControlAveNOTValid.xml create mode 100644 examples/GraphSyrControlAveValid.py create mode 100644 examples/GraphSyrControlAveValid.xml create mode 100644 examples/GraphTwoLoops1.py create mode 100644 examples/GraphTwoLoops1.xml create mode 100644 examples/GraphWrongContainerOrComponent.py create mode 100644 examples/GraphWrongContainerOrComponent.xml create mode 100644 examples/GraphWrongPythonFunctions.py create mode 100644 examples/GraphWrongPythonFunctions.xml diff --git a/examples/GeomGraph.py b/examples/GeomGraph.py index 0553d96..20fb113 100644 --- a/examples/GeomGraph.py +++ b/examples/GeomGraph.py @@ -1,19 +1,19 @@ -# Generated python file of Graph aNewDataFlow_1 +# Generated python file of Graph GeomGraph from SuperV import * -# Graph creation of aNewDataFlow_1 -def DefaNewDataFlow_1() : - aNewDataFlow_1 = Graph( 'aNewDataFlow_1' ) - aNewDataFlow_1.SetName( 'aNewDataFlow_1' ) - aNewDataFlow_1.SetAuthor( '' ) - aNewDataFlow_1.SetComment( '' ) - aNewDataFlow_1.Coords( 0 , 0 ) +# Graph creation of GeomGraph +def DefGeomGraph() : + GeomGraph = Graph( 'GeomGraph' ) + GeomGraph.SetName( 'GeomGraph' ) + GeomGraph.SetAuthor( '' ) + GeomGraph.SetComment( '' ) + GeomGraph.Coords( 0 , 0 ) # Creation of Factory Nodes - SetStudyID = aNewDataFlow_1.FNode( 'GEOM_Superv' , 'GEOM_Superv' , 'SetStudyID' ) + SetStudyID = GeomGraph.FNode( 'GEOM_Superv' , 'GEOM_Superv' , 'SetStudyID' ) SetStudyID.SetName( 'SetStudyID' ) SetStudyID.SetAuthor( '' ) SetStudyID.SetContainer( 'localhost/FactoryServer' ) @@ -23,7 +23,7 @@ def DefaNewDataFlow_1() : ISetStudyIDGate = SetStudyID.GetInPort( 'Gate' ) OSetStudyIDGate = SetStudyID.GetOutPort( 'Gate' ) - MakeBox = aNewDataFlow_1.FNode( 'GEOM_Superv' , 'GEOM_Superv' , 'MakeBox' ) + MakeBox = GeomGraph.FNode( 'GEOM_Superv' , 'GEOM_Superv' , 'MakeBox' ) MakeBox.SetName( 'MakeBox' ) MakeBox.SetAuthor( '' ) MakeBox.SetContainer( 'localhost/FactoryServer' ) @@ -39,7 +39,7 @@ def DefaNewDataFlow_1() : OMakeBoxreturn = MakeBox.GetOutPort( 'return' ) OMakeBoxGate = MakeBox.GetOutPort( 'Gate' ) - MakeCopy = aNewDataFlow_1.FNode( 'GEOM_Superv' , 'GEOM_Superv' , 'MakeCopy' ) + MakeCopy = GeomGraph.FNode( 'GEOM_Superv' , 'GEOM_Superv' , 'MakeCopy' ) MakeCopy.SetName( 'MakeCopy' ) MakeCopy.SetAuthor( '' ) MakeCopy.SetContainer( 'localhost/FactoryServer' ) @@ -50,7 +50,7 @@ def DefaNewDataFlow_1() : OMakeCopyreturn = MakeCopy.GetOutPort( 'return' ) OMakeCopyGate = MakeCopy.GetOutPort( 'Gate' ) - TranslateDXDYDZ = aNewDataFlow_1.FNode( 'GEOM_Superv' , 'GEOM_Superv' , 'TranslateDXDYDZ' ) + TranslateDXDYDZ = GeomGraph.FNode( 'GEOM_Superv' , 'GEOM_Superv' , 'TranslateDXDYDZ' ) TranslateDXDYDZ.SetName( 'TranslateDXDYDZ' ) TranslateDXDYDZ.SetAuthor( '' ) TranslateDXDYDZ.SetContainer( 'localhost/FactoryServer' ) @@ -64,7 +64,7 @@ def DefaNewDataFlow_1() : OTranslateDXDYDZreturn = TranslateDXDYDZ.GetOutPort( 'return' ) OTranslateDXDYDZGate = TranslateDXDYDZ.GetOutPort( 'Gate' ) - MakeCopy_1 = aNewDataFlow_1.FNode( 'GEOM_Superv' , 'GEOM_Superv' , 'MakeCopy' ) + MakeCopy_1 = GeomGraph.FNode( 'GEOM_Superv' , 'GEOM_Superv' , 'MakeCopy' ) MakeCopy_1.SetName( 'MakeCopy_1' ) MakeCopy_1.SetAuthor( '' ) MakeCopy_1.SetContainer( 'localhost/FactoryServer' ) @@ -75,7 +75,7 @@ def DefaNewDataFlow_1() : OMakeCopy_1return = MakeCopy_1.GetOutPort( 'return' ) OMakeCopy_1Gate = MakeCopy_1.GetOutPort( 'Gate' ) - MakeSphere_1 = aNewDataFlow_1.FNode( 'GEOM_Superv' , 'GEOM_Superv' , 'MakeSphere' ) + MakeSphere_1 = GeomGraph.FNode( 'GEOM_Superv' , 'GEOM_Superv' , 'MakeSphere' ) MakeSphere_1.SetName( 'MakeSphere_1' ) MakeSphere_1.SetAuthor( '' ) MakeSphere_1.SetContainer( 'localhost/FactoryServer' ) @@ -89,7 +89,7 @@ def DefaNewDataFlow_1() : OMakeSphere_1return = MakeSphere_1.GetOutPort( 'return' ) OMakeSphere_1Gate = MakeSphere_1.GetOutPort( 'Gate' ) - MakeFuse = aNewDataFlow_1.FNode( 'GEOM_Superv' , 'GEOM_Superv' , 'MakeFuse' ) + MakeFuse = GeomGraph.FNode( 'GEOM_Superv' , 'GEOM_Superv' , 'MakeFuse' ) MakeFuse.SetName( 'MakeFuse' ) MakeFuse.SetAuthor( '' ) MakeFuse.SetContainer( 'localhost/FactoryServer' ) @@ -101,7 +101,7 @@ def DefaNewDataFlow_1() : OMakeFusereturn = MakeFuse.GetOutPort( 'return' ) OMakeFuseGate = MakeFuse.GetOutPort( 'Gate' ) - MakeFuse_1 = aNewDataFlow_1.FNode( 'GEOM_Superv' , 'GEOM_Superv' , 'MakeFuse' ) + MakeFuse_1 = GeomGraph.FNode( 'GEOM_Superv' , 'GEOM_Superv' , 'MakeFuse' ) MakeFuse_1.SetName( 'MakeFuse_1' ) MakeFuse_1.SetAuthor( '' ) MakeFuse_1.SetContainer( 'localhost/FactoryServer' ) @@ -114,23 +114,23 @@ def DefaNewDataFlow_1() : OMakeFuse_1Gate = MakeFuse_1.GetOutPort( 'Gate' ) # Creation of Links - LSetStudyIDGateMakeBoxGate = aNewDataFlow_1.Link( OSetStudyIDGate , IMakeBoxGate ) + LSetStudyIDGateMakeBoxGate = GeomGraph.Link( OSetStudyIDGate , IMakeBoxGate ) - LSetStudyIDGateMakeSphere_1Gate = aNewDataFlow_1.Link( OSetStudyIDGate , IMakeSphere_1Gate ) + LSetStudyIDGateMakeSphere_1Gate = GeomGraph.Link( OSetStudyIDGate , IMakeSphere_1Gate ) - LMakeBoxreturnMakeCopytheOriginal = aNewDataFlow_1.Link( OMakeBoxreturn , IMakeCopytheOriginal ) + LMakeBoxreturnMakeCopytheOriginal = GeomGraph.Link( OMakeBoxreturn , IMakeCopytheOriginal ) - LMakeBoxreturnMakeCopy_1theOriginal = aNewDataFlow_1.Link( OMakeBoxreturn , IMakeCopy_1theOriginal ) + LMakeBoxreturnMakeCopy_1theOriginal = GeomGraph.Link( OMakeBoxreturn , IMakeCopy_1theOriginal ) - LMakeCopyreturnTranslateDXDYDZtheObject = aNewDataFlow_1.Link( OMakeCopyreturn , ITranslateDXDYDZtheObject ) + LMakeCopyreturnTranslateDXDYDZtheObject = GeomGraph.Link( OMakeCopyreturn , ITranslateDXDYDZtheObject ) - LTranslateDXDYDZreturnMakeFusetheShape1 = aNewDataFlow_1.Link( OTranslateDXDYDZreturn , IMakeFusetheShape1 ) + LTranslateDXDYDZreturnMakeFusetheShape1 = GeomGraph.Link( OTranslateDXDYDZreturn , IMakeFusetheShape1 ) - LMakeCopy_1returnMakeFusetheShape2 = aNewDataFlow_1.Link( OMakeCopy_1return , IMakeFusetheShape2 ) + LMakeCopy_1returnMakeFusetheShape2 = GeomGraph.Link( OMakeCopy_1return , IMakeFusetheShape2 ) - LMakeSphere_1returnMakeFuse_1theShape2 = aNewDataFlow_1.Link( OMakeSphere_1return , IMakeFuse_1theShape2 ) + LMakeSphere_1returnMakeFuse_1theShape2 = GeomGraph.Link( OMakeSphere_1return , IMakeFuse_1theShape2 ) - LMakeFusereturnMakeFuse_1theShape1 = aNewDataFlow_1.Link( OMakeFusereturn , IMakeFuse_1theShape1 ) + LMakeFusereturnMakeFuse_1theShape1 = GeomGraph.Link( OMakeFusereturn , IMakeFuse_1theShape1 ) # Input datas ISetStudyIDtheStudyID.Input( 1 ) @@ -150,7 +150,7 @@ def DefaNewDataFlow_1() : # Output Ports of the graph #OMakeFuse_1return = MakeFuse_1.GetOutPort( 'return' ) - return aNewDataFlow_1 + return GeomGraph -aNewDataFlow_1 = DefaNewDataFlow_1() +GeomGraph = DefGeomGraph() diff --git a/examples/GeomGraph.xml b/examples/GeomGraph.xml index 663002d..f56de43 100644 --- a/examples/GeomGraph.xml +++ b/examples/GeomGraph.xml @@ -5,11 +5,11 @@ ? ? - aNewDataFlow_1 + GeomGraph 1 ? -aNewDataFlow_1 +GeomGraph long @@ -60,7 +60,7 @@ 29/10/2004 - 10:52:34 - 11/11/2004 - 11:41:31 + 6/6/2005 - 10:39:55 2.0 ? ? @@ -83,8 +83,8 @@ - 11/11/2004 - 11:16:35 - 11/11/2004 - 11:16:35 + 6/6/2005 - 10:39:55 + 6/6/2005 - 10:39:55 2.0 ? localhost/FactoryServer @@ -124,8 +124,8 @@ return - 11/11/2004 - 11:17:44 - 11/11/2004 - 11:17:44 + 6/6/2005 - 10:39:55 + 6/6/2005 - 10:39:55 2.0 ? localhost/FactoryServer @@ -150,8 +150,8 @@ return - 11/11/2004 - 11:36:29 - 11/11/2004 - 11:36:29 + 6/6/2005 - 10:39:55 + 6/6/2005 - 10:39:55 2.0 ? localhost/FactoryServer @@ -185,8 +185,8 @@ return - 11/11/2004 - 11:37:10 - 11/11/2004 - 11:37:10 + 6/6/2005 - 10:39:55 + 6/6/2005 - 10:39:55 2.0 ? localhost/FactoryServer @@ -211,8 +211,8 @@ return - 11/11/2004 - 11:38:45 - 11/11/2004 - 11:38:45 + 6/6/2005 - 10:39:55 + 6/6/2005 - 10:39:55 2.0 ? localhost/FactoryServer @@ -246,8 +246,8 @@ return - 11/11/2004 - 11:38:54 - 11/11/2004 - 11:38:54 + 6/6/2005 - 10:39:55 + 6/6/2005 - 10:39:55 2.0 ? localhost/FactoryServer @@ -275,8 +275,8 @@ return - 11/11/2004 - 11:39:55 - 11/11/2004 - 11:39:55 + 6/6/2005 - 10:39:55 + 6/6/2005 - 10:39:55 2.0 ? localhost/FactoryServer @@ -304,8 +304,8 @@ return - 11/11/2004 - 11:40:15 - 11/11/2004 - 11:40:15 + 6/6/2005 - 10:39:55 + 6/6/2005 - 10:39:55 2.0 ? localhost/FactoryServer @@ -369,7 +369,7 @@ -aNewDataFlow_1 +GeomGraph SetStudyID__theStudyID SetStudyID theStudyID @@ -378,7 +378,7 @@ 1 -aNewDataFlow_1 +GeomGraph MakeBox__theX1 MakeBox theX1 @@ -387,7 +387,7 @@ 0 -aNewDataFlow_1 +GeomGraph MakeBox__theY1 MakeBox theY1 @@ -396,7 +396,7 @@ 0 -aNewDataFlow_1 +GeomGraph MakeBox__theZ1 MakeBox theZ1 @@ -405,7 +405,7 @@ 0 -aNewDataFlow_1 +GeomGraph MakeBox__theX2 MakeBox theX2 @@ -414,7 +414,7 @@ 50 -aNewDataFlow_1 +GeomGraph MakeBox__theY2 MakeBox theY2 @@ -423,7 +423,7 @@ 50 -aNewDataFlow_1 +GeomGraph MakeBox__theZ2 MakeBox theZ2 @@ -432,7 +432,7 @@ 50 -aNewDataFlow_1 +GeomGraph TranslateDXDYDZ__theDX TranslateDXDYDZ theDX @@ -441,7 +441,7 @@ 10 -aNewDataFlow_1 +GeomGraph TranslateDXDYDZ__theDY TranslateDXDYDZ theDY @@ -450,7 +450,7 @@ 10 -aNewDataFlow_1 +GeomGraph TranslateDXDYDZ__theDZ TranslateDXDYDZ theDZ @@ -459,7 +459,7 @@ 10 -aNewDataFlow_1 +GeomGraph MakeSphere_1__theX MakeSphere_1 theX @@ -468,7 +468,7 @@ 0 -aNewDataFlow_1 +GeomGraph MakeSphere_1__theY MakeSphere_1 theY @@ -477,7 +477,7 @@ 0 -aNewDataFlow_1 +GeomGraph MakeSphere_1__theZ MakeSphere_1 theZ @@ -486,7 +486,7 @@ 0 -aNewDataFlow_1 +GeomGraph MakeSphere_1__theRadius MakeSphere_1 theRadius diff --git a/examples/GraphBadInputInLoop.py b/examples/GraphBadInputInLoop.py index f8c17e3..dd1a2c9 100755 --- a/examples/GraphBadInputInLoop.py +++ b/examples/GraphBadInputInLoop.py @@ -1,32 +1,31 @@ -# Generated python file of Graph GraphBadInputInLoop +# Generated python file of Graph GraphBadInputInLoop_1 from SuperV import * -# Graph creation of GraphBadInputInLoop -def DefGraphBadInputInLoop() : - GraphBadInputInLoop = Graph( 'GraphBadInputInLoop' ) - GraphBadInputInLoop.SetName( 'GraphBadInputInLoop' ) - GraphBadInputInLoop.SetAuthor( '' ) - GraphBadInputInLoop.SetComment( '' ) - GraphBadInputInLoop.Coords( 0 , 0 ) +# Graph creation of GraphBadInputInLoop_1 +def DefGraphBadInputInLoop_1() : + GraphBadInputInLoop_1 = Graph( 'GraphBadInputInLoop_1' ) + GraphBadInputInLoop_1.SetName( 'GraphBadInputInLoop_1' ) + GraphBadInputInLoop_1.SetAuthor( '' ) + GraphBadInputInLoop_1.SetComment( '' ) + GraphBadInputInLoop_1.Coords( 0 , 0 ) # Creation of Factory Nodes # Creation of InLine Nodes PyIsOdd = [] - PyIsOdd.append( 'from time import * ' ) - PyIsOdd.append( 'def IsOdd(a,Even) : ' ) - PyIsOdd.append( ' print a,"IsOdd (GraphLoopSwitch1)" ' ) - PyIsOdd.append( ' sleep( 1 ) ' ) - PyIsOdd.append( ' return a ' ) - IsOdd = GraphBadInputInLoop.INode( 'IsOdd' , PyIsOdd ) + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd(a) : ' ) + PyIsOdd.append( ' print a,"IsOdd (GraphLoopSwitch1)" ' ) + PyIsOdd.append( ' sleep( 1 ) ' ) + PyIsOdd.append( ' return a ' ) + IsOdd = GraphBadInputInLoop_1.INode( 'IsOdd' , PyIsOdd ) IsOdd.SetName( 'IsOdd' ) IsOdd.SetAuthor( '' ) IsOdd.SetComment( 'Python function' ) IsOdd.Coords( 397 , 1 ) IIsOdda = IsOdd.InPort( 'a' , 'long' ) - IIsOddEven = IsOdd.InPort( 'Even' , 'boolean' ) IIsOddGate = IsOdd.GetInPort( 'Gate' ) OIsOdda = IsOdd.OutPort( 'a' , 'long' ) OIsOddGate = IsOdd.GetOutPort( 'Gate' ) @@ -35,13 +34,13 @@ def DefGraphBadInputInLoop() : PyBadInputOfLoop.append( 'def BadInputOfLoop() : ' ) PyBadInputOfLoop.append( ' return 1 ' ) PyBadInputOfLoop.append( '' ) - BadInputOfLoop = GraphBadInputInLoop.INode( 'BadInputOfLoop' , PyBadInputOfLoop ) + BadInputOfLoop = GraphBadInputInLoop_1.INode( 'BadInputOfLoop' , PyBadInputOfLoop ) BadInputOfLoop.SetName( 'BadInputOfLoop' ) BadInputOfLoop.SetAuthor( '' ) BadInputOfLoop.SetComment( 'Compute Node' ) BadInputOfLoop.Coords( 15 , 307 ) IBadInputOfLoopGate = BadInputOfLoop.GetInPort( 'Gate' ) - OBadInputOfLoopInputInLoop = BadInputOfLoop.OutPort( 'InputInLoop' , 'boolean' ) + OBadInputOfLoopInputInLoop = BadInputOfLoop.OutPort( 'InputInLoop' , 'long' ) OBadInputOfLoopGate = BadInputOfLoop.GetOutPort( 'Gate' ) # Creation of Loop Nodes @@ -50,7 +49,7 @@ def DefGraphBadInputInLoop() : PyMoreInitLoop.append( '' ) PyNextInitLoop = [] PyNextInitLoop.append( '' ) - InitLoop,EndOfInitLoop = GraphBadInputInLoop.LNode( '' , PyInitLoop , '' , PyMoreInitLoop , '' , PyNextInitLoop ) + InitLoop,EndOfInitLoop = GraphBadInputInLoop_1.LNode( '' , PyInitLoop , '' , PyMoreInitLoop , '' , PyNextInitLoop ) EndOfInitLoop.SetName( 'EndOfInitLoop' ) EndOfInitLoop.SetAuthor( '' ) EndOfInitLoop.SetComment( 'Compute Node' ) @@ -64,7 +63,7 @@ def DefGraphBadInputInLoop() : PyEndOfInitLoop.append( ' DoLoop = 0 ' ) PyEndOfInitLoop.append( ' return DoLoop,Index,Min,Max ' ) EndOfInitLoop.SetPyFunction( 'EndOfInitLoop' , PyEndOfInitLoop ) - IInitLoopInitLoop = InitLoop.GetInPort( 'InitLoop' ) + IInitLoopDoLoop = InitLoop.GetInPort( 'DoLoop' ) IInitLoopIndex = InitLoop.InPort( 'Index' , 'long' ) IInitLoopMin = InitLoop.InPort( 'Min' , 'long' ) IInitLoopMax = InitLoop.InPort( 'Max' , 'long' ) @@ -82,6 +81,7 @@ def DefGraphBadInputInLoop() : OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) + OEndOfInitLoopGate = EndOfInitLoop.GetOutPort( 'Gate' ) InitLoop.SetName( 'InitLoop' ) InitLoop.SetAuthor( '' ) InitLoop.SetComment( 'Compute Node' ) @@ -94,7 +94,7 @@ def DefGraphBadInputInLoop() : PySwitch.append( ' if ( a & 1 ) == 0 : ' ) PySwitch.append( ' sleep(1) ' ) PySwitch.append( ' return a & 1,1-(a&1),a ' ) - Switch,EndSwitch = GraphBadInputInLoop.SNode( 'Switch' , PySwitch ) + Switch,EndSwitch = GraphBadInputInLoop_1.SNode( 'Switch' , PySwitch ) EndSwitch.SetName( 'EndSwitch' ) EndSwitch.SetAuthor( '' ) EndSwitch.SetComment( 'Compute Node' ) @@ -114,6 +114,7 @@ def DefGraphBadInputInLoop() : Switch.SetComment( 'Compute Node' ) Switch.Coords( 194 , 109 ) ISwitcha = Switch.InPort( 'a' , 'long' ) + ISwitchInputInLoop = Switch.InPort( 'InputInLoop' , 'long' ) ISwitchGate = Switch.GetInPort( 'Gate' ) OSwitchOdd = Switch.OutPort( 'Odd' , 'long' ) OSwitchEven = Switch.OutPort( 'Even' , 'int' ) @@ -121,42 +122,31 @@ def DefGraphBadInputInLoop() : OSwitchDefault = Switch.GetOutPort( 'Default' ) # Creation of Links - LIsOddaEndSwitcha = GraphBadInputInLoop.Link( OIsOdda , IEndSwitcha ) - LIsOddaEndSwitcha.AddCoord( 1 , 576 , 136 ) - LIsOddaEndSwitcha.AddCoord( 2 , 575 , 81 ) + LIsOddaEndSwitcha = GraphBadInputInLoop_1.Link( OIsOdda , IEndSwitcha ) - LInitLoopIndexSwitcha = GraphBadInputInLoop.Link( OInitLoopIndex , ISwitcha ) + LInitLoopIndexSwitcha = GraphBadInputInLoop_1.Link( OInitLoopIndex , ISwitcha ) - LInitLoopMinEndOfInitLoopMin = GraphBadInputInLoop.Link( OInitLoopMin , IEndOfInitLoopMin ) + LInitLoopMinEndOfInitLoopMin = GraphBadInputInLoop_1.Link( OInitLoopMin , IEndOfInitLoopMin ) - LSwitchOddIsOddGate = GraphBadInputInLoop.Link( OSwitchOdd , IIsOddGate ) + LSwitchOddIsOddGate = GraphBadInputInLoop_1.Link( OSwitchOdd , IIsOddGate ) - LSwitchEvenEndSwitchDefault = GraphBadInputInLoop.Link( OSwitchEven , IEndSwitchDefault ) + LSwitchaIsOdda = GraphBadInputInLoop_1.Link( OSwitcha , IIsOdda ) - LSwitchEvenIsOddEven = GraphBadInputInLoop.Link( OSwitchEven , IIsOddEven ) - LSwitchEvenIsOddEven.AddCoord( 1 , 375 , 111 ) - LSwitchEvenIsOddEven.AddCoord( 2 , 375 , 172 ) + LEndSwitchaEndOfInitLoopIndex = GraphBadInputInLoop_1.Link( OEndSwitcha , IEndOfInitLoopIndex ) - LSwitchaIsOdda = GraphBadInputInLoop.Link( OSwitcha , IIsOdda ) - LSwitchaIsOdda.AddCoord( 1 , 362 , 82 ) - LSwitchaIsOdda.AddCoord( 2 , 360 , 201 ) - - LEndSwitchaEndOfInitLoopIndex = GraphBadInputInLoop.Link( OEndSwitcha , IEndOfInitLoopIndex ) - - LBadInputOfLoopInputInLoopSwitchGate = GraphBadInputInLoop.Link( OBadInputOfLoopInputInLoop , ISwitchGate ) + LBadInputOfLoopInputInLoopSwitchInputInLoop = GraphBadInputInLoop_1.Link( OBadInputOfLoopInputInLoop , ISwitchInputInLoop ) # Input datas IInitLoopIndex.Input( 0 ) IInitLoopMin.Input( 0 ) IInitLoopMax.Input( 100 ) - IEndOfInitLoopMax.Input( 136221856 ) # Output Ports of the graph - #OInitLoopMax = InitLoop.GetOutPort( 'Max' ) #OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) #OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) #OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) - return GraphBadInputInLoop + #OSwitchEven = Switch.GetOutPort( 'Even' ) + return GraphBadInputInLoop_1 -GraphBadInputInLoop = DefGraphBadInputInLoop() +GraphBadInputInLoop_1 = DefGraphBadInputInLoop_1() diff --git a/examples/GraphBadInputInLoop.xml b/examples/GraphBadInputInLoop.xml index ccec624..e546f45 100755 --- a/examples/GraphBadInputInLoop.xml +++ b/examples/GraphBadInputInLoop.xml @@ -5,11 +5,11 @@ ? ? - GraphBadInputInLoop + GraphBadInputInLoop_1 1 ? -GraphBadInputInLoop +GraphBadInputInLoop_1 long @@ -19,15 +19,9 @@ InitLoop__Min long - InitLoop__Max - -long - EndOfInitLoop__Max + InitLoop__Max -long - InitLoop__Max - long EndOfInitLoop__Index @@ -35,11 +29,14 @@ EndOfInitLoop__Min long - EndOfInitLoop__Max + EndOfInitLoop__Max + +int + Switch__Even 22/10/2003 - 10:36:39 - 14/12/2004 - 15:56:35 + 17/6/2005 - 15:31:43 1.05 ? ? @@ -58,10 +55,7 @@ long - a - -boolean - Even + a long @@ -70,13 +64,13 @@ IsOdd - - - - - - 14/12/2004 - 15:56:35 - 14/12/2004 - 15:56:35 + + + + + + 17/6/2005 - 15:25:34 + 17/6/2005 - 15:25:34 1.05 ? ? @@ -122,8 +116,8 @@ ? - 14/12/2004 - 15:56:35 - 14/12/2004 - 15:56:35 + 17/6/2005 - 15:25:34 + 17/6/2005 - 15:25:34 1.05 ? ? @@ -169,8 +163,8 @@ - 14/12/2004 - 15:56:35 - 14/12/2004 - 15:56:35 + 17/6/2005 - 15:25:34 + 17/6/2005 - 15:25:34 1.05 ? ? @@ -188,7 +182,10 @@ long - a + a + +long + InputInLoop long @@ -208,8 +205,8 @@ - 14/12/2004 - 15:56:35 - 14/12/2004 - 15:56:35 + 17/6/2005 - 15:25:34 + 17/6/2005 - 15:25:34 1.05 ? ? @@ -240,8 +237,8 @@ - 14/12/2004 - 15:56:35 - 14/12/2004 - 15:56:35 + 17/6/2005 - 15:25:34 + 17/6/2005 - 15:25:34 1.05 ? ? @@ -259,7 +256,7 @@ -boolean +long InputInLoop @@ -268,8 +265,8 @@ - 14/12/2004 - 15:56:35 - 14/12/2004 - 15:56:35 + 17/6/2005 - 15:25:34 + 17/6/2005 - 15:25:34 2.0 ? ? @@ -282,13 +279,7 @@ a EndSwitch a - - -576 - 136 - -575 - 81 + InitLoop DoLoop @@ -311,7 +302,7 @@ EndOfInitLoop DoLoop InitLoop - InitLoop + DoLoop Switch @@ -320,35 +311,11 @@ Gate -Switch - Even - EndSwitch - Default - - -Switch - Even - IsOdd - Even - - -375 - 111 - -375 - 172 - Switch a IsOdd a - - -362 - 82 - -360 - 201 + EndSwitch a @@ -359,11 +326,11 @@ BadInputOfLoop InputInLoop Switch - Gate + InputInLoop -GraphBadInputInLoop +GraphBadInputInLoop_1 InitLoop__Index InitLoop Index @@ -372,7 +339,7 @@ 0 -GraphBadInputInLoop +GraphBadInputInLoop_1 InitLoop__Min InitLoop Min @@ -381,20 +348,11 @@ 0 -GraphBadInputInLoop +GraphBadInputInLoop_1 InitLoop__Max InitLoop Max 3 100 - - -GraphBadInputInLoop - EndOfInitLoop__Max - EndOfInitLoop - Max - -3 - 136221856 diff --git a/examples/GraphBadInputInLoop1.py b/examples/GraphBadInputInLoop1.py index d5d1da8..bf1e47e 100755 --- a/examples/GraphBadInputInLoop1.py +++ b/examples/GraphBadInputInLoop1.py @@ -1,32 +1,31 @@ -# Generated python file of Graph GraphBadInputInLoop1 +# Generated python file of Graph GraphBadInputInLoop1_1 from SuperV import * -# Graph creation of GraphBadInputInLoop1 -def DefGraphBadInputInLoop1() : - GraphBadInputInLoop1 = Graph( 'GraphBadInputInLoop1' ) - GraphBadInputInLoop1.SetName( 'GraphBadInputInLoop1' ) - GraphBadInputInLoop1.SetAuthor( '' ) - GraphBadInputInLoop1.SetComment( '' ) - GraphBadInputInLoop1.Coords( 0 , 0 ) +# Graph creation of GraphBadInputInLoop1_1 +def DefGraphBadInputInLoop1_1() : + GraphBadInputInLoop1_1 = Graph( 'GraphBadInputInLoop1_1' ) + GraphBadInputInLoop1_1.SetName( 'GraphBadInputInLoop1_1' ) + GraphBadInputInLoop1_1.SetAuthor( '' ) + GraphBadInputInLoop1_1.SetComment( '' ) + GraphBadInputInLoop1_1.Coords( 0 , 0 ) # Creation of Factory Nodes # Creation of InLine Nodes PyIsOdd = [] - PyIsOdd.append( 'from time import * ' ) - PyIsOdd.append( 'def IsOdd(a,Even) : ' ) - PyIsOdd.append( ' print a,"IsOdd (GraphLoopSwitch1)" ' ) - PyIsOdd.append( ' sleep( 1 ) ' ) - PyIsOdd.append( ' return a ' ) - IsOdd = GraphBadInputInLoop1.INode( 'IsOdd' , PyIsOdd ) + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd(a) : ' ) + PyIsOdd.append( ' print a,"IsOdd (GraphLoopSwitch1)" ' ) + PyIsOdd.append( ' sleep( 1 ) ' ) + PyIsOdd.append( ' return a ' ) + IsOdd = GraphBadInputInLoop1_1.INode( 'IsOdd' , PyIsOdd ) IsOdd.SetName( 'IsOdd' ) IsOdd.SetAuthor( '' ) IsOdd.SetComment( 'Python function' ) IsOdd.Coords( 397 , 1 ) IIsOdda = IsOdd.InPort( 'a' , 'long' ) - IIsOddEven = IsOdd.InPort( 'Even' , 'boolean' ) IIsOddGate = IsOdd.GetInPort( 'Gate' ) OIsOdda = IsOdd.OutPort( 'a' , 'long' ) OIsOddGate = IsOdd.GetOutPort( 'Gate' ) @@ -35,7 +34,7 @@ def DefGraphBadInputInLoop1() : PyBadInputOfLoop.append( 'def BadInputOfLoop() : ' ) PyBadInputOfLoop.append( ' return 1 ' ) PyBadInputOfLoop.append( '' ) - BadInputOfLoop = GraphBadInputInLoop1.INode( 'BadInputOfLoop' , PyBadInputOfLoop ) + BadInputOfLoop = GraphBadInputInLoop1_1.INode( 'BadInputOfLoop' , PyBadInputOfLoop ) BadInputOfLoop.SetName( 'BadInputOfLoop' ) BadInputOfLoop.SetAuthor( '' ) BadInputOfLoop.SetComment( 'Compute Node' ) @@ -50,7 +49,7 @@ def DefGraphBadInputInLoop1() : PyMoreInitLoop.append( '' ) PyNextInitLoop = [] PyNextInitLoop.append( '' ) - InitLoop,EndOfInitLoop = GraphBadInputInLoop1.LNode( '' , PyInitLoop , '' , PyMoreInitLoop , '' , PyNextInitLoop ) + InitLoop,EndOfInitLoop = GraphBadInputInLoop1_1.LNode( '' , PyInitLoop , '' , PyMoreInitLoop , '' , PyNextInitLoop ) EndOfInitLoop.SetName( 'EndOfInitLoop' ) EndOfInitLoop.SetAuthor( '' ) EndOfInitLoop.SetComment( 'Compute Node' ) @@ -64,7 +63,7 @@ def DefGraphBadInputInLoop1() : PyEndOfInitLoop.append( ' DoLoop = 0 ' ) PyEndOfInitLoop.append( ' return DoLoop,Index,Min,Max ' ) EndOfInitLoop.SetPyFunction( 'EndOfInitLoop' , PyEndOfInitLoop ) - IInitLoopInitLoop = InitLoop.GetInPort( 'InitLoop' ) + IInitLoopDoLoop = InitLoop.GetInPort( 'DoLoop' ) IInitLoopIndex = InitLoop.InPort( 'Index' , 'long' ) IInitLoopMin = InitLoop.InPort( 'Min' , 'long' ) IInitLoopMax = InitLoop.InPort( 'Max' , 'long' ) @@ -82,6 +81,7 @@ def DefGraphBadInputInLoop1() : OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) + OEndOfInitLoopGate = EndOfInitLoop.GetOutPort( 'Gate' ) InitLoop.SetName( 'InitLoop' ) InitLoop.SetAuthor( '' ) InitLoop.SetComment( 'Compute Node' ) @@ -94,7 +94,7 @@ def DefGraphBadInputInLoop1() : PySwitch.append( ' if ( a & 1 ) == 0 : ' ) PySwitch.append( ' sleep(1) ' ) PySwitch.append( ' return a & 1,1-(a&1),a ' ) - Switch,EndSwitch = GraphBadInputInLoop1.SNode( 'Switch' , PySwitch ) + Switch,EndSwitch = GraphBadInputInLoop1_1.SNode( 'Switch' , PySwitch ) EndSwitch.SetName( 'EndSwitch' ) EndSwitch.SetAuthor( '' ) EndSwitch.SetComment( 'Compute Node' ) @@ -121,42 +121,32 @@ def DefGraphBadInputInLoop1() : OSwitchDefault = Switch.GetOutPort( 'Default' ) # Creation of Links - LIsOddaEndSwitcha = GraphBadInputInLoop1.Link( OIsOdda , IEndSwitcha ) - LIsOddaEndSwitcha.AddCoord( 1 , 576 , 136 ) - LIsOddaEndSwitcha.AddCoord( 2 , 575 , 81 ) + LIsOddaEndSwitcha = GraphBadInputInLoop1_1.Link( OIsOdda , IEndSwitcha ) - LInitLoopIndexSwitcha = GraphBadInputInLoop1.Link( OInitLoopIndex , ISwitcha ) + LInitLoopIndexSwitcha = GraphBadInputInLoop1_1.Link( OInitLoopIndex , ISwitcha ) - LInitLoopMinEndOfInitLoopMin = GraphBadInputInLoop1.Link( OInitLoopMin , IEndOfInitLoopMin ) + LInitLoopMinEndOfInitLoopMin = GraphBadInputInLoop1_1.Link( OInitLoopMin , IEndOfInitLoopMin ) - LSwitchOddIsOddGate = GraphBadInputInLoop1.Link( OSwitchOdd , IIsOddGate ) + LSwitchOddIsOddGate = GraphBadInputInLoop1_1.Link( OSwitchOdd , IIsOddGate ) - LSwitchEvenEndSwitchDefault = GraphBadInputInLoop1.Link( OSwitchEven , IEndSwitchDefault ) + LSwitchEvenEndSwitchDefault = GraphBadInputInLoop1_1.Link( OSwitchEven , IEndSwitchDefault ) - LSwitchEvenIsOddEven = GraphBadInputInLoop1.Link( OSwitchEven , IIsOddEven ) - LSwitchEvenIsOddEven.AddCoord( 1 , 375 , 111 ) - LSwitchEvenIsOddEven.AddCoord( 2 , 375 , 172 ) + LSwitchaIsOdda = GraphBadInputInLoop1_1.Link( OSwitcha , IIsOdda ) - LSwitchaIsOdda = GraphBadInputInLoop1.Link( OSwitcha , IIsOdda ) - LSwitchaIsOdda.AddCoord( 1 , 362 , 82 ) - LSwitchaIsOdda.AddCoord( 2 , 360 , 201 ) + LEndSwitchaEndOfInitLoopIndex = GraphBadInputInLoop1_1.Link( OEndSwitcha , IEndOfInitLoopIndex ) - LEndSwitchaEndOfInitLoopIndex = GraphBadInputInLoop1.Link( OEndSwitcha , IEndOfInitLoopIndex ) - - LBadInputOfLoopInputInLoopEndOfInitLoopGate = GraphBadInputInLoop1.Link( OBadInputOfLoopInputInLoop , IEndOfInitLoopGate ) + LBadInputOfLoopInputInLoopEndOfInitLoopMax = GraphBadInputInLoop1_1.Link( OBadInputOfLoopInputInLoop , IEndOfInitLoopMax ) # Input datas IInitLoopIndex.Input( 0 ) IInitLoopMin.Input( 0 ) IInitLoopMax.Input( 100 ) - IEndOfInitLoopMax.Input( 136221856 ) # Output Ports of the graph - #OInitLoopMax = InitLoop.GetOutPort( 'Max' ) #OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) #OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) #OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) - return GraphBadInputInLoop1 + return GraphBadInputInLoop1_1 -GraphBadInputInLoop1 = DefGraphBadInputInLoop1() +GraphBadInputInLoop1_1 = DefGraphBadInputInLoop1_1() diff --git a/examples/GraphBadInputInLoop1.xml b/examples/GraphBadInputInLoop1.xml index 5efd5ef..b632f69 100755 --- a/examples/GraphBadInputInLoop1.xml +++ b/examples/GraphBadInputInLoop1.xml @@ -5,11 +5,11 @@ ? ? - GraphBadInputInLoop1 + GraphBadInputInLoop1_1 1 ? -GraphBadInputInLoop1 +GraphBadInputInLoop1_1 long @@ -19,15 +19,9 @@ InitLoop__Min long - InitLoop__Max - -long - EndOfInitLoop__Max + InitLoop__Max -long - InitLoop__Max - long EndOfInitLoop__Index @@ -39,7 +33,7 @@ 22/10/2003 - 10:36:39 - 14/12/2004 - 15:57:27 + 17/6/2005 - 16:4:48 1.05 ? ? @@ -58,10 +52,7 @@ long - a - -boolean - Even + a long @@ -70,13 +61,13 @@ IsOdd - - - - - - 14/12/2004 - 15:57:27 - 14/12/2004 - 15:57:27 + + + + + + 17/6/2005 - 16:4:37 + 17/6/2005 - 16:4:37 1.05 ? ? @@ -122,8 +113,8 @@ ? - 14/12/2004 - 15:57:27 - 14/12/2004 - 15:57:27 + 17/6/2005 - 16:4:37 + 17/6/2005 - 16:4:37 1.05 ? ? @@ -169,8 +160,8 @@ - 14/12/2004 - 15:57:27 - 14/12/2004 - 15:57:27 + 17/6/2005 - 16:4:37 + 17/6/2005 - 16:4:37 1.05 ? ? @@ -208,8 +199,8 @@ - 14/12/2004 - 15:57:27 - 14/12/2004 - 15:57:27 + 17/6/2005 - 16:4:37 + 17/6/2005 - 16:4:37 1.05 ? ? @@ -240,8 +231,8 @@ - 14/12/2004 - 15:57:27 - 14/12/2004 - 15:57:27 + 17/6/2005 - 16:4:37 + 17/6/2005 - 16:4:37 1.05 ? ? @@ -268,8 +259,8 @@ - 14/12/2004 - 15:57:27 - 14/12/2004 - 15:57:27 + 17/6/2005 - 16:4:37 + 17/6/2005 - 16:4:37 2.0 ? ? @@ -282,13 +273,7 @@ a EndSwitch a - - -576 - 136 - -575 - 81 + InitLoop DoLoop @@ -311,7 +296,7 @@ EndOfInitLoop DoLoop InitLoop - InitLoop + DoLoop Switch @@ -326,29 +311,11 @@ Default -Switch - Even - IsOdd - Even - - -375 - 111 - -375 - 172 - Switch a IsOdd a - - -362 - 82 - -360 - 201 + EndSwitch a @@ -359,11 +326,11 @@ BadInputOfLoop InputInLoop EndOfInitLoop - Gate + Max -GraphBadInputInLoop1 +GraphBadInputInLoop1_1 InitLoop__Index InitLoop Index @@ -372,7 +339,7 @@ 0 -GraphBadInputInLoop1 +GraphBadInputInLoop1_1 InitLoop__Min InitLoop Min @@ -381,20 +348,11 @@ 0 -GraphBadInputInLoop1 +GraphBadInputInLoop1_1 InitLoop__Max InitLoop Max 3 100 - - -GraphBadInputInLoop1 - EndOfInitLoop__Max - EndOfInitLoop - Max - -3 - 136221856 diff --git a/examples/GraphBadInputInLoop2.py b/examples/GraphBadInputInLoop2.py index eea51de..52e8ec1 100755 --- a/examples/GraphBadInputInLoop2.py +++ b/examples/GraphBadInputInLoop2.py @@ -15,18 +15,17 @@ def DefGraphBadInputInLoop2() : # Creation of InLine Nodes PyIsOdd = [] - PyIsOdd.append( 'from time import * ' ) - PyIsOdd.append( 'def IsOdd(a,Even,InputInLoop) : ' ) - PyIsOdd.append( ' print a,"IsOdd (GraphLoopSwitch1)" ' ) - PyIsOdd.append( ' sleep( 1 ) ' ) - PyIsOdd.append( ' return a ' ) + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd(a,InputInLoop) : ' ) + PyIsOdd.append( ' print a,"IsOdd (GraphLoopSwitch1)" ' ) + PyIsOdd.append( ' sleep( 1 ) ' ) + PyIsOdd.append( ' return a ' ) IsOdd = GraphBadInputInLoop2.INode( 'IsOdd' , PyIsOdd ) IsOdd.SetName( 'IsOdd' ) IsOdd.SetAuthor( '' ) IsOdd.SetComment( 'Python function' ) IsOdd.Coords( 397 , 1 ) IIsOdda = IsOdd.InPort( 'a' , 'long' ) - IIsOddEven = IsOdd.InPort( 'Even' , 'boolean' ) IIsOddInputInLoop = IsOdd.InPort( 'InputInLoop' , 'boolean' ) IIsOddGate = IsOdd.GetInPort( 'Gate' ) OIsOdda = IsOdd.OutPort( 'a' , 'long' ) @@ -65,7 +64,7 @@ def DefGraphBadInputInLoop2() : PyEndOfInitLoop.append( ' DoLoop = 0 ' ) PyEndOfInitLoop.append( ' return DoLoop,Index,Min,Max ' ) EndOfInitLoop.SetPyFunction( 'EndOfInitLoop' , PyEndOfInitLoop ) - IInitLoopInitLoop = InitLoop.GetInPort( 'InitLoop' ) + IInitLoopDoLoop = InitLoop.GetInPort( 'DoLoop' ) IInitLoopIndex = InitLoop.InPort( 'Index' , 'long' ) IInitLoopMin = InitLoop.InPort( 'Min' , 'long' ) IInitLoopMax = InitLoop.InPort( 'Max' , 'long' ) @@ -83,6 +82,7 @@ def DefGraphBadInputInLoop2() : OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) + OEndOfInitLoopGate = EndOfInitLoop.GetOutPort( 'Gate' ) InitLoop.SetName( 'InitLoop' ) InitLoop.SetAuthor( '' ) InitLoop.SetComment( 'Compute Node' ) @@ -123,8 +123,6 @@ def DefGraphBadInputInLoop2() : # Creation of Links LIsOddaEndSwitcha = GraphBadInputInLoop2.Link( OIsOdda , IEndSwitcha ) - LIsOddaEndSwitcha.AddCoord( 1 , 576 , 136 ) - LIsOddaEndSwitcha.AddCoord( 2 , 575 , 81 ) LInitLoopIndexSwitcha = GraphBadInputInLoop2.Link( OInitLoopIndex , ISwitcha ) @@ -134,13 +132,7 @@ def DefGraphBadInputInLoop2() : LSwitchEvenEndSwitchDefault = GraphBadInputInLoop2.Link( OSwitchEven , IEndSwitchDefault ) - LSwitchEvenIsOddEven = GraphBadInputInLoop2.Link( OSwitchEven , IIsOddEven ) - LSwitchEvenIsOddEven.AddCoord( 1 , 375 , 111 ) - LSwitchEvenIsOddEven.AddCoord( 2 , 375 , 172 ) - LSwitchaIsOdda = GraphBadInputInLoop2.Link( OSwitcha , IIsOdda ) - LSwitchaIsOdda.AddCoord( 1 , 362 , 82 ) - LSwitchaIsOdda.AddCoord( 2 , 360 , 201 ) LEndSwitchaEndOfInitLoopIndex = GraphBadInputInLoop2.Link( OEndSwitcha , IEndOfInitLoopIndex ) @@ -150,10 +142,8 @@ def DefGraphBadInputInLoop2() : IInitLoopIndex.Input( 0 ) IInitLoopMin.Input( 0 ) IInitLoopMax.Input( 100 ) - IEndOfInitLoopMax.Input( 136221856 ) # Output Ports of the graph - #OInitLoopMax = InitLoop.GetOutPort( 'Max' ) #OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) #OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) #OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) diff --git a/examples/GraphBadInputInLoop2.xml b/examples/GraphBadInputInLoop2.xml index 3e5ec3c..e531167 100755 --- a/examples/GraphBadInputInLoop2.xml +++ b/examples/GraphBadInputInLoop2.xml @@ -19,15 +19,9 @@ InitLoop__Min long - InitLoop__Max - -long - EndOfInitLoop__Max + InitLoop__Max -long - InitLoop__Max - long EndOfInitLoop__Index @@ -39,7 +33,7 @@ 22/10/2003 - 10:36:39 - 14/12/2004 - 15:57:56 + 6/6/2005 - 11:9:55 1.05 ? ? @@ -60,9 +54,6 @@ long a -boolean - Even - boolean InputInLoop @@ -73,13 +64,13 @@ IsOdd - - - - - - 14/12/2004 - 15:57:56 - 14/12/2004 - 15:57:56 + + + + + + 6/6/2005 - 11:9:7 + 6/6/2005 - 11:9:7 1.05 ? ? @@ -125,8 +116,8 @@ ? - 14/12/2004 - 15:57:56 - 14/12/2004 - 15:57:56 + 6/6/2005 - 11:9:7 + 6/6/2005 - 11:9:7 1.05 ? ? @@ -172,8 +163,8 @@ - 14/12/2004 - 15:57:56 - 14/12/2004 - 15:57:56 + 6/6/2005 - 11:9:7 + 6/6/2005 - 11:9:7 1.05 ? ? @@ -211,8 +202,8 @@ - 14/12/2004 - 15:57:56 - 14/12/2004 - 15:57:56 + 6/6/2005 - 11:9:7 + 6/6/2005 - 11:9:7 1.05 ? ? @@ -243,8 +234,8 @@ - 14/12/2004 - 15:57:56 - 14/12/2004 - 15:57:56 + 6/6/2005 - 11:9:7 + 6/6/2005 - 11:9:7 1.05 ? ? @@ -271,8 +262,8 @@ - 14/12/2004 - 15:57:56 - 14/12/2004 - 15:57:56 + 6/6/2005 - 11:9:7 + 6/6/2005 - 11:9:7 2.0 ? ? @@ -285,13 +276,7 @@ a EndSwitch a - - -576 - 136 - -575 - 81 + InitLoop DoLoop @@ -314,7 +299,7 @@ EndOfInitLoop DoLoop InitLoop - InitLoop + DoLoop Switch @@ -329,29 +314,11 @@ Default -Switch - Even - IsOdd - Even - - -375 - 111 - -375 - 172 - Switch a IsOdd a - - -362 - 82 - -360 - 201 + EndSwitch a @@ -391,13 +358,4 @@ 3 100 - - -GraphBadInputInLoop2 - EndOfInitLoop__Max - EndOfInitLoop - Max - -3 - 136221856 diff --git a/examples/GraphBadInputInLoop3.py b/examples/GraphBadInputInLoop3.py index 71c7c77..0297578 100755 --- a/examples/GraphBadInputInLoop3.py +++ b/examples/GraphBadInputInLoop3.py @@ -15,18 +15,17 @@ def DefGraphBadInputInLoop3() : # Creation of InLine Nodes PyIsOdd = [] - PyIsOdd.append( 'from time import * ' ) - PyIsOdd.append( 'def IsOdd(a,Even,InputInLoop) : ' ) - PyIsOdd.append( ' print a,"IsOdd (GraphLoopSwitch1)" ' ) - PyIsOdd.append( ' sleep( 1 ) ' ) - PyIsOdd.append( ' return a ' ) + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd(a,InputInLoop) : ' ) + PyIsOdd.append( ' print a,"IsOdd (GraphLoopSwitch1)" ' ) + PyIsOdd.append( ' sleep( 1 ) ' ) + PyIsOdd.append( ' return a ' ) IsOdd = GraphBadInputInLoop3.INode( 'IsOdd' , PyIsOdd ) IsOdd.SetName( 'IsOdd' ) IsOdd.SetAuthor( '' ) IsOdd.SetComment( 'Python function' ) IsOdd.Coords( 397 , 1 ) IIsOdda = IsOdd.InPort( 'a' , 'long' ) - IIsOddEven = IsOdd.InPort( 'Even' , 'boolean' ) IIsOddInputInLoop = IsOdd.InPort( 'InputInLoop' , 'boolean' ) IIsOddGate = IsOdd.GetInPort( 'Gate' ) OIsOdda = IsOdd.OutPort( 'a' , 'long' ) @@ -65,7 +64,7 @@ def DefGraphBadInputInLoop3() : PyEndOfInitLoop.append( ' DoLoop = 0 ' ) PyEndOfInitLoop.append( ' return DoLoop,Index,Min,Max ' ) EndOfInitLoop.SetPyFunction( 'EndOfInitLoop' , PyEndOfInitLoop ) - IInitLoopInitLoop = InitLoop.GetInPort( 'InitLoop' ) + IInitLoopDoLoop = InitLoop.GetInPort( 'DoLoop' ) IInitLoopIndex = InitLoop.InPort( 'Index' , 'long' ) IInitLoopMin = InitLoop.InPort( 'Min' , 'long' ) IInitLoopMax = InitLoop.InPort( 'Max' , 'long' ) @@ -83,6 +82,7 @@ def DefGraphBadInputInLoop3() : OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) + OEndOfInitLoopGate = EndOfInitLoop.GetOutPort( 'Gate' ) InitLoop.SetName( 'InitLoop' ) InitLoop.SetAuthor( '' ) InitLoop.SetComment( 'Compute Node' ) @@ -123,8 +123,6 @@ def DefGraphBadInputInLoop3() : # Creation of Links LIsOddaEndSwitcha = GraphBadInputInLoop3.Link( OIsOdda , IEndSwitcha ) - LIsOddaEndSwitcha.AddCoord( 1 , 576 , 136 ) - LIsOddaEndSwitcha.AddCoord( 2 , 575 , 81 ) LInitLoopIndexSwitcha = GraphBadInputInLoop3.Link( OInitLoopIndex , ISwitcha ) @@ -134,13 +132,7 @@ def DefGraphBadInputInLoop3() : LSwitchEvenEndSwitchDefault = GraphBadInputInLoop3.Link( OSwitchEven , IEndSwitchDefault ) - LSwitchEvenIsOddEven = GraphBadInputInLoop3.Link( OSwitchEven , IIsOddEven ) - LSwitchEvenIsOddEven.AddCoord( 1 , 375 , 111 ) - LSwitchEvenIsOddEven.AddCoord( 2 , 375 , 172 ) - LSwitchaIsOdda = GraphBadInputInLoop3.Link( OSwitcha , IIsOdda ) - LSwitchaIsOdda.AddCoord( 1 , 362 , 82 ) - LSwitchaIsOdda.AddCoord( 2 , 360 , 201 ) LEndSwitchaEndOfInitLoopIndex = GraphBadInputInLoop3.Link( OEndSwitcha , IEndOfInitLoopIndex ) @@ -150,13 +142,11 @@ def DefGraphBadInputInLoop3() : IInitLoopIndex.Input( 0 ) IInitLoopMin.Input( 0 ) IInitLoopMax.Input( 100 ) - IEndOfInitLoopMax.Input( 136221856 ) # Input Ports of the graph #IIsOddInputInLoop = IsOdd.GetInPort( 'InputInLoop' ) # Output Ports of the graph - #OInitLoopMax = InitLoop.GetOutPort( 'Max' ) #OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) #OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) #OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) diff --git a/examples/GraphBadInputInLoop3.xml b/examples/GraphBadInputInLoop3.xml index 46199ef..c0f38ff 100755 --- a/examples/GraphBadInputInLoop3.xml +++ b/examples/GraphBadInputInLoop3.xml @@ -22,15 +22,9 @@ InitLoop__Min long - InitLoop__Max - -long - EndOfInitLoop__Max + InitLoop__Max -long - InitLoop__Max - long EndOfInitLoop__Index @@ -45,7 +39,7 @@ 22/10/2003 - 10:36:39 - 14/12/2004 - 15:58:23 + 6/6/2005 - 11:13:36 1.05 ? ? @@ -66,9 +60,6 @@ long a -boolean - Even - boolean InputInLoop @@ -79,13 +70,13 @@ IsOdd - - - - - - 14/12/2004 - 15:58:23 - 14/12/2004 - 15:58:23 + + + + + + 6/6/2005 - 11:11:59 + 6/6/2005 - 11:11:59 1.05 ? ? @@ -131,8 +122,8 @@ ? - 14/12/2004 - 15:58:23 - 14/12/2004 - 15:58:23 + 6/6/2005 - 11:11:59 + 6/6/2005 - 11:11:59 1.05 ? ? @@ -178,8 +169,8 @@ - 14/12/2004 - 15:58:23 - 14/12/2004 - 15:58:23 + 6/6/2005 - 11:11:59 + 6/6/2005 - 11:11:59 1.05 ? ? @@ -217,8 +208,8 @@ - 14/12/2004 - 15:58:23 - 14/12/2004 - 15:58:23 + 6/6/2005 - 11:11:59 + 6/6/2005 - 11:11:59 1.05 ? ? @@ -249,8 +240,8 @@ - 14/12/2004 - 15:58:23 - 14/12/2004 - 15:58:23 + 6/6/2005 - 11:11:59 + 6/6/2005 - 11:11:59 1.05 ? ? @@ -277,8 +268,8 @@ - 14/12/2004 - 15:58:23 - 14/12/2004 - 15:58:23 + 6/6/2005 - 11:11:59 + 6/6/2005 - 11:11:59 2.0 ? ? @@ -291,13 +282,7 @@ a EndSwitch a - - -576 - 136 - -575 - 81 + InitLoop DoLoop @@ -320,7 +305,7 @@ EndOfInitLoop DoLoop InitLoop - InitLoop + DoLoop Switch @@ -335,29 +320,11 @@ Default -Switch - Even - IsOdd - Even - - -375 - 111 - -375 - 172 - Switch a IsOdd a - - -362 - 82 - -360 - 201 + EndSwitch a @@ -397,13 +364,4 @@ 3 100 - - -GraphBadInputInLoop3 - EndOfInitLoop__Max - EndOfInitLoop - Max - -3 - 136221856 diff --git a/examples/GraphBadOutputOfLoop.py b/examples/GraphBadOutputOfLoop.py index 28c91d9..f6478a7 100755 --- a/examples/GraphBadOutputOfLoop.py +++ b/examples/GraphBadOutputOfLoop.py @@ -15,18 +15,17 @@ def DefGraphBadOutputOfLoop() : # Creation of InLine Nodes PyIsOdd = [] - PyIsOdd.append( 'from time import * ' ) - PyIsOdd.append( 'def IsOdd(a,Even,InputInLoop) : ' ) - PyIsOdd.append( ' print a,"IsOdd (GraphLoopSwitch1)" ' ) - PyIsOdd.append( ' sleep( 1 ) ' ) - PyIsOdd.append( ' return a ' ) + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd(a,InputInLoop) : ' ) + PyIsOdd.append( ' print a,"IsOdd (GraphLoopSwitch1)" ' ) + PyIsOdd.append( ' sleep( 1 ) ' ) + PyIsOdd.append( ' return a ' ) IsOdd = GraphBadOutputOfLoop.INode( 'IsOdd' , PyIsOdd ) IsOdd.SetName( 'IsOdd' ) IsOdd.SetAuthor( '' ) IsOdd.SetComment( 'Python function' ) IsOdd.Coords( 397 , 1 ) IIsOdda = IsOdd.InPort( 'a' , 'long' ) - IIsOddEven = IsOdd.InPort( 'Even' , 'boolean' ) IIsOddInputInLoop = IsOdd.InPort( 'InputInLoop' , 'boolean' ) IIsOddGate = IsOdd.GetInPort( 'Gate' ) OIsOdda = IsOdd.OutPort( 'a' , 'long' ) @@ -65,7 +64,7 @@ def DefGraphBadOutputOfLoop() : PyEndOfInitLoop.append( ' DoLoop = 0 ' ) PyEndOfInitLoop.append( ' return DoLoop,Index,Min,Max ' ) EndOfInitLoop.SetPyFunction( 'EndOfInitLoop' , PyEndOfInitLoop ) - IInitLoopInitLoop = InitLoop.GetInPort( 'InitLoop' ) + IInitLoopDoLoop = InitLoop.GetInPort( 'DoLoop' ) IInitLoopIndex = InitLoop.InPort( 'Index' , 'long' ) IInitLoopMin = InitLoop.InPort( 'Min' , 'long' ) IInitLoopMax = InitLoop.InPort( 'Max' , 'long' ) @@ -83,6 +82,7 @@ def DefGraphBadOutputOfLoop() : OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) + OEndOfInitLoopGate = EndOfInitLoop.GetOutPort( 'Gate' ) InitLoop.SetName( 'InitLoop' ) InitLoop.SetAuthor( '' ) InitLoop.SetComment( 'Compute Node' ) @@ -123,8 +123,6 @@ def DefGraphBadOutputOfLoop() : # Creation of Links LIsOddaEndSwitcha = GraphBadOutputOfLoop.Link( OIsOdda , IEndSwitcha ) - LIsOddaEndSwitcha.AddCoord( 1 , 576 , 136 ) - LIsOddaEndSwitcha.AddCoord( 2 , 575 , 81 ) LInitLoopIndexSwitcha = GraphBadOutputOfLoop.Link( OInitLoopIndex , ISwitcha ) @@ -134,27 +132,21 @@ def DefGraphBadOutputOfLoop() : LSwitchEvenEndSwitchDefault = GraphBadOutputOfLoop.Link( OSwitchEven , IEndSwitchDefault ) - LSwitchEvenIsOddEven = GraphBadOutputOfLoop.Link( OSwitchEven , IIsOddEven ) - LSwitchEvenIsOddEven.AddCoord( 1 , 375 , 111 ) - LSwitchEvenIsOddEven.AddCoord( 2 , 375 , 172 ) - LSwitchaIsOdda = GraphBadOutputOfLoop.Link( OSwitcha , IIsOdda ) - LSwitchaIsOdda.AddCoord( 1 , 362 , 82 ) - LSwitchaIsOdda.AddCoord( 2 , 360 , 201 ) LEndSwitchaEndOfInitLoopIndex = GraphBadOutputOfLoop.Link( OEndSwitcha , IEndOfInitLoopIndex ) LEndSwitchaBadOutputOfLoopOutputOfLoop = GraphBadOutputOfLoop.Link( OEndSwitcha , IBadOutputOfLoopOutputOfLoop ) # Input datas - IIsOddInputInLoop.Input( 136306160 ) IInitLoopIndex.Input( 0 ) IInitLoopMin.Input( 0 ) IInitLoopMax.Input( 100 ) - IEndOfInitLoopMax.Input( 136221856 ) + + # Input Ports of the graph + #IIsOddInputInLoop = IsOdd.GetInPort( 'InputInLoop' ) # Output Ports of the graph - #OInitLoopMax = InitLoop.GetOutPort( 'Max' ) #OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) #OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) #OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) diff --git a/examples/GraphBadOutputOfLoop.xml b/examples/GraphBadOutputOfLoop.xml index 1965e84..92424d7 100755 --- a/examples/GraphBadOutputOfLoop.xml +++ b/examples/GraphBadOutputOfLoop.xml @@ -22,15 +22,9 @@ InitLoop__Min long - InitLoop__Max - -long - EndOfInitLoop__Max + InitLoop__Max -long - InitLoop__Max - long EndOfInitLoop__Index @@ -42,7 +36,7 @@ 22/10/2003 - 10:36:39 - 14/12/2004 - 15:58:56 + 6/6/2005 - 11:19:39 1.05 ? ? @@ -63,9 +57,6 @@ long a -boolean - Even - boolean InputInLoop @@ -76,13 +67,13 @@ IsOdd - - - - - - 14/12/2004 - 15:58:56 - 14/12/2004 - 15:58:56 + + + + + + 6/6/2005 - 11:18:37 + 6/6/2005 - 11:18:37 1.05 ? ? @@ -128,8 +119,8 @@ ? - 14/12/2004 - 15:58:56 - 14/12/2004 - 15:58:56 + 6/6/2005 - 11:18:37 + 6/6/2005 - 11:18:37 1.05 ? ? @@ -175,8 +166,8 @@ - 14/12/2004 - 15:58:56 - 14/12/2004 - 15:58:56 + 6/6/2005 - 11:18:37 + 6/6/2005 - 11:18:37 1.05 ? ? @@ -214,8 +205,8 @@ - 14/12/2004 - 15:58:56 - 14/12/2004 - 15:58:56 + 6/6/2005 - 11:18:37 + 6/6/2005 - 11:18:37 1.05 ? ? @@ -246,8 +237,8 @@ - 14/12/2004 - 15:58:56 - 14/12/2004 - 15:58:56 + 6/6/2005 - 11:18:37 + 6/6/2005 - 11:18:37 1.05 ? ? @@ -274,8 +265,8 @@ - 14/12/2004 - 15:58:56 - 14/12/2004 - 15:58:56 + 6/6/2005 - 11:18:37 + 6/6/2005 - 11:18:37 2.0 ? ? @@ -288,13 +279,7 @@ a EndSwitch a - - -576 - 136 - -575 - 81 + InitLoop DoLoop @@ -317,7 +302,7 @@ EndOfInitLoop DoLoop InitLoop - InitLoop + DoLoop Switch @@ -332,29 +317,11 @@ Default -Switch - Even - IsOdd - Even - - -375 - 111 - -375 - 172 - Switch a IsOdd a - - -362 - 82 - -360 - 201 + EndSwitch a @@ -369,15 +336,6 @@ -GraphBadOutputOfLoop - IsOdd__InputInLoop - IsOdd - InputInLoop - -3 - 136306160 - - GraphBadOutputOfLoop InitLoop__Index InitLoop @@ -403,13 +361,4 @@ 3 100 - - -GraphBadOutputOfLoop - EndOfInitLoop__Max - EndOfInitLoop - Max - -3 - 136221856 diff --git a/examples/GraphBadOutputOfLoop1.py b/examples/GraphBadOutputOfLoop1.py index 3405c93..700af33 100755 --- a/examples/GraphBadOutputOfLoop1.py +++ b/examples/GraphBadOutputOfLoop1.py @@ -15,19 +15,17 @@ def DefGraphBadOutputOfLoop1() : # Creation of InLine Nodes PyIsOdd = [] - PyIsOdd.append( 'from time import * ' ) - PyIsOdd.append( 'def IsOdd(a,Even,InputInLoop) : ' ) - PyIsOdd.append( ' print a,"IsOdd (GraphLoopSwitch1)" ' ) - PyIsOdd.append( ' sleep( 1 ) ' ) - PyIsOdd.append( ' return a ' ) + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd(a) : ' ) + PyIsOdd.append( ' print a,"IsOdd (GraphLoopSwitch1)" ' ) + PyIsOdd.append( ' sleep( 1 ) ' ) + PyIsOdd.append( ' return a ' ) IsOdd = GraphBadOutputOfLoop1.INode( 'IsOdd' , PyIsOdd ) IsOdd.SetName( 'IsOdd' ) IsOdd.SetAuthor( '' ) IsOdd.SetComment( 'Python function' ) IsOdd.Coords( 397 , 1 ) IIsOdda = IsOdd.InPort( 'a' , 'long' ) - IIsOddEven = IsOdd.InPort( 'Even' , 'boolean' ) - IIsOddInputInLoop = IsOdd.InPort( 'InputInLoop' , 'boolean' ) IIsOddGate = IsOdd.GetInPort( 'Gate' ) OIsOdda = IsOdd.OutPort( 'a' , 'long' ) OIsOddGate = IsOdd.GetOutPort( 'Gate' ) @@ -65,7 +63,7 @@ def DefGraphBadOutputOfLoop1() : PyEndOfInitLoop.append( ' DoLoop = 0 ' ) PyEndOfInitLoop.append( ' return DoLoop,Index,Min,Max ' ) EndOfInitLoop.SetPyFunction( 'EndOfInitLoop' , PyEndOfInitLoop ) - IInitLoopInitLoop = InitLoop.GetInPort( 'InitLoop' ) + IInitLoopDoLoop = InitLoop.GetInPort( 'DoLoop' ) IInitLoopIndex = InitLoop.InPort( 'Index' , 'long' ) IInitLoopMin = InitLoop.InPort( 'Min' , 'long' ) IInitLoopMax = InitLoop.InPort( 'Max' , 'long' ) @@ -83,6 +81,7 @@ def DefGraphBadOutputOfLoop1() : OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) + OEndOfInitLoopGate = EndOfInitLoop.GetOutPort( 'Gate' ) InitLoop.SetName( 'InitLoop' ) InitLoop.SetAuthor( '' ) InitLoop.SetComment( 'Compute Node' ) @@ -123,8 +122,6 @@ def DefGraphBadOutputOfLoop1() : # Creation of Links LIsOddaEndSwitcha = GraphBadOutputOfLoop1.Link( OIsOdda , IEndSwitcha ) - LIsOddaEndSwitcha.AddCoord( 1 , 576 , 136 ) - LIsOddaEndSwitcha.AddCoord( 2 , 575 , 81 ) LInitLoopIndexSwitcha = GraphBadOutputOfLoop1.Link( OInitLoopIndex , ISwitcha ) @@ -136,22 +133,14 @@ def DefGraphBadOutputOfLoop1() : LSwitchEvenEndSwitchDefault = GraphBadOutputOfLoop1.Link( OSwitchEven , IEndSwitchDefault ) - LSwitchEvenIsOddEven = GraphBadOutputOfLoop1.Link( OSwitchEven , IIsOddEven ) - LSwitchEvenIsOddEven.AddCoord( 1 , 375 , 111 ) - LSwitchEvenIsOddEven.AddCoord( 2 , 375 , 172 ) - LSwitchaIsOdda = GraphBadOutputOfLoop1.Link( OSwitcha , IIsOdda ) - LSwitchaIsOdda.AddCoord( 1 , 362 , 82 ) - LSwitchaIsOdda.AddCoord( 2 , 360 , 201 ) LEndSwitchaEndOfInitLoopIndex = GraphBadOutputOfLoop1.Link( OEndSwitcha , IEndOfInitLoopIndex ) # Input datas - IIsOddInputInLoop.Input( 136306160 ) IInitLoopIndex.Input( 0 ) IInitLoopMin.Input( 0 ) IInitLoopMax.Input( 100 ) - IEndOfInitLoopMax.Input( 136221856 ) # Output Ports of the graph #OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) diff --git a/examples/GraphBadOutputOfLoop1.xml b/examples/GraphBadOutputOfLoop1.xml index 6f0ed94..8c6419c 100755 --- a/examples/GraphBadOutputOfLoop1.xml +++ b/examples/GraphBadOutputOfLoop1.xml @@ -12,9 +12,6 @@ GraphBadOutputOfLoop1 -boolean - IsOdd__InputInLoop - long InitLoop__Index @@ -22,10 +19,7 @@ InitLoop__Min long - InitLoop__Max - -long - EndOfInitLoop__Max + InitLoop__Max long @@ -39,7 +33,7 @@ 22/10/2003 - 10:36:39 - 14/12/2004 - 15:59:22 + 6/6/2005 - 11:25:16 1.05 ? ? @@ -58,13 +52,7 @@ long - a - -boolean - Even - -boolean - InputInLoop + a long @@ -73,13 +61,13 @@ IsOdd - - - - - - 14/12/2004 - 15:59:22 - 14/12/2004 - 15:59:22 + + + + + + 6/6/2005 - 11:23:48 + 6/6/2005 - 11:23:48 1.05 ? ? @@ -125,8 +113,8 @@ ? - 14/12/2004 - 15:59:22 - 14/12/2004 - 15:59:22 + 6/6/2005 - 11:23:48 + 6/6/2005 - 11:23:48 1.05 ? ? @@ -172,8 +160,8 @@ - 14/12/2004 - 15:59:22 - 14/12/2004 - 15:59:22 + 6/6/2005 - 11:23:48 + 6/6/2005 - 11:23:48 1.05 ? ? @@ -211,8 +199,8 @@ - 14/12/2004 - 15:59:22 - 14/12/2004 - 15:59:22 + 6/6/2005 - 11:23:48 + 6/6/2005 - 11:23:48 1.05 ? ? @@ -243,8 +231,8 @@ - 14/12/2004 - 15:59:22 - 14/12/2004 - 15:59:22 + 6/6/2005 - 11:23:48 + 6/6/2005 - 11:23:48 1.05 ? ? @@ -271,8 +259,8 @@ - 14/12/2004 - 15:59:22 - 14/12/2004 - 15:59:22 + 6/6/2005 - 11:23:48 + 6/6/2005 - 11:23:48 2.0 ? ? @@ -285,13 +273,7 @@ a EndSwitch a - - -576 - 136 - -575 - 81 + InitLoop DoLoop @@ -320,7 +302,7 @@ EndOfInitLoop DoLoop InitLoop - InitLoop + DoLoop Switch @@ -335,29 +317,11 @@ Default -Switch - Even - IsOdd - Even - - -375 - 111 - -375 - 172 - Switch a IsOdd a - - -362 - 82 - -360 - 201 + EndSwitch a @@ -366,15 +330,6 @@ -GraphBadOutputOfLoop1 - IsOdd__InputInLoop - IsOdd - InputInLoop - -3 - 136306160 - - GraphBadOutputOfLoop1 InitLoop__Index InitLoop @@ -400,13 +355,4 @@ 3 100 - - -GraphBadOutputOfLoop1 - EndOfInitLoop__Max - EndOfInitLoop - Max - -3 - 136221856 diff --git a/examples/GraphBadOutputOfLoop2.py b/examples/GraphBadOutputOfLoop2.py index a0a71f1..6beae23 100755 --- a/examples/GraphBadOutputOfLoop2.py +++ b/examples/GraphBadOutputOfLoop2.py @@ -15,19 +15,17 @@ def DefGraphBadOutputOfLoop2() : # Creation of InLine Nodes PyIsOdd = [] - PyIsOdd.append( 'from time import * ' ) - PyIsOdd.append( 'def IsOdd(a,Even,InputInLoop) : ' ) - PyIsOdd.append( ' print a,"IsOdd (GraphLoopSwitch1)" ' ) - PyIsOdd.append( ' sleep( 1 ) ' ) - PyIsOdd.append( ' return a ' ) + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd(a) : ' ) + PyIsOdd.append( ' print a,"IsOdd (GraphLoopSwitch1)" ' ) + PyIsOdd.append( ' sleep( 1 ) ' ) + PyIsOdd.append( ' return a ' ) IsOdd = GraphBadOutputOfLoop2.INode( 'IsOdd' , PyIsOdd ) IsOdd.SetName( 'IsOdd' ) IsOdd.SetAuthor( '' ) IsOdd.SetComment( 'Python function' ) IsOdd.Coords( 397 , 1 ) IIsOdda = IsOdd.InPort( 'a' , 'long' ) - IIsOddEven = IsOdd.InPort( 'Even' , 'boolean' ) - IIsOddInputInLoop = IsOdd.InPort( 'InputInLoop' , 'boolean' ) IIsOddGate = IsOdd.GetInPort( 'Gate' ) OIsOdda = IsOdd.OutPort( 'a' , 'long' ) OIsOddGate = IsOdd.GetOutPort( 'Gate' ) @@ -65,7 +63,7 @@ def DefGraphBadOutputOfLoop2() : PyEndOfInitLoop.append( ' DoLoop = 0 ' ) PyEndOfInitLoop.append( ' return DoLoop,Index,Min,Max ' ) EndOfInitLoop.SetPyFunction( 'EndOfInitLoop' , PyEndOfInitLoop ) - IInitLoopInitLoop = InitLoop.GetInPort( 'InitLoop' ) + IInitLoopDoLoop = InitLoop.GetInPort( 'DoLoop' ) IInitLoopIndex = InitLoop.InPort( 'Index' , 'long' ) IInitLoopMin = InitLoop.InPort( 'Min' , 'long' ) IInitLoopMax = InitLoop.InPort( 'Max' , 'long' ) @@ -83,6 +81,7 @@ def DefGraphBadOutputOfLoop2() : OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) + OEndOfInitLoopGate = EndOfInitLoop.GetOutPort( 'Gate' ) InitLoop.SetName( 'InitLoop' ) InitLoop.SetAuthor( '' ) InitLoop.SetComment( 'Compute Node' ) @@ -123,8 +122,6 @@ def DefGraphBadOutputOfLoop2() : # Creation of Links LIsOddaEndSwitcha = GraphBadOutputOfLoop2.Link( OIsOdda , IEndSwitcha ) - LIsOddaEndSwitcha.AddCoord( 1 , 576 , 136 ) - LIsOddaEndSwitcha.AddCoord( 2 , 575 , 81 ) LInitLoopIndexSwitcha = GraphBadOutputOfLoop2.Link( OInitLoopIndex , ISwitcha ) @@ -134,27 +131,18 @@ def DefGraphBadOutputOfLoop2() : LSwitchEvenEndSwitchDefault = GraphBadOutputOfLoop2.Link( OSwitchEven , IEndSwitchDefault ) - LSwitchEvenIsOddEven = GraphBadOutputOfLoop2.Link( OSwitchEven , IIsOddEven ) - LSwitchEvenIsOddEven.AddCoord( 1 , 375 , 111 ) - LSwitchEvenIsOddEven.AddCoord( 2 , 375 , 172 ) + LSwitchaBadOutputOfLoopOutputOfLoop = GraphBadOutputOfLoop2.Link( OSwitcha , IBadOutputOfLoopOutputOfLoop ) LSwitchaIsOdda = GraphBadOutputOfLoop2.Link( OSwitcha , IIsOdda ) - LSwitchaIsOdda.AddCoord( 1 , 362 , 82 ) - LSwitchaIsOdda.AddCoord( 2 , 360 , 201 ) - - LSwitchaBadOutputOfLoopOutputOfLoop = GraphBadOutputOfLoop2.Link( OSwitcha , IBadOutputOfLoopOutputOfLoop ) LEndSwitchaEndOfInitLoopIndex = GraphBadOutputOfLoop2.Link( OEndSwitcha , IEndOfInitLoopIndex ) # Input datas - IIsOddInputInLoop.Input( 136306160 ) IInitLoopIndex.Input( 0 ) IInitLoopMin.Input( 0 ) IInitLoopMax.Input( 100 ) - IEndOfInitLoopMax.Input( 136221856 ) # Output Ports of the graph - #OInitLoopMax = InitLoop.GetOutPort( 'Max' ) #OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) #OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) #OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) diff --git a/examples/GraphBadOutputOfLoop2.xml b/examples/GraphBadOutputOfLoop2.xml index 83617b0..b9c3e24 100755 --- a/examples/GraphBadOutputOfLoop2.xml +++ b/examples/GraphBadOutputOfLoop2.xml @@ -12,9 +12,6 @@ GraphBadOutputOfLoop2 -boolean - IsOdd__InputInLoop - long InitLoop__Index @@ -22,15 +19,9 @@ InitLoop__Min long - InitLoop__Max - -long - EndOfInitLoop__Max + InitLoop__Max -long - InitLoop__Max - long EndOfInitLoop__Index @@ -42,7 +33,7 @@ 22/10/2003 - 10:36:39 - 14/12/2004 - 15:59:49 + 6/6/2005 - 11:27:14 1.05 ? ? @@ -61,13 +52,7 @@ long - a - -boolean - Even - -boolean - InputInLoop + a long @@ -76,13 +61,13 @@ IsOdd - - - - - - 14/12/2004 - 15:59:49 - 14/12/2004 - 15:59:49 + + + + + + 6/6/2005 - 11:26:44 + 6/6/2005 - 11:26:44 1.05 ? ? @@ -128,8 +113,8 @@ ? - 14/12/2004 - 15:59:49 - 14/12/2004 - 15:59:49 + 6/6/2005 - 11:26:44 + 6/6/2005 - 11:26:44 1.05 ? ? @@ -175,8 +160,8 @@ - 14/12/2004 - 15:59:49 - 14/12/2004 - 15:59:49 + 6/6/2005 - 11:26:44 + 6/6/2005 - 11:26:44 1.05 ? ? @@ -214,8 +199,8 @@ - 14/12/2004 - 15:59:49 - 14/12/2004 - 15:59:49 + 6/6/2005 - 11:26:44 + 6/6/2005 - 11:26:44 1.05 ? ? @@ -246,8 +231,8 @@ - 14/12/2004 - 15:59:49 - 14/12/2004 - 15:59:49 + 6/6/2005 - 11:26:44 + 6/6/2005 - 11:26:44 1.05 ? ? @@ -274,8 +259,8 @@ - 14/12/2004 - 15:59:49 - 14/12/2004 - 15:59:49 + 6/6/2005 - 11:26:44 + 6/6/2005 - 11:26:44 2.0 ? ? @@ -288,13 +273,7 @@ a EndSwitch a - - -576 - 136 - -575 - 81 + InitLoop DoLoop @@ -317,7 +296,7 @@ EndOfInitLoop DoLoop InitLoop - InitLoop + DoLoop Switch @@ -333,33 +312,15 @@ Switch - Even - IsOdd - Even - - -375 - 111 - -375 - 172 + a + BadOutputOfLoop + OutputOfLoop + Switch a IsOdd a - - -362 - 82 - -360 - 201 - -Switch - a - BadOutputOfLoop - OutputOfLoop EndSwitch @@ -369,15 +330,6 @@ -GraphBadOutputOfLoop2 - IsOdd__InputInLoop - IsOdd - InputInLoop - -3 - 136306160 - - GraphBadOutputOfLoop2 InitLoop__Index InitLoop @@ -403,13 +355,4 @@ 3 100 - - -GraphBadOutputOfLoop2 - EndOfInitLoop__Max - EndOfInitLoop - Max - -3 - 136221856 diff --git a/examples/GraphBugEditor.py b/examples/GraphBugEditor.py new file mode 100644 index 0000000..14c339e --- /dev/null +++ b/examples/GraphBugEditor.py @@ -0,0 +1,97 @@ + +# Generated python file of Graph GraphBugEditor + +from SuperV import * + +# Graph creation of GraphBugEditor +def DefGraphBugEditor() : + GraphBugEditor = Graph( 'GraphBugEditor' ) + GraphBugEditor.SetName( 'GraphBugEditor' ) + GraphBugEditor.SetAuthor( 'Nicolas Crouzet & JR' ) + GraphBugEditor.SetComment( '' ) + GraphBugEditor.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + Pycompute_power_1 = [] + Pycompute_power_1.append( 'def compute_power(nitermax,eosflux,espeigenval) : ' ) + Pycompute_power_1.append( ' return 1 ' ) + compute_power_1 = GraphBugEditor.INode( 'compute_power' , Pycompute_power_1 ) + compute_power_1.SetName( 'compute_power_1' ) + compute_power_1.SetAuthor( '' ) + compute_power_1.SetComment( 'Compute Node' ) + compute_power_1.Coords( 226 , 103 ) + Icompute_power_1nitermax = compute_power_1.InPort( 'nitermax' , 'long' ) + Icompute_power_1epsflux = compute_power_1.InPort( 'epsflux' , 'long' ) + Icompute_power_1espeigenval = compute_power_1.InPort( 'espeigenval' , 'long' ) + Icompute_power_1Gate = compute_power_1.GetInPort( 'Gate' ) + Ocompute_power_1return = compute_power_1.OutPort( 'return' , 'long' ) + Ocompute_power_1Gate = compute_power_1.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyLoop = [] + PyLoop.append( 'def Loop(it,itMax): ' ) + PyLoop.append( ' return it,itMax ' ) + PyMoreLoop = [] + PyMoreLoop.append( 'def More(it,itMax): ' ) + PyMoreLoop.append( ' if it<=itMax : ' ) + PyMoreLoop.append( ' DoLoop=1 ' ) + PyMoreLoop.append( ' else: ' ) + PyMoreLoop.append( ' DoLoop=0 ' ) + PyMoreLoop.append( ' return DoLoop,it,itMax ' ) + PyNextLoop = [] + PyNextLoop.append( 'def Next(it,itMax): ' ) + PyNextLoop.append( ' it+=1 ' ) + PyNextLoop.append( ' return it,itMax ' ) + Loop,EndLoop = GraphBugEditor.LNode( 'Loop' , PyLoop , 'More' , PyMoreLoop , 'Next' , PyNextLoop ) + EndLoop.SetName( 'EndLoop' ) + EndLoop.SetAuthor( '' ) + EndLoop.SetComment( 'Compute Node' ) + EndLoop.Coords( 426 , 161 ) + PyEndLoop = [] + EndLoop.SetPyFunction( 'EndLoop' , PyEndLoop ) + ILoopDoLoop = Loop.GetInPort( 'DoLoop' ) + ILoopit = Loop.InPort( 'it' , 'int' ) + ILoopitMax = Loop.InPort( 'itMax' , 'int' ) + ILoopGate = Loop.GetInPort( 'Gate' ) + OLoopDoLoop = Loop.GetOutPort( 'DoLoop' ) + OLoopit = Loop.GetOutPort( 'it' ) + OLoopitMax = Loop.GetOutPort( 'itMax' ) + IEndLoopDoLoop = EndLoop.GetInPort( 'DoLoop' ) + IEndLoopit = EndLoop.GetInPort( 'it' ) + IEndLoopitMax = EndLoop.GetInPort( 'itMax' ) + IEndLoopGate = EndLoop.GetInPort( 'Gate' ) + OEndLoopDoLoop = EndLoop.GetOutPort( 'DoLoop' ) + OEndLoopit = EndLoop.GetOutPort( 'it' ) + OEndLoopitMax = EndLoop.GetOutPort( 'itMax' ) + OEndLoopGate = EndLoop.GetOutPort( 'Gate' ) + Loop.SetName( 'Loop' ) + Loop.SetAuthor( '' ) + Loop.SetComment( 'Compute Node' ) + Loop.Coords( 21 , 161 ) + + # Creation of Links + LLoopitEndLoopit = GraphBugEditor.Link( OLoopit , IEndLoopit ) + + LLoopitMaxEndLoopitMax = GraphBugEditor.Link( OLoopitMax , IEndLoopitMax ) + + LLoopGatecompute_power_1Gate = GraphBugEditor.Link( OLoopGate , Icompute_power_1Gate ) + + # Input datas + ILoopit.Input( 1 ) + ILoopitMax.Input( 5 ) + + # Input Ports of the graph + #Icompute_power_1nitermax = compute_power_1.GetInPort( 'nitermax' ) + #Icompute_power_1epsflux = compute_power_1.GetInPort( 'epsflux' ) + #Icompute_power_1espeigenval = compute_power_1.GetInPort( 'espeigenval' ) + + # Output Ports of the graph + #OEndLoopit = EndLoop.GetOutPort( 'it' ) + #OEndLoopitMax = EndLoop.GetOutPort( 'itMax' ) + #Ocompute_power_1return = compute_power_1.GetOutPort( 'return' ) + return GraphBugEditor + + +GraphBugEditor = DefGraphBugEditor() diff --git a/examples/GraphBugEditor.xml b/examples/GraphBugEditor.xml new file mode 100644 index 0000000..a2c82ca --- /dev/null +++ b/examples/GraphBugEditor.xml @@ -0,0 +1,207 @@ + + + + + +? + ? + GraphBugEditor + 1 + ? + +GraphBugEditor + + +int + Loop__it + +int + Loop__itMax + +long + compute_power_1__nitermax + +long + compute_power_1__epsflux + +long + compute_power_1__espeigenval + + +int + EndLoop__it + +int + EndLoop__itMax + +long + compute_power_1__return + + + 10/6/2005 - 11:33:49 + 7/7/2005 - 11:39:27 + 2.0 + Nicolas Crouzet & JR + ? + ? + 0 + 0 + + +? + ? + Loop + 4 + EndLoop + +Loop + + +int + it + +int + itMax + + +int + it + +int + itMax + + + +Loop + + + +More + + + + + + + +Next + + + + 7/7/2005 - 11:37:23 + 7/7/2005 - 11:37:23 + 2.0 + ? + ? + Compute Node + 21 + 161 + +? + ? + EndLoop + 5 + Loop + +EndLoop + + +int + it + +int + itMax + + +int + it + +int + itMax + + + +EndLoop + + 7/7/2005 - 11:37:23 + 7/7/2005 - 11:37:23 + 2.0 + ? + ? + Compute Node + 426 + 161 + +? + ? + compute_power_1 + 3 + ? + +compute_power_1 + + + + + +compute_power + + + 7/7/2005 - 11:38:24 + 7/7/2005 - 11:38:24 + 2.0 + ? + ? + Compute Node + 226 + 103 + + +Loop + DoLoop + EndLoop + DoLoop + + +Loop + it + EndLoop + it + + +Loop + itMax + EndLoop + itMax + + +Loop + Gate + compute_power_1 + Gate + + +EndLoop + DoLoop + Loop + DoLoop + + + +GraphBugEditor + Loop__it + Loop + it + +3 + 1 + + +GraphBugEditor + Loop__itMax + Loop + itMax + +3 + 5 + diff --git a/examples/GraphConvertObjRefCheckNotCompatible.py b/examples/GraphConvertObjRefCheckNotCompatible.py new file mode 100644 index 0000000..e81c268 --- /dev/null +++ b/examples/GraphConvertObjRefCheckNotCompatible.py @@ -0,0 +1,112 @@ + +# Generated python file of Graph GraphConvertObjRefCheckNotCompatible + +from SuperV import * + +# Graph creation of GraphConvertObjRefCheckNotCompatible +def DefGraphConvertObjRefCheckNotCompatible() : + GraphConvertObjRefCheckNotCompatible = Graph( 'GraphConvertObjRefCheckNotCompatible' ) + GraphConvertObjRefCheckNotCompatible.SetName( 'GraphConvertObjRefCheckNotCompatible' ) + GraphConvertObjRefCheckNotCompatible.SetAuthor( 'JR' ) + GraphConvertObjRefCheckNotCompatible.SetComment( 'Check conversions of ObjRef' ) + GraphConvertObjRefCheckNotCompatible.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + MiscTypes = GraphConvertObjRefCheckNotCompatible.FNode( 'TypesCheck' , 'TypesCheck' , 'MiscTypes' ) + MiscTypes.SetName( 'MiscTypes' ) + MiscTypes.SetAuthor( '' ) + MiscTypes.SetContainer( 'localhost/FactoryServer' ) + MiscTypes.SetComment( 'MiscTypes from TypesCheck' ) + MiscTypes.Coords( 284 , 28 ) + IMiscTypesInString = MiscTypes.GetInPort( 'InString' ) + IMiscTypesInBool = MiscTypes.GetInPort( 'InBool' ) + IMiscTypesInChar = MiscTypes.GetInPort( 'InChar' ) + IMiscTypesInShort = MiscTypes.GetInPort( 'InShort' ) + IMiscTypesInLong = MiscTypes.GetInPort( 'InLong' ) + IMiscTypesInFloat = MiscTypes.GetInPort( 'InFloat' ) + IMiscTypesInDouble = MiscTypes.GetInPort( 'InDouble' ) + IMiscTypesInObjRef = MiscTypes.GetInPort( 'InObjRef' ) + IMiscTypesGate = MiscTypes.GetInPort( 'Gate' ) + OMiscTypesOutString = MiscTypes.GetOutPort( 'OutString' ) + OMiscTypesOutBool = MiscTypes.GetOutPort( 'OutBool' ) + OMiscTypesOutChar = MiscTypes.GetOutPort( 'OutChar' ) + OMiscTypesOutShort = MiscTypes.GetOutPort( 'OutShort' ) + OMiscTypesOutLong = MiscTypes.GetOutPort( 'OutLong' ) + OMiscTypesOutFloat = MiscTypes.GetOutPort( 'OutFloat' ) + OMiscTypesOutDouble = MiscTypes.GetOutPort( 'OutDouble' ) + OMiscTypesOutObjRef = MiscTypes.GetOutPort( 'OutObjRef' ) + OMiscTypesGate = MiscTypes.GetOutPort( 'Gate' ) + + # Creation of InLine Nodes + PySyrComponent = [] + PySyrComponent.append( 'from LifeCycleCORBA import * ' ) + PySyrComponent.append( 'def SyrComponent( aContainer , aComponent ) : ' ) + PySyrComponent.append( ' print "SyrComponent(",aContainer,",",aComponent,")" ' ) + PySyrComponent.append( ' orb = CORBA.ORB_init([], CORBA.ORB_ID) ' ) + PySyrComponent.append( ' print "SyrComponent orb",orb ' ) + PySyrComponent.append( ' lcc = LifeCycleCORBA(orb) ' ) + PySyrComponent.append( ' print "SyrComponent lcc",lcc ' ) + PySyrComponent.append( ' print "SyrComponent(",aContainer,",",aComponent,")" ' ) + PySyrComponent.append( ' ComponentRef = lcc.FindOrLoadComponent( aContainer , aComponent ) ' ) + PySyrComponent.append( ' print "SyrComponent(",aContainer,",",aComponent,") --> ",ComponentRef ' ) + PySyrComponent.append( ' return ComponentRef ' ) + PySyrComponent.append( '' ) + SyrComponent = GraphConvertObjRefCheckNotCompatible.INode( 'SyrComponent' , PySyrComponent ) + SyrComponent.SetName( 'SyrComponent' ) + SyrComponent.SetAuthor( 'JR' ) + SyrComponent.SetComment( 'InLine Node' ) + SyrComponent.Coords( 14 , 114 ) + ISyrComponentaContainer = SyrComponent.InPort( 'aContainer' , 'string' ) + ISyrComponentaComponent = SyrComponent.InPort( 'aComponent' , 'string' ) + ISyrComponentGate = SyrComponent.GetInPort( 'Gate' ) + OSyrComponentanObjRef = SyrComponent.OutPort( 'anObjRef' , 'objref' ) + OSyrComponentGate = SyrComponent.GetOutPort( 'Gate' ) + + PyObjRefToInline = [] + PyObjRefToInline.append( 'def ObjRefToInline(objRef): ' ) + PyObjRefToInline.append( ' return objRef ' ) + ObjRefToInline = GraphConvertObjRefCheckNotCompatible.INode( 'ObjRefToInline' , PyObjRefToInline ) + ObjRefToInline.SetName( 'ObjRefToInline' ) + ObjRefToInline.SetAuthor( '' ) + ObjRefToInline.SetComment( 'Compute Node' ) + ObjRefToInline.Coords( 496 , 168 ) + IObjRefToInlinetoInLine = ObjRefToInline.InPort( 'toInLine' , 'int' ) + IObjRefToInlineGate = ObjRefToInline.GetInPort( 'Gate' ) + OObjRefToInlineGate = ObjRefToInline.GetOutPort( 'Gate' ) + + # Creation of Links + LSyrComponentanObjRefMiscTypesInObjRef = GraphConvertObjRefCheckNotCompatible.Link( OSyrComponentanObjRef , IMiscTypesInObjRef ) + + LSyrComponentanObjRefMiscTypesInString = GraphConvertObjRefCheckNotCompatible.Link( OSyrComponentanObjRef , IMiscTypesInString ) + + LSyrComponentanObjRefMiscTypesInBool = GraphConvertObjRefCheckNotCompatible.Link( OSyrComponentanObjRef , IMiscTypesInBool ) + + LSyrComponentanObjRefMiscTypesInChar = GraphConvertObjRefCheckNotCompatible.Link( OSyrComponentanObjRef , IMiscTypesInChar ) + + LSyrComponentanObjRefMiscTypesInShort = GraphConvertObjRefCheckNotCompatible.Link( OSyrComponentanObjRef , IMiscTypesInShort ) + + LSyrComponentanObjRefMiscTypesInLong = GraphConvertObjRefCheckNotCompatible.Link( OSyrComponentanObjRef , IMiscTypesInLong ) + + LSyrComponentanObjRefMiscTypesInFloat = GraphConvertObjRefCheckNotCompatible.Link( OSyrComponentanObjRef , IMiscTypesInFloat ) + + LSyrComponentanObjRefMiscTypesInDouble = GraphConvertObjRefCheckNotCompatible.Link( OSyrComponentanObjRef , IMiscTypesInDouble ) + + LMiscTypesOutObjRefObjRefToInlinetoInLine = GraphConvertObjRefCheckNotCompatible.Link( OMiscTypesOutObjRef , IObjRefToInlinetoInLine ) + + # Input datas + ISyrComponentaContainer.Input( 'FactoryServerPy' ) + ISyrComponentaComponent.Input( 'SyrControlComponent' ) + + # Output Ports of the graph + #OMiscTypesOutString = MiscTypes.GetOutPort( 'OutString' ) + #OMiscTypesOutBool = MiscTypes.GetOutPort( 'OutBool' ) + #OMiscTypesOutChar = MiscTypes.GetOutPort( 'OutChar' ) + #OMiscTypesOutShort = MiscTypes.GetOutPort( 'OutShort' ) + #OMiscTypesOutLong = MiscTypes.GetOutPort( 'OutLong' ) + #OMiscTypesOutFloat = MiscTypes.GetOutPort( 'OutFloat' ) + #OMiscTypesOutDouble = MiscTypes.GetOutPort( 'OutDouble' ) + return GraphConvertObjRefCheckNotCompatible + + +GraphConvertObjRefCheckNotCompatible = DefGraphConvertObjRefCheckNotCompatible() diff --git a/examples/GraphConvertObjRefCheckNotCompatible.xml b/examples/GraphConvertObjRefCheckNotCompatible.xml new file mode 100644 index 0000000..4299d4e --- /dev/null +++ b/examples/GraphConvertObjRefCheckNotCompatible.xml @@ -0,0 +1,264 @@ + + + + + +? + ? + GraphConvertObjRefCheckNotCompatible + 1 + ? + +GraphConvertObjRefCheckNotCompatible + + +string + SyrComponent__aContainer + +string + SyrComponent__aComponent + + +string + MiscTypes__OutString + +boolean + MiscTypes__OutBool + +char + MiscTypes__OutChar + +short + MiscTypes__OutShort + +long + MiscTypes__OutLong + +float + MiscTypes__OutFloat + +double + MiscTypes__OutDouble + + + 30/7/2003 - 14:23:52 + 20/6/2005 - 11:34:50 + 1.04 + JR + ? + Check conversions of ObjRef + 0 + 0 + + +? + ? + SyrComponent + 3 + ? + +SyrComponent + + +string + aContainer + +string + aComponent + + +objref + anObjRef + + + +SyrComponent + + + + + + + + + + ",ComponentRef ]]> + + + 20/6/2005 - 11:31:43 + 20/6/2005 - 11:31:43 + 1.04 + JR + ? + InLine Node + 14 + 114 + +TypesCheck + TypesCheck + MiscTypes + 0 + ? + +MiscTypes + + +string + InString + +boolean + InBool + +char + InChar + +short + InShort + +long + InLong + +float + InFloat + +double + InDouble + +SuperVisionTest::Adder + InObjRef + + +string + OutString + +boolean + OutBool + +char + OutChar + +short + OutShort + +long + OutLong + +float + OutFloat + +double + OutDouble + +SuperVisionTest::Adder + OutObjRef + + + 20/6/2005 - 11:31:43 + 20/6/2005 - 11:31:43 + 1.05 + ? + localhost/FactoryServer + MiscTypes from TypesCheck + 284 + 28 + +? + ? + ObjRefToInline + 3 + ? + +ObjRefToInline + + +int + toInLine + + + + +ObjRefToInline + + + 20/6/2005 - 11:31:43 + 20/6/2005 - 11:31:43 + 2.0 + ? + ? + Compute Node + 496 + 168 + + +SyrComponent + anObjRef + MiscTypes + InObjRef + + +SyrComponent + anObjRef + MiscTypes + InString + + +SyrComponent + anObjRef + MiscTypes + InBool + + +SyrComponent + anObjRef + MiscTypes + InChar + + +SyrComponent + anObjRef + MiscTypes + InShort + + +SyrComponent + anObjRef + MiscTypes + InLong + + +SyrComponent + anObjRef + MiscTypes + InFloat + + +SyrComponent + anObjRef + MiscTypes + InDouble + + +MiscTypes + OutObjRef + ObjRefToInline + toInLine + + + +GraphConvertObjRefCheckNotCompatible + SyrComponent__aContainer + SyrComponent + aContainer + +18 + + + +GraphConvertObjRefCheckNotCompatible + SyrComponent__aComponent + SyrComponent + aComponent + +18 + + diff --git a/examples/GraphEditGraphSwitchs.py b/examples/GraphEditGraphSwitchs.py new file mode 100644 index 0000000..9dff962 --- /dev/null +++ b/examples/GraphEditGraphSwitchs.py @@ -0,0 +1,61 @@ + +from GraphSwitchs import * + +GraphSwitchs.SetName('GraphEditSwitchs') +GraphEditSwitchs = GraphSwitchs + +exec GraphEditSwitchs.ListNodes() +InitLoopSwitch.destroy() + +GraphEditSwitchs.Export('/sal_01/salome/SalomePALHead_15_11_2004/SUPERV_SRC/examples/GraphEditGraphSwitchs_1.py') + +exec InitLoop.ListPorts() +exec Switch.ListPorts() + +GraphEditSwitchs.Link( OInitLoopIndex , ISwitcha ) + +exec EndOfInitLoop.ListPorts() +IEndOfInitLoopIndex.Link().destroy() + +GraphEditSwitchs.Export('/sal_01/salome/SalomePALHead_15_11_2004/SUPERV_SRC/examples/GraphEditGraphSwitchs_2.py') + +exec EndOfSwitch.ListPorts() +GraphEditSwitchs.Link(OEndOfSwitcha,IEndOfInitLoopIndex) + +exec EndSwitch.ListPorts() +GraphEditSwitchs.Link(OEndSwitchGate,IEndOfInitLoopGate) + +GraphEditSwitchs.Export('/sal_01/salome/SalomePALHead_15_11_2004/SUPERV_SRC/examples/GraphEditGraphSwitchs_3.py') + +IsOdd_1.SetName('IsEven') +IsEven = IsOdd_1 + +exec IsEven.ListPorts() +IIsEvena.Link().destroy() + +IIsEvenGate.Link().destroy() + +exec Switch_1.ListPorts() +GraphEditSwitchs.Link(OSwitch_1Even,IIsEvenGate) + +GraphEditSwitchs.Export('/sal_01/salome/SalomePALHead_15_11_2004/SUPERV_SRC/examples/GraphEditGraphSwitchs_4.py') + +GraphEditSwitchs.PrintLinks() + +L = GraphEditSwitchs.Link(OSwitch_1Even,IEndSwitchDefault) +L.destroy() + +GraphEditSwitchs.Export('/sal_01/salome/SalomePALHead_15_11_2004/SUPERV_SRC/examples/GraphEditGraphSwitchs_5.py') + +GraphEditSwitchs.Link(OSwitch_1Default,IEndSwitchDefault) + +GraphEditSwitchs.Link(OSwitch_1a,IIsEvena) + +GraphEditSwitchs.Export('/sal_01/salome/SalomePALHead_15_11_2004/SUPERV_SRC/examples/GraphEditGraphSwitchs_5.py') + +Switch_1.SetName('') + +from SuperV import * + +GraphEditSwitchs = Graph('/sal_01/salome/SalomePALHead_15_11_2004/SUPERV_SRC/examples/GraphEditGraphSwitchs_3.xml') + diff --git a/examples/GraphEditGraphSwitchs_1.py b/examples/GraphEditGraphSwitchs_1.py new file mode 100644 index 0000000..d848151 --- /dev/null +++ b/examples/GraphEditGraphSwitchs_1.py @@ -0,0 +1,204 @@ + +# Generated python file of Graph GraphEditSwitchs + +from SuperV import * + +# Graph creation of GraphEditSwitchs +def DefGraphEditSwitchs() : + GraphEditSwitchs = Graph( 'GraphEditSwitchs' ) + GraphEditSwitchs.SetName( 'GraphEditSwitchs' ) + GraphEditSwitchs.SetAuthor( '' ) + GraphEditSwitchs.SetComment( '' ) + GraphEditSwitchs.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsOdd = [] + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd(a) : ' ) + PyIsOdd.append( ' print a,"IsOdd (GraphSwitchs)" ' ) + PyIsOdd.append( ' sleep( 1 ) ' ) + PyIsOdd.append( ' return a ' ) + IsOdd = GraphEditSwitchs.INode( 'IsOdd' , PyIsOdd ) + IsOdd.SetName( 'IsOdd' ) + IsOdd.SetAuthor( '' ) + IsOdd.SetComment( 'Python function' ) + IsOdd.Coords( 388 , 50 ) + IIsOdda = IsOdd.InPort( 'a' , 'long' ) + IIsOddGate = IsOdd.GetInPort( 'Gate' ) + OIsOdda = IsOdd.OutPort( 'a' , 'long' ) + OIsOddGate = IsOdd.GetOutPort( 'Gate' ) + + PyIsOdd_1 = [] + PyIsOdd_1.append( 'from time import * ' ) + PyIsOdd_1.append( 'def IsOdd(a) : ' ) + PyIsOdd_1.append( ' print a,"IsOdd_1 (GraphSwitchs)" ' ) + PyIsOdd_1.append( ' sleep( 1 ) ' ) + PyIsOdd_1.append( ' return a ' ) + IsOdd_1 = GraphEditSwitchs.INode( 'IsOdd' , PyIsOdd_1 ) + IsOdd_1.SetName( 'IsOdd_1' ) + IsOdd_1.SetAuthor( '' ) + IsOdd_1.SetComment( 'Python function' ) + IsOdd_1.Coords( 419 , 308 ) + IIsOdd_1a = IsOdd_1.InPort( 'a' , 'long' ) + IIsOdd_1Gate = IsOdd_1.GetInPort( 'Gate' ) + OIsOdd_1a = IsOdd_1.OutPort( 'a' , 'long' ) + OIsOdd_1Gate = IsOdd_1.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyInitLoop = [] + PyInitLoop.append( 'def InitLoop(Index,Min,Max) : ' ) + PyInitLoop.append( ' return Index,Min,Max ' ) + PyMoreInitLoop = [] + PyMoreInitLoop.append( 'def MoreLoop(Index,Min,Max) : ' ) + PyMoreInitLoop.append( ' if Index <= Max : ' ) + PyMoreInitLoop.append( ' DoLoop = 1 ' ) + PyMoreInitLoop.append( ' else : ' ) + PyMoreInitLoop.append( ' DoLoop = 0 ' ) + PyMoreInitLoop.append( ' return DoLoop,Index,Min,Max ' ) + PyNextInitLoop = [] + PyNextInitLoop.append( 'def NextLoop(Index,Min,Max) : ' ) + PyNextInitLoop.append( ' Index = Index + 1 ' ) + PyNextInitLoop.append( ' return Index,Min,Max ' ) + InitLoop,EndOfInitLoop = GraphEditSwitchs.LNode( 'InitLoop' , PyInitLoop , 'MoreLoop' , PyMoreInitLoop , 'NextLoop' , PyNextInitLoop ) + EndOfInitLoop.SetName( 'EndOfInitLoop' ) + EndOfInitLoop.SetAuthor( '' ) + EndOfInitLoop.SetComment( 'Compute Node' ) + EndOfInitLoop.Coords( 783 , 381 ) + PyEndOfInitLoop = [] + EndOfInitLoop.SetPyFunction( '' , PyEndOfInitLoop ) + IInitLoopDoLoop = InitLoop.GetInPort( 'DoLoop' ) + IInitLoopIndex = InitLoop.InPort( 'Index' , 'long' ) + IInitLoopMin = InitLoop.InPort( 'Min' , 'long' ) + IInitLoopMax = InitLoop.InPort( 'Max' , 'long' ) + IInitLoopGate = InitLoop.GetInPort( 'Gate' ) + OInitLoopDoLoop = InitLoop.GetOutPort( 'DoLoop' ) + OInitLoopIndex = InitLoop.GetOutPort( 'Index' ) + OInitLoopMin = InitLoop.GetOutPort( 'Min' ) + OInitLoopMax = InitLoop.GetOutPort( 'Max' ) + IEndOfInitLoopDoLoop = EndOfInitLoop.GetInPort( 'DoLoop' ) + IEndOfInitLoopIndex = EndOfInitLoop.GetInPort( 'Index' ) + IEndOfInitLoopMin = EndOfInitLoop.GetInPort( 'Min' ) + IEndOfInitLoopMax = EndOfInitLoop.GetInPort( 'Max' ) + IEndOfInitLoopGate = EndOfInitLoop.GetInPort( 'Gate' ) + OEndOfInitLoopDoLoop = EndOfInitLoop.GetOutPort( 'DoLoop' ) + OEndOfInitLoopGate = EndOfInitLoop.GetOutPort( 'Gate' ) + OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) + OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) + OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) + InitLoop.SetName( 'InitLoop' ) + InitLoop.SetAuthor( '' ) + InitLoop.SetComment( 'Compute Node' ) + InitLoop.Coords( 10 , 388 ) + + # Creation of Switch Nodes + PySwitch = [] + PySwitch.append( 'from time import * ' ) + PySwitch.append( 'def Switch(a) : ' ) + PySwitch.append( ' if ( a & 1 ) == 0 : ' ) + PySwitch.append( ' sleep(1) ' ) + PySwitch.append( ' return a & 1,1-(a&1),a ' ) + Switch,EndOfSwitch = GraphEditSwitchs.SNode( 'Switch' , PySwitch ) + EndOfSwitch.SetName( 'EndOfSwitch' ) + EndOfSwitch.SetAuthor( '' ) + EndOfSwitch.SetComment( 'Compute Node' ) + EndOfSwitch.Coords( 587 , 126 ) + PyEndOfSwitch = [] + EndOfSwitch.SetPyFunction( '' , PyEndOfSwitch ) + IEndOfSwitcha = EndOfSwitch.InPort( 'a' , 'long' ) + IEndOfSwitchDefault = EndOfSwitch.GetInPort( 'Default' ) + OEndOfSwitcha = EndOfSwitch.OutPort( 'a' , 'long' ) + OEndOfSwitchGate = EndOfSwitch.GetOutPort( 'Gate' ) + Switch.SetName( 'Switch' ) + Switch.SetAuthor( '' ) + Switch.SetComment( 'Compute Node' ) + Switch.Coords( 186 , 130 ) + ISwitcha = Switch.InPort( 'a' , 'long' ) + ISwitchGate = Switch.GetInPort( 'Gate' ) + OSwitchOdd = Switch.OutPort( 'Odd' , 'long' ) + OSwitchEven = Switch.OutPort( 'Even' , 'int' ) + OSwitcha = Switch.OutPort( 'a' , 'int' ) + OSwitchDefault = Switch.GetOutPort( 'Default' ) + + PySwitch_1 = [] + PySwitch_1.append( 'from time import * ' ) + PySwitch_1.append( 'def Switch(a) : ' ) + PySwitch_1.append( ' if ( a & 1 ) == 0 : ' ) + PySwitch_1.append( ' sleep(1) ' ) + PySwitch_1.append( ' return a & 1,1-(a&1),a ' ) + Switch_1,EndSwitch = GraphEditSwitchs.SNode( 'Switch' , PySwitch_1 ) + EndSwitch.SetName( 'EndSwitch' ) + EndSwitch.SetAuthor( '' ) + EndSwitch.SetComment( 'Compute Node' ) + EndSwitch.Coords( 605 , 382 ) + PyEndSwitch = [] + EndSwitch.SetPyFunction( '' , PyEndSwitch ) + IEndSwitcha = EndSwitch.InPort( 'a' , 'long' ) + IEndSwitchDefault = EndSwitch.GetInPort( 'Default' ) + OEndSwitcha = EndSwitch.OutPort( 'a' , 'long' ) + OEndSwitchGate = EndSwitch.GetOutPort( 'Gate' ) + Switch_1.SetName( 'Switch_1' ) + Switch_1.SetAuthor( '' ) + Switch_1.SetComment( 'Compute Node' ) + Switch_1.Coords( 193 , 388 ) + ISwitch_1a = Switch_1.InPort( 'a' , 'long' ) + ISwitch_1Gate = Switch_1.GetInPort( 'Gate' ) + OSwitch_1Odd = Switch_1.OutPort( 'Odd' , 'long' ) + OSwitch_1Even = Switch_1.OutPort( 'Even' , 'int' ) + OSwitch_1a = Switch_1.OutPort( 'a' , 'int' ) + OSwitch_1Default = Switch_1.GetOutPort( 'Default' ) + + # Creation of Links + LIsOddaEndOfSwitcha = GraphEditSwitchs.Link( OIsOdda , IEndOfSwitcha ) + LIsOddaEndOfSwitcha.AddCoord( 1 , 573 , 160 ) + LIsOddaEndOfSwitcha.AddCoord( 2 , 572 , 130 ) + + LIsOdd_1aEndSwitcha = GraphEditSwitchs.Link( OIsOdd_1a , IEndSwitcha ) + LIsOdd_1aEndSwitcha.AddCoord( 1 , 599 , 416 ) + LIsOdd_1aEndSwitcha.AddCoord( 2 , 598 , 389 ) + + LInitLoopIndexSwitch_1a = GraphEditSwitchs.Link( OInitLoopIndex , ISwitch_1a ) + + LInitLoopMinEndOfInitLoopMin = GraphEditSwitchs.Link( OInitLoopMin , IEndOfInitLoopMin ) + + LInitLoopMaxEndOfInitLoopMax = GraphEditSwitchs.Link( OInitLoopMax , IEndOfInitLoopMax ) + + LSwitchOddIsOddGate = GraphEditSwitchs.Link( OSwitchOdd , IIsOddGate ) + + LSwitchaIsOdda = GraphEditSwitchs.Link( OSwitcha , IIsOdda ) + LSwitchaIsOdda.AddCoord( 1 , 365 , 129 ) + LSwitchaIsOdda.AddCoord( 2 , 365 , 222 ) + + LSwitchDefaultEndOfSwitchDefault = GraphEditSwitchs.Link( OSwitchDefault , IEndOfSwitchDefault ) + LSwitchDefaultEndOfSwitchDefault.AddCoord( 1 , 572 , 194 ) + LSwitchDefaultEndOfSwitchDefault.AddCoord( 2 , 571 , 257 ) + + LSwitch_1OddIsOdd_1Gate = GraphEditSwitchs.Link( OSwitch_1Odd , IIsOdd_1Gate ) + + LSwitch_1EvenEndSwitchDefault = GraphEditSwitchs.Link( OSwitch_1Even , IEndSwitchDefault ) + + LSwitch_1aIsOdd_1a = GraphEditSwitchs.Link( OSwitch_1a , IIsOdd_1a ) + LSwitch_1aIsOdd_1a.AddCoord( 1 , 379 , 387 ) + LSwitch_1aIsOdd_1a.AddCoord( 2 , 378 , 481 ) + + LEndSwitchaEndOfInitLoopIndex = GraphEditSwitchs.Link( OEndSwitcha , IEndOfInitLoopIndex ) + + # Input datas + IInitLoopIndex.Input( 0 ) + IInitLoopMin.Input( 0 ) + IInitLoopMax.Input( 20 ) + + # Input Ports of the graph + #ISwitcha = Switch.GetInPort( 'a' ) + + # Output Ports of the graph + #OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) + #OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) + #OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) + #OSwitchEven = Switch.GetOutPort( 'Even' ) + #OEndOfSwitcha = EndOfSwitch.GetOutPort( 'a' ) + return GraphEditSwitchs + + +GraphEditSwitchs = DefGraphEditSwitchs() diff --git a/examples/GraphEditGraphSwitchs_1.xml b/examples/GraphEditGraphSwitchs_1.xml new file mode 100644 index 0000000..3cad031 --- /dev/null +++ b/examples/GraphEditGraphSwitchs_1.xml @@ -0,0 +1,493 @@ + + + + + +? + ? + GraphEditSwitchs + 1 + ? + +GraphEditSwitchs + + +long + InitLoop__Index + +long + InitLoop__Min + +long + InitLoop__Max + +long + Switch__a + + +long + EndOfInitLoop__Index + +long + EndOfInitLoop__Min + +long + EndOfInitLoop__Max + +int + Switch__Even + +long + EndOfSwitch__a + + + 3/2/2005 - 16:14:10 + 3/2/2005 - 16:14:11 + 2.0 + ? + ? + ? + 0 + 0 + + +? + ? + IsOdd + 3 + ? + +IsOdd + + +long + a + + +long + a + + + +IsOdd + + + + + + 3/2/2005 - 16:14:10 + 3/2/2005 - 16:14:10 + 2.0 + ? + ? + Python function + 388 + 50 + +? + ? + IsOdd_1 + 3 + ? + +IsOdd_1 + + +long + a + + +long + a + + + +IsOdd + + + + + + 3/2/2005 - 16:14:10 + 3/2/2005 - 16:14:10 + 2.0 + ? + ? + Python function + 419 + 308 + +? + ? + InitLoop + 4 + EndOfInitLoop + +InitLoop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +InitLoop + + + +MoreLoop + + + + + + + +NextLoop + + + + 3/2/2005 - 16:14:10 + 3/2/2005 - 16:14:10 + 2.0 + ? + ? + Compute Node + 10 + 388 + +? + ? + EndOfInitLoop + 5 + InitLoop + +EndInitLoop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +? + + 3/2/2005 - 16:14:10 + 3/2/2005 - 16:14:10 + 2.0 + ? + ? + Compute Node + 783 + 381 + +? + ? + Switch + 6 + EndOfSwitch + +Switch + + +long + a + + +long + Odd + +int + Even + +int + a + + + +Switch + + + + + + 3/2/2005 - 16:14:10 + 3/2/2005 - 16:14:10 + 2.0 + ? + ? + Compute Node + 186 + 130 + +? + ? + EndOfSwitch + 7 + Switch + +EndSwitch + + +long + a + + +long + a + + + +? + + 3/2/2005 - 16:14:10 + 3/2/2005 - 16:14:10 + 2.0 + ? + ? + Compute Node + 587 + 126 + +? + ? + Switch_1 + 6 + EndSwitch + +Switch_1 + + +long + a + + +long + Odd + +int + Even + +int + a + + + +Switch + + + + + + 3/2/2005 - 16:14:11 + 3/2/2005 - 16:14:11 + 2.0 + ? + ? + Compute Node + 193 + 388 + +? + ? + EndSwitch + 7 + Switch_1 + +EndSwitch + + +long + a + + +long + a + + + +? + + 3/2/2005 - 16:14:11 + 3/2/2005 - 16:14:11 + 2.0 + ? + ? + Compute Node + 605 + 382 + + +IsOdd + a + EndOfSwitch + a + + +573 + 160 + +572 + 130 + +IsOdd_1 + a + EndSwitch + a + + +599 + 416 + +598 + 389 + +InitLoop + DoLoop + EndOfInitLoop + DoLoop + + +InitLoop + Index + Switch_1 + a + + +InitLoop + Min + EndOfInitLoop + Min + + +InitLoop + Max + EndOfInitLoop + Max + + +EndOfInitLoop + DoLoop + InitLoop + DoLoop + + +Switch + Odd + IsOdd + Gate + + +Switch + a + IsOdd + a + + +365 + 129 + +365 + 222 + +Switch + Default + EndOfSwitch + Default + + +572 + 194 + +571 + 257 + +Switch_1 + Odd + IsOdd_1 + Gate + + +Switch_1 + Even + EndSwitch + Default + + +Switch_1 + a + IsOdd_1 + a + + +379 + 387 + +378 + 481 + +EndSwitch + a + EndOfInitLoop + Index + + + +GraphEditSwitchs + InitLoop__Index + InitLoop + Index + +3 + 0 + + +GraphEditSwitchs + InitLoop__Min + InitLoop + Min + +3 + 0 + + +GraphEditSwitchs + InitLoop__Max + InitLoop + Max + +3 + 20 + diff --git a/examples/GraphEditGraphSwitchs_2.py b/examples/GraphEditGraphSwitchs_2.py new file mode 100644 index 0000000..df8833b --- /dev/null +++ b/examples/GraphEditGraphSwitchs_2.py @@ -0,0 +1,205 @@ + +# Generated python file of Graph GraphEditSwitchs + +from SuperV import * + +# Graph creation of GraphEditSwitchs +def DefGraphEditSwitchs() : + GraphEditSwitchs = Graph( 'GraphEditSwitchs' ) + GraphEditSwitchs.SetName( 'GraphEditSwitchs' ) + GraphEditSwitchs.SetAuthor( '' ) + GraphEditSwitchs.SetComment( '' ) + GraphEditSwitchs.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsOdd = [] + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd(a) : ' ) + PyIsOdd.append( ' print a,"IsOdd (GraphSwitchs)" ' ) + PyIsOdd.append( ' sleep( 1 ) ' ) + PyIsOdd.append( ' return a ' ) + IsOdd = GraphEditSwitchs.INode( 'IsOdd' , PyIsOdd ) + IsOdd.SetName( 'IsOdd' ) + IsOdd.SetAuthor( '' ) + IsOdd.SetComment( 'Python function' ) + IsOdd.Coords( 388 , 50 ) + IIsOdda = IsOdd.InPort( 'a' , 'long' ) + IIsOddGate = IsOdd.GetInPort( 'Gate' ) + OIsOdda = IsOdd.OutPort( 'a' , 'long' ) + OIsOddGate = IsOdd.GetOutPort( 'Gate' ) + + PyIsOdd_1 = [] + PyIsOdd_1.append( 'from time import * ' ) + PyIsOdd_1.append( 'def IsOdd(a) : ' ) + PyIsOdd_1.append( ' print a,"IsOdd_1 (GraphSwitchs)" ' ) + PyIsOdd_1.append( ' sleep( 1 ) ' ) + PyIsOdd_1.append( ' return a ' ) + IsOdd_1 = GraphEditSwitchs.INode( 'IsOdd' , PyIsOdd_1 ) + IsOdd_1.SetName( 'IsOdd_1' ) + IsOdd_1.SetAuthor( '' ) + IsOdd_1.SetComment( 'Python function' ) + IsOdd_1.Coords( 419 , 308 ) + IIsOdd_1a = IsOdd_1.InPort( 'a' , 'long' ) + IIsOdd_1Gate = IsOdd_1.GetInPort( 'Gate' ) + OIsOdd_1a = IsOdd_1.OutPort( 'a' , 'long' ) + OIsOdd_1Gate = IsOdd_1.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyInitLoop = [] + PyInitLoop.append( 'def InitLoop(Index,Min,Max) : ' ) + PyInitLoop.append( ' return Index,Min,Max ' ) + PyMoreInitLoop = [] + PyMoreInitLoop.append( 'def MoreLoop(Index,Min,Max) : ' ) + PyMoreInitLoop.append( ' if Index <= Max : ' ) + PyMoreInitLoop.append( ' DoLoop = 1 ' ) + PyMoreInitLoop.append( ' else : ' ) + PyMoreInitLoop.append( ' DoLoop = 0 ' ) + PyMoreInitLoop.append( ' return DoLoop,Index,Min,Max ' ) + PyNextInitLoop = [] + PyNextInitLoop.append( 'def NextLoop(Index,Min,Max) : ' ) + PyNextInitLoop.append( ' Index = Index + 1 ' ) + PyNextInitLoop.append( ' return Index,Min,Max ' ) + InitLoop,EndOfInitLoop = GraphEditSwitchs.LNode( 'InitLoop' , PyInitLoop , 'MoreLoop' , PyMoreInitLoop , 'NextLoop' , PyNextInitLoop ) + EndOfInitLoop.SetName( 'EndOfInitLoop' ) + EndOfInitLoop.SetAuthor( '' ) + EndOfInitLoop.SetComment( 'Compute Node' ) + EndOfInitLoop.Coords( 783 , 381 ) + PyEndOfInitLoop = [] + EndOfInitLoop.SetPyFunction( '' , PyEndOfInitLoop ) + IInitLoopDoLoop = InitLoop.GetInPort( 'DoLoop' ) + IInitLoopIndex = InitLoop.InPort( 'Index' , 'long' ) + IInitLoopMin = InitLoop.InPort( 'Min' , 'long' ) + IInitLoopMax = InitLoop.InPort( 'Max' , 'long' ) + IInitLoopGate = InitLoop.GetInPort( 'Gate' ) + OInitLoopDoLoop = InitLoop.GetOutPort( 'DoLoop' ) + OInitLoopIndex = InitLoop.GetOutPort( 'Index' ) + OInitLoopMin = InitLoop.GetOutPort( 'Min' ) + OInitLoopMax = InitLoop.GetOutPort( 'Max' ) + IEndOfInitLoopDoLoop = EndOfInitLoop.GetInPort( 'DoLoop' ) + IEndOfInitLoopIndex = EndOfInitLoop.GetInPort( 'Index' ) + IEndOfInitLoopMin = EndOfInitLoop.GetInPort( 'Min' ) + IEndOfInitLoopMax = EndOfInitLoop.GetInPort( 'Max' ) + IEndOfInitLoopGate = EndOfInitLoop.GetInPort( 'Gate' ) + OEndOfInitLoopDoLoop = EndOfInitLoop.GetOutPort( 'DoLoop' ) + OEndOfInitLoopGate = EndOfInitLoop.GetOutPort( 'Gate' ) + OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) + OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) + OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) + InitLoop.SetName( 'InitLoop' ) + InitLoop.SetAuthor( '' ) + InitLoop.SetComment( 'Compute Node' ) + InitLoop.Coords( 10 , 388 ) + + # Creation of Switch Nodes + PySwitch = [] + PySwitch.append( 'from time import * ' ) + PySwitch.append( 'def Switch(a) : ' ) + PySwitch.append( ' if ( a & 1 ) == 0 : ' ) + PySwitch.append( ' sleep(1) ' ) + PySwitch.append( ' return a & 1,1-(a&1),a ' ) + Switch,EndOfSwitch = GraphEditSwitchs.SNode( 'Switch' , PySwitch ) + EndOfSwitch.SetName( 'EndOfSwitch' ) + EndOfSwitch.SetAuthor( '' ) + EndOfSwitch.SetComment( 'Compute Node' ) + EndOfSwitch.Coords( 587 , 126 ) + PyEndOfSwitch = [] + EndOfSwitch.SetPyFunction( '' , PyEndOfSwitch ) + IEndOfSwitcha = EndOfSwitch.InPort( 'a' , 'long' ) + IEndOfSwitchDefault = EndOfSwitch.GetInPort( 'Default' ) + OEndOfSwitcha = EndOfSwitch.OutPort( 'a' , 'long' ) + OEndOfSwitchGate = EndOfSwitch.GetOutPort( 'Gate' ) + Switch.SetName( 'Switch' ) + Switch.SetAuthor( '' ) + Switch.SetComment( 'Compute Node' ) + Switch.Coords( 186 , 130 ) + ISwitcha = Switch.InPort( 'a' , 'long' ) + ISwitchGate = Switch.GetInPort( 'Gate' ) + OSwitchOdd = Switch.OutPort( 'Odd' , 'long' ) + OSwitchEven = Switch.OutPort( 'Even' , 'int' ) + OSwitcha = Switch.OutPort( 'a' , 'int' ) + OSwitchDefault = Switch.GetOutPort( 'Default' ) + + PySwitch_1 = [] + PySwitch_1.append( 'from time import * ' ) + PySwitch_1.append( 'def Switch(a) : ' ) + PySwitch_1.append( ' if ( a & 1 ) == 0 : ' ) + PySwitch_1.append( ' sleep(1) ' ) + PySwitch_1.append( ' return a & 1,1-(a&1),a ' ) + Switch_1,EndSwitch = GraphEditSwitchs.SNode( 'Switch' , PySwitch_1 ) + EndSwitch.SetName( 'EndSwitch' ) + EndSwitch.SetAuthor( '' ) + EndSwitch.SetComment( 'Compute Node' ) + EndSwitch.Coords( 605 , 382 ) + PyEndSwitch = [] + EndSwitch.SetPyFunction( '' , PyEndSwitch ) + IEndSwitcha = EndSwitch.InPort( 'a' , 'long' ) + IEndSwitchDefault = EndSwitch.GetInPort( 'Default' ) + OEndSwitcha = EndSwitch.OutPort( 'a' , 'long' ) + OEndSwitchGate = EndSwitch.GetOutPort( 'Gate' ) + Switch_1.SetName( 'Switch_1' ) + Switch_1.SetAuthor( '' ) + Switch_1.SetComment( 'Compute Node' ) + Switch_1.Coords( 193 , 388 ) + ISwitch_1a = Switch_1.InPort( 'a' , 'long' ) + ISwitch_1Gate = Switch_1.GetInPort( 'Gate' ) + OSwitch_1Odd = Switch_1.OutPort( 'Odd' , 'long' ) + OSwitch_1Even = Switch_1.OutPort( 'Even' , 'int' ) + OSwitch_1a = Switch_1.OutPort( 'a' , 'int' ) + OSwitch_1Default = Switch_1.GetOutPort( 'Default' ) + + # Creation of Links + LIsOddaEndOfSwitcha = GraphEditSwitchs.Link( OIsOdda , IEndOfSwitcha ) + LIsOddaEndOfSwitcha.AddCoord( 1 , 573 , 160 ) + LIsOddaEndOfSwitcha.AddCoord( 2 , 572 , 130 ) + + LIsOdd_1aEndSwitcha = GraphEditSwitchs.Link( OIsOdd_1a , IEndSwitcha ) + LIsOdd_1aEndSwitcha.AddCoord( 1 , 599 , 416 ) + LIsOdd_1aEndSwitcha.AddCoord( 2 , 598 , 389 ) + + LInitLoopIndexSwitch_1a = GraphEditSwitchs.Link( OInitLoopIndex , ISwitch_1a ) + + LInitLoopIndexSwitcha = GraphEditSwitchs.Link( OInitLoopIndex , ISwitcha ) + + LInitLoopMinEndOfInitLoopMin = GraphEditSwitchs.Link( OInitLoopMin , IEndOfInitLoopMin ) + + LInitLoopMaxEndOfInitLoopMax = GraphEditSwitchs.Link( OInitLoopMax , IEndOfInitLoopMax ) + + LSwitchOddIsOddGate = GraphEditSwitchs.Link( OSwitchOdd , IIsOddGate ) + + LSwitchaIsOdda = GraphEditSwitchs.Link( OSwitcha , IIsOdda ) + LSwitchaIsOdda.AddCoord( 1 , 365 , 129 ) + LSwitchaIsOdda.AddCoord( 2 , 365 , 222 ) + + LSwitchDefaultEndOfSwitchDefault = GraphEditSwitchs.Link( OSwitchDefault , IEndOfSwitchDefault ) + LSwitchDefaultEndOfSwitchDefault.AddCoord( 1 , 572 , 194 ) + LSwitchDefaultEndOfSwitchDefault.AddCoord( 2 , 571 , 257 ) + + LSwitch_1OddIsOdd_1Gate = GraphEditSwitchs.Link( OSwitch_1Odd , IIsOdd_1Gate ) + + LSwitch_1EvenEndSwitchDefault = GraphEditSwitchs.Link( OSwitch_1Even , IEndSwitchDefault ) + + LSwitch_1aIsOdd_1a = GraphEditSwitchs.Link( OSwitch_1a , IIsOdd_1a ) + LSwitch_1aIsOdd_1a.AddCoord( 1 , 379 , 387 ) + LSwitch_1aIsOdd_1a.AddCoord( 2 , 378 , 481 ) + + # Input datas + IInitLoopIndex.Input( 0 ) + IInitLoopMin.Input( 0 ) + IInitLoopMax.Input( 20 ) + + # Input Ports of the graph + #IEndOfInitLoopIndex = EndOfInitLoop.GetInPort( 'Index' ) + + # Output Ports of the graph + #OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) + #OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) + #OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) + #OSwitchEven = Switch.GetOutPort( 'Even' ) + #OEndOfSwitcha = EndOfSwitch.GetOutPort( 'a' ) + #OEndSwitcha = EndSwitch.GetOutPort( 'a' ) + return GraphEditSwitchs + + +GraphEditSwitchs = DefGraphEditSwitchs() diff --git a/examples/GraphEditGraphSwitchs_2.xml b/examples/GraphEditGraphSwitchs_2.xml new file mode 100644 index 0000000..6932cd9 --- /dev/null +++ b/examples/GraphEditGraphSwitchs_2.xml @@ -0,0 +1,496 @@ + + + + + +? + ? + GraphEditSwitchs + 1 + ? + +GraphEditSwitchs + + +long + InitLoop__Index + +long + InitLoop__Min + +long + InitLoop__Max + +long + EndOfInitLoop__Index + + +long + EndOfInitLoop__Index + +long + EndOfInitLoop__Min + +long + EndOfInitLoop__Max + +int + Switch__Even + +long + EndOfSwitch__a + +long + EndSwitch__a + + + 3/2/2005 - 16:14:10 + 3/2/2005 - 16:14:12 + 2.0 + ? + ? + ? + 0 + 0 + + +? + ? + IsOdd + 3 + ? + +IsOdd + + +long + a + + +long + a + + + +IsOdd + + + + + + 3/2/2005 - 16:14:10 + 3/2/2005 - 16:14:10 + 2.0 + ? + ? + Python function + 388 + 50 + +? + ? + IsOdd_1 + 3 + ? + +IsOdd_1 + + +long + a + + +long + a + + + +IsOdd + + + + + + 3/2/2005 - 16:14:10 + 3/2/2005 - 16:14:10 + 2.0 + ? + ? + Python function + 419 + 308 + +? + ? + InitLoop + 4 + EndOfInitLoop + +InitLoop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +InitLoop + + + +MoreLoop + + + + + + + +NextLoop + + + + 3/2/2005 - 16:14:10 + 3/2/2005 - 16:14:10 + 2.0 + ? + ? + Compute Node + 10 + 388 + +? + ? + EndOfInitLoop + 5 + InitLoop + +EndInitLoop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +? + + 3/2/2005 - 16:14:10 + 3/2/2005 - 16:14:10 + 2.0 + ? + ? + Compute Node + 783 + 381 + +? + ? + Switch + 6 + EndOfSwitch + +Switch + + +long + a + + +long + Odd + +int + Even + +int + a + + + +Switch + + + + + + 3/2/2005 - 16:14:10 + 3/2/2005 - 16:14:10 + 2.0 + ? + ? + Compute Node + 186 + 130 + +? + ? + EndOfSwitch + 7 + Switch + +EndSwitch + + +long + a + + +long + a + + + +? + + 3/2/2005 - 16:14:10 + 3/2/2005 - 16:14:10 + 2.0 + ? + ? + Compute Node + 587 + 126 + +? + ? + Switch_1 + 6 + EndSwitch + +Switch_1 + + +long + a + + +long + Odd + +int + Even + +int + a + + + +Switch + + + + + + 3/2/2005 - 16:14:11 + 3/2/2005 - 16:14:11 + 2.0 + ? + ? + Compute Node + 193 + 388 + +? + ? + EndSwitch + 7 + Switch_1 + +EndSwitch + + +long + a + + +long + a + + + +? + + 3/2/2005 - 16:14:11 + 3/2/2005 - 16:14:11 + 2.0 + ? + ? + Compute Node + 605 + 382 + + +IsOdd + a + EndOfSwitch + a + + +573 + 160 + +572 + 130 + +IsOdd_1 + a + EndSwitch + a + + +599 + 416 + +598 + 389 + +InitLoop + DoLoop + EndOfInitLoop + DoLoop + + +InitLoop + Index + Switch_1 + a + + +InitLoop + Index + Switch + a + + +InitLoop + Min + EndOfInitLoop + Min + + +InitLoop + Max + EndOfInitLoop + Max + + +EndOfInitLoop + DoLoop + InitLoop + DoLoop + + +Switch + Odd + IsOdd + Gate + + +Switch + a + IsOdd + a + + +365 + 129 + +365 + 222 + +Switch + Default + EndOfSwitch + Default + + +572 + 194 + +571 + 257 + +Switch_1 + Odd + IsOdd_1 + Gate + + +Switch_1 + Even + EndSwitch + Default + + +Switch_1 + a + IsOdd_1 + a + + +379 + 387 + +378 + 481 + + +GraphEditSwitchs + InitLoop__Index + InitLoop + Index + +3 + 0 + + +GraphEditSwitchs + InitLoop__Min + InitLoop + Min + +3 + 0 + + +GraphEditSwitchs + InitLoop__Max + InitLoop + Max + +3 + 20 + diff --git a/examples/GraphEditGraphSwitchs_3.py b/examples/GraphEditGraphSwitchs_3.py new file mode 100644 index 0000000..1189ba0 --- /dev/null +++ b/examples/GraphEditGraphSwitchs_3.py @@ -0,0 +1,205 @@ + +# Generated python file of Graph GraphEditSwitchs + +from SuperV import * + +# Graph creation of GraphEditSwitchs +def DefGraphEditSwitchs() : + GraphEditSwitchs = Graph( 'GraphEditSwitchs' ) + GraphEditSwitchs.SetName( 'GraphEditSwitchs' ) + GraphEditSwitchs.SetAuthor( '' ) + GraphEditSwitchs.SetComment( '' ) + GraphEditSwitchs.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsOdd = [] + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd(a) : ' ) + PyIsOdd.append( ' print a,"IsOdd (GraphSwitchs)" ' ) + PyIsOdd.append( ' sleep( 1 ) ' ) + PyIsOdd.append( ' return a ' ) + IsOdd = GraphEditSwitchs.INode( 'IsOdd' , PyIsOdd ) + IsOdd.SetName( 'IsOdd' ) + IsOdd.SetAuthor( '' ) + IsOdd.SetComment( 'Python function' ) + IsOdd.Coords( 388 , 50 ) + IIsOdda = IsOdd.InPort( 'a' , 'long' ) + IIsOddGate = IsOdd.GetInPort( 'Gate' ) + OIsOdda = IsOdd.OutPort( 'a' , 'long' ) + OIsOddGate = IsOdd.GetOutPort( 'Gate' ) + + PyIsOdd_1 = [] + PyIsOdd_1.append( 'from time import * ' ) + PyIsOdd_1.append( 'def IsOdd(a) : ' ) + PyIsOdd_1.append( ' print a,"IsOdd_1 (GraphSwitchs)" ' ) + PyIsOdd_1.append( ' sleep( 1 ) ' ) + PyIsOdd_1.append( ' return a ' ) + IsOdd_1 = GraphEditSwitchs.INode( 'IsOdd' , PyIsOdd_1 ) + IsOdd_1.SetName( 'IsOdd_1' ) + IsOdd_1.SetAuthor( '' ) + IsOdd_1.SetComment( 'Python function' ) + IsOdd_1.Coords( 419 , 308 ) + IIsOdd_1a = IsOdd_1.InPort( 'a' , 'long' ) + IIsOdd_1Gate = IsOdd_1.GetInPort( 'Gate' ) + OIsOdd_1a = IsOdd_1.OutPort( 'a' , 'long' ) + OIsOdd_1Gate = IsOdd_1.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyInitLoop = [] + PyInitLoop.append( 'def InitLoop(Index,Min,Max) : ' ) + PyInitLoop.append( ' return Index,Min,Max ' ) + PyMoreInitLoop = [] + PyMoreInitLoop.append( 'def MoreLoop(Index,Min,Max) : ' ) + PyMoreInitLoop.append( ' if Index <= Max : ' ) + PyMoreInitLoop.append( ' DoLoop = 1 ' ) + PyMoreInitLoop.append( ' else : ' ) + PyMoreInitLoop.append( ' DoLoop = 0 ' ) + PyMoreInitLoop.append( ' return DoLoop,Index,Min,Max ' ) + PyNextInitLoop = [] + PyNextInitLoop.append( 'def NextLoop(Index,Min,Max) : ' ) + PyNextInitLoop.append( ' Index = Index + 1 ' ) + PyNextInitLoop.append( ' return Index,Min,Max ' ) + InitLoop,EndOfInitLoop = GraphEditSwitchs.LNode( 'InitLoop' , PyInitLoop , 'MoreLoop' , PyMoreInitLoop , 'NextLoop' , PyNextInitLoop ) + EndOfInitLoop.SetName( 'EndOfInitLoop' ) + EndOfInitLoop.SetAuthor( '' ) + EndOfInitLoop.SetComment( 'Compute Node' ) + EndOfInitLoop.Coords( 783 , 381 ) + PyEndOfInitLoop = [] + EndOfInitLoop.SetPyFunction( '' , PyEndOfInitLoop ) + IInitLoopDoLoop = InitLoop.GetInPort( 'DoLoop' ) + IInitLoopIndex = InitLoop.InPort( 'Index' , 'long' ) + IInitLoopMin = InitLoop.InPort( 'Min' , 'long' ) + IInitLoopMax = InitLoop.InPort( 'Max' , 'long' ) + IInitLoopGate = InitLoop.GetInPort( 'Gate' ) + OInitLoopDoLoop = InitLoop.GetOutPort( 'DoLoop' ) + OInitLoopIndex = InitLoop.GetOutPort( 'Index' ) + OInitLoopMin = InitLoop.GetOutPort( 'Min' ) + OInitLoopMax = InitLoop.GetOutPort( 'Max' ) + IEndOfInitLoopDoLoop = EndOfInitLoop.GetInPort( 'DoLoop' ) + IEndOfInitLoopIndex = EndOfInitLoop.GetInPort( 'Index' ) + IEndOfInitLoopMin = EndOfInitLoop.GetInPort( 'Min' ) + IEndOfInitLoopMax = EndOfInitLoop.GetInPort( 'Max' ) + IEndOfInitLoopGate = EndOfInitLoop.GetInPort( 'Gate' ) + OEndOfInitLoopDoLoop = EndOfInitLoop.GetOutPort( 'DoLoop' ) + OEndOfInitLoopGate = EndOfInitLoop.GetOutPort( 'Gate' ) + OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) + OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) + OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) + InitLoop.SetName( 'InitLoop' ) + InitLoop.SetAuthor( '' ) + InitLoop.SetComment( 'Compute Node' ) + InitLoop.Coords( 10 , 388 ) + + # Creation of Switch Nodes + PySwitch = [] + PySwitch.append( 'from time import * ' ) + PySwitch.append( 'def Switch(a) : ' ) + PySwitch.append( ' if ( a & 1 ) == 0 : ' ) + PySwitch.append( ' sleep(1) ' ) + PySwitch.append( ' return a & 1,1-(a&1),a ' ) + Switch,EndOfSwitch = GraphEditSwitchs.SNode( 'Switch' , PySwitch ) + EndOfSwitch.SetName( 'EndOfSwitch' ) + EndOfSwitch.SetAuthor( '' ) + EndOfSwitch.SetComment( 'Compute Node' ) + EndOfSwitch.Coords( 587 , 126 ) + PyEndOfSwitch = [] + EndOfSwitch.SetPyFunction( '' , PyEndOfSwitch ) + IEndOfSwitcha = EndOfSwitch.InPort( 'a' , 'long' ) + IEndOfSwitchDefault = EndOfSwitch.GetInPort( 'Default' ) + OEndOfSwitcha = EndOfSwitch.OutPort( 'a' , 'long' ) + OEndOfSwitchGate = EndOfSwitch.GetOutPort( 'Gate' ) + Switch.SetName( 'Switch' ) + Switch.SetAuthor( '' ) + Switch.SetComment( 'Compute Node' ) + Switch.Coords( 186 , 130 ) + ISwitcha = Switch.InPort( 'a' , 'long' ) + ISwitchGate = Switch.GetInPort( 'Gate' ) + OSwitchOdd = Switch.OutPort( 'Odd' , 'long' ) + OSwitchEven = Switch.OutPort( 'Even' , 'int' ) + OSwitcha = Switch.OutPort( 'a' , 'int' ) + OSwitchDefault = Switch.GetOutPort( 'Default' ) + + PySwitch_1 = [] + PySwitch_1.append( 'from time import * ' ) + PySwitch_1.append( 'def Switch(a) : ' ) + PySwitch_1.append( ' if ( a & 1 ) == 0 : ' ) + PySwitch_1.append( ' sleep(1) ' ) + PySwitch_1.append( ' return a & 1,1-(a&1),a ' ) + Switch_1,EndSwitch = GraphEditSwitchs.SNode( 'Switch' , PySwitch_1 ) + EndSwitch.SetName( 'EndSwitch' ) + EndSwitch.SetAuthor( '' ) + EndSwitch.SetComment( 'Compute Node' ) + EndSwitch.Coords( 605 , 382 ) + PyEndSwitch = [] + EndSwitch.SetPyFunction( '' , PyEndSwitch ) + IEndSwitcha = EndSwitch.InPort( 'a' , 'long' ) + IEndSwitchDefault = EndSwitch.GetInPort( 'Default' ) + OEndSwitcha = EndSwitch.OutPort( 'a' , 'long' ) + OEndSwitchGate = EndSwitch.GetOutPort( 'Gate' ) + Switch_1.SetName( 'Switch_1' ) + Switch_1.SetAuthor( '' ) + Switch_1.SetComment( 'Compute Node' ) + Switch_1.Coords( 193 , 388 ) + ISwitch_1a = Switch_1.InPort( 'a' , 'long' ) + ISwitch_1Gate = Switch_1.GetInPort( 'Gate' ) + OSwitch_1Odd = Switch_1.OutPort( 'Odd' , 'long' ) + OSwitch_1Even = Switch_1.OutPort( 'Even' , 'int' ) + OSwitch_1a = Switch_1.OutPort( 'a' , 'int' ) + OSwitch_1Default = Switch_1.GetOutPort( 'Default' ) + + # Creation of Links + LIsOddaEndOfSwitcha = GraphEditSwitchs.Link( OIsOdda , IEndOfSwitcha ) + LIsOddaEndOfSwitcha.AddCoord( 1 , 573 , 160 ) + LIsOddaEndOfSwitcha.AddCoord( 2 , 572 , 130 ) + + LIsOdd_1aEndSwitcha = GraphEditSwitchs.Link( OIsOdd_1a , IEndSwitcha ) + LIsOdd_1aEndSwitcha.AddCoord( 1 , 599 , 416 ) + LIsOdd_1aEndSwitcha.AddCoord( 2 , 598 , 389 ) + + LInitLoopIndexSwitch_1a = GraphEditSwitchs.Link( OInitLoopIndex , ISwitch_1a ) + + LInitLoopIndexSwitcha = GraphEditSwitchs.Link( OInitLoopIndex , ISwitcha ) + + LInitLoopMinEndOfInitLoopMin = GraphEditSwitchs.Link( OInitLoopMin , IEndOfInitLoopMin ) + + LInitLoopMaxEndOfInitLoopMax = GraphEditSwitchs.Link( OInitLoopMax , IEndOfInitLoopMax ) + + LSwitchOddIsOddGate = GraphEditSwitchs.Link( OSwitchOdd , IIsOddGate ) + + LSwitchaIsOdda = GraphEditSwitchs.Link( OSwitcha , IIsOdda ) + LSwitchaIsOdda.AddCoord( 1 , 365 , 129 ) + LSwitchaIsOdda.AddCoord( 2 , 365 , 222 ) + + LSwitchDefaultEndOfSwitchDefault = GraphEditSwitchs.Link( OSwitchDefault , IEndOfSwitchDefault ) + LSwitchDefaultEndOfSwitchDefault.AddCoord( 1 , 572 , 194 ) + LSwitchDefaultEndOfSwitchDefault.AddCoord( 2 , 571 , 257 ) + + LEndOfSwitchaEndOfInitLoopIndex = GraphEditSwitchs.Link( OEndOfSwitcha , IEndOfInitLoopIndex ) + + LSwitch_1OddIsOdd_1Gate = GraphEditSwitchs.Link( OSwitch_1Odd , IIsOdd_1Gate ) + + LSwitch_1EvenEndSwitchDefault = GraphEditSwitchs.Link( OSwitch_1Even , IEndSwitchDefault ) + + LSwitch_1aIsOdd_1a = GraphEditSwitchs.Link( OSwitch_1a , IIsOdd_1a ) + LSwitch_1aIsOdd_1a.AddCoord( 1 , 379 , 387 ) + LSwitch_1aIsOdd_1a.AddCoord( 2 , 378 , 481 ) + + LEndSwitchGateEndOfInitLoopGate = GraphEditSwitchs.Link( OEndSwitchGate , IEndOfInitLoopGate ) + + # Input datas + IInitLoopIndex.Input( 0 ) + IInitLoopMin.Input( 0 ) + IInitLoopMax.Input( 20 ) + + # Output Ports of the graph + #OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) + #OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) + #OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) + #OSwitchEven = Switch.GetOutPort( 'Even' ) + #OEndSwitcha = EndSwitch.GetOutPort( 'a' ) + return GraphEditSwitchs + + +GraphEditSwitchs = DefGraphEditSwitchs() diff --git a/examples/GraphEditGraphSwitchs_3.xml b/examples/GraphEditGraphSwitchs_3.xml new file mode 100644 index 0000000..cd21fd0 --- /dev/null +++ b/examples/GraphEditGraphSwitchs_3.xml @@ -0,0 +1,502 @@ + + + + + +? + ? + GraphEditSwitchs + 1 + ? + +GraphEditSwitchs + + +long + InitLoop__Index + +long + InitLoop__Min + +long + InitLoop__Max + + +long + EndOfInitLoop__Index + +long + EndOfInitLoop__Min + +long + EndOfInitLoop__Max + +int + Switch__Even + +long + EndSwitch__a + + + 3/2/2005 - 16:14:10 + 3/2/2005 - 16:14:12 + 2.0 + ? + ? + ? + 0 + 0 + + +? + ? + IsOdd + 3 + ? + +IsOdd + + +long + a + + +long + a + + + +IsOdd + + + + + + 3/2/2005 - 16:14:10 + 3/2/2005 - 16:14:10 + 2.0 + ? + ? + Python function + 388 + 50 + +? + ? + IsOdd_1 + 3 + ? + +IsOdd_1 + + +long + a + + +long + a + + + +IsOdd + + + + + + 3/2/2005 - 16:14:10 + 3/2/2005 - 16:14:10 + 2.0 + ? + ? + Python function + 419 + 308 + +? + ? + InitLoop + 4 + EndOfInitLoop + +InitLoop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +InitLoop + + + +MoreLoop + + + + + + + +NextLoop + + + + 3/2/2005 - 16:14:10 + 3/2/2005 - 16:14:10 + 2.0 + ? + ? + Compute Node + 10 + 388 + +? + ? + EndOfInitLoop + 5 + InitLoop + +EndInitLoop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +? + + 3/2/2005 - 16:14:10 + 3/2/2005 - 16:14:10 + 2.0 + ? + ? + Compute Node + 783 + 381 + +? + ? + Switch + 6 + EndOfSwitch + +Switch + + +long + a + + +long + Odd + +int + Even + +int + a + + + +Switch + + + + + + 3/2/2005 - 16:14:10 + 3/2/2005 - 16:14:10 + 2.0 + ? + ? + Compute Node + 186 + 130 + +? + ? + EndOfSwitch + 7 + Switch + +EndSwitch + + +long + a + + +long + a + + + +? + + 3/2/2005 - 16:14:10 + 3/2/2005 - 16:14:10 + 2.0 + ? + ? + Compute Node + 587 + 126 + +? + ? + Switch_1 + 6 + EndSwitch + +Switch_1 + + +long + a + + +long + Odd + +int + Even + +int + a + + + +Switch + + + + + + 3/2/2005 - 16:14:11 + 3/2/2005 - 16:14:11 + 2.0 + ? + ? + Compute Node + 193 + 388 + +? + ? + EndSwitch + 7 + Switch_1 + +EndSwitch + + +long + a + + +long + a + + + +? + + 3/2/2005 - 16:14:11 + 3/2/2005 - 16:14:11 + 2.0 + ? + ? + Compute Node + 605 + 382 + + +IsOdd + a + EndOfSwitch + a + + +573 + 160 + +572 + 130 + +IsOdd_1 + a + EndSwitch + a + + +599 + 416 + +598 + 389 + +InitLoop + DoLoop + EndOfInitLoop + DoLoop + + +InitLoop + Index + Switch_1 + a + + +InitLoop + Index + Switch + a + + +InitLoop + Min + EndOfInitLoop + Min + + +InitLoop + Max + EndOfInitLoop + Max + + +EndOfInitLoop + DoLoop + InitLoop + DoLoop + + +Switch + Odd + IsOdd + Gate + + +Switch + a + IsOdd + a + + +365 + 129 + +365 + 222 + +Switch + Default + EndOfSwitch + Default + + +572 + 194 + +571 + 257 + +EndOfSwitch + a + EndOfInitLoop + Index + + +Switch_1 + Odd + IsOdd_1 + Gate + + +Switch_1 + Even + EndSwitch + Default + + +Switch_1 + a + IsOdd_1 + a + + +379 + 387 + +378 + 481 + +EndSwitch + Gate + EndOfInitLoop + Gate + + + +GraphEditSwitchs + InitLoop__Index + InitLoop + Index + +3 + 0 + + +GraphEditSwitchs + InitLoop__Min + InitLoop + Min + +3 + 0 + + +GraphEditSwitchs + InitLoop__Max + InitLoop + Max + +3 + 20 + diff --git a/examples/GraphEditGraphSwitchs_4.py b/examples/GraphEditGraphSwitchs_4.py new file mode 100644 index 0000000..57ad2ad --- /dev/null +++ b/examples/GraphEditGraphSwitchs_4.py @@ -0,0 +1,206 @@ + +# Generated python file of Graph GraphEditSwitchs + +from SuperV import * + +# Graph creation of GraphEditSwitchs +def DefGraphEditSwitchs() : + GraphEditSwitchs = Graph( 'GraphEditSwitchs' ) + GraphEditSwitchs.SetName( 'GraphEditSwitchs' ) + GraphEditSwitchs.SetAuthor( '' ) + GraphEditSwitchs.SetComment( '' ) + GraphEditSwitchs.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsOdd = [] + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd(a) : ' ) + PyIsOdd.append( ' print a,"IsOdd (GraphSwitchs)" ' ) + PyIsOdd.append( ' sleep( 1 ) ' ) + PyIsOdd.append( ' return a ' ) + IsOdd = GraphEditSwitchs.INode( 'IsOdd' , PyIsOdd ) + IsOdd.SetName( 'IsOdd' ) + IsOdd.SetAuthor( '' ) + IsOdd.SetComment( 'Python function' ) + IsOdd.Coords( 388 , 50 ) + IIsOdda = IsOdd.InPort( 'a' , 'long' ) + IIsOddGate = IsOdd.GetInPort( 'Gate' ) + OIsOdda = IsOdd.OutPort( 'a' , 'long' ) + OIsOddGate = IsOdd.GetOutPort( 'Gate' ) + + PyIsEven = [] + PyIsEven.append( 'from time import * ' ) + PyIsEven.append( 'def IsOdd(a) : ' ) + PyIsEven.append( ' print a,"IsOdd_1 (GraphSwitchs)" ' ) + PyIsEven.append( ' sleep( 1 ) ' ) + PyIsEven.append( ' return a ' ) + IsEven = GraphEditSwitchs.INode( 'IsOdd' , PyIsEven ) + IsEven.SetName( 'IsEven' ) + IsEven.SetAuthor( '' ) + IsEven.SetComment( 'Python function' ) + IsEven.Coords( 419 , 308 ) + IIsEvena = IsEven.InPort( 'a' , 'long' ) + IIsEvenGate = IsEven.GetInPort( 'Gate' ) + OIsEvena = IsEven.OutPort( 'a' , 'long' ) + OIsEvenGate = IsEven.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyInitLoop = [] + PyInitLoop.append( 'def InitLoop(Index,Min,Max) : ' ) + PyInitLoop.append( ' return Index,Min,Max ' ) + PyMoreInitLoop = [] + PyMoreInitLoop.append( 'def MoreLoop(Index,Min,Max) : ' ) + PyMoreInitLoop.append( ' if Index <= Max : ' ) + PyMoreInitLoop.append( ' DoLoop = 1 ' ) + PyMoreInitLoop.append( ' else : ' ) + PyMoreInitLoop.append( ' DoLoop = 0 ' ) + PyMoreInitLoop.append( ' return DoLoop,Index,Min,Max ' ) + PyNextInitLoop = [] + PyNextInitLoop.append( 'def NextLoop(Index,Min,Max) : ' ) + PyNextInitLoop.append( ' Index = Index + 1 ' ) + PyNextInitLoop.append( ' return Index,Min,Max ' ) + InitLoop,EndOfInitLoop = GraphEditSwitchs.LNode( 'InitLoop' , PyInitLoop , 'MoreLoop' , PyMoreInitLoop , 'NextLoop' , PyNextInitLoop ) + EndOfInitLoop.SetName( 'EndOfInitLoop' ) + EndOfInitLoop.SetAuthor( '' ) + EndOfInitLoop.SetComment( 'Compute Node' ) + EndOfInitLoop.Coords( 783 , 381 ) + PyEndOfInitLoop = [] + EndOfInitLoop.SetPyFunction( '' , PyEndOfInitLoop ) + IInitLoopDoLoop = InitLoop.GetInPort( 'DoLoop' ) + IInitLoopIndex = InitLoop.InPort( 'Index' , 'long' ) + IInitLoopMin = InitLoop.InPort( 'Min' , 'long' ) + IInitLoopMax = InitLoop.InPort( 'Max' , 'long' ) + IInitLoopGate = InitLoop.GetInPort( 'Gate' ) + OInitLoopDoLoop = InitLoop.GetOutPort( 'DoLoop' ) + OInitLoopIndex = InitLoop.GetOutPort( 'Index' ) + OInitLoopMin = InitLoop.GetOutPort( 'Min' ) + OInitLoopMax = InitLoop.GetOutPort( 'Max' ) + IEndOfInitLoopDoLoop = EndOfInitLoop.GetInPort( 'DoLoop' ) + IEndOfInitLoopIndex = EndOfInitLoop.GetInPort( 'Index' ) + IEndOfInitLoopMin = EndOfInitLoop.GetInPort( 'Min' ) + IEndOfInitLoopMax = EndOfInitLoop.GetInPort( 'Max' ) + IEndOfInitLoopGate = EndOfInitLoop.GetInPort( 'Gate' ) + OEndOfInitLoopDoLoop = EndOfInitLoop.GetOutPort( 'DoLoop' ) + OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) + OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) + OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) + OEndOfInitLoopGate = EndOfInitLoop.GetOutPort( 'Gate' ) + InitLoop.SetName( 'InitLoop' ) + InitLoop.SetAuthor( '' ) + InitLoop.SetComment( 'Compute Node' ) + InitLoop.Coords( 10 , 388 ) + + # Creation of Switch Nodes + PySwitch = [] + PySwitch.append( 'from time import * ' ) + PySwitch.append( 'def Switch(a) : ' ) + PySwitch.append( ' if ( a & 1 ) == 0 : ' ) + PySwitch.append( ' sleep(1) ' ) + PySwitch.append( ' return a & 1,1-(a&1),a ' ) + Switch,EndOfSwitch = GraphEditSwitchs.SNode( 'Switch' , PySwitch ) + EndOfSwitch.SetName( 'EndOfSwitch' ) + EndOfSwitch.SetAuthor( '' ) + EndOfSwitch.SetComment( 'Compute Node' ) + EndOfSwitch.Coords( 587 , 126 ) + PyEndOfSwitch = [] + EndOfSwitch.SetPyFunction( '' , PyEndOfSwitch ) + IEndOfSwitcha = EndOfSwitch.InPort( 'a' , 'long' ) + IEndOfSwitchDefault = EndOfSwitch.GetInPort( 'Default' ) + OEndOfSwitcha = EndOfSwitch.OutPort( 'a' , 'long' ) + OEndOfSwitchGate = EndOfSwitch.GetOutPort( 'Gate' ) + Switch.SetName( 'Switch' ) + Switch.SetAuthor( '' ) + Switch.SetComment( 'Compute Node' ) + Switch.Coords( 186 , 130 ) + ISwitcha = Switch.InPort( 'a' , 'long' ) + ISwitchGate = Switch.GetInPort( 'Gate' ) + OSwitchOdd = Switch.OutPort( 'Odd' , 'long' ) + OSwitchEven = Switch.OutPort( 'Even' , 'int' ) + OSwitcha = Switch.OutPort( 'a' , 'int' ) + OSwitchDefault = Switch.GetOutPort( 'Default' ) + + PySwitch_1 = [] + PySwitch_1.append( 'from time import * ' ) + PySwitch_1.append( 'def Switch(a) : ' ) + PySwitch_1.append( ' if ( a & 1 ) == 0 : ' ) + PySwitch_1.append( ' sleep(1) ' ) + PySwitch_1.append( ' return a & 1,1-(a&1),a ' ) + Switch_1,EndSwitch = GraphEditSwitchs.SNode( 'Switch' , PySwitch_1 ) + EndSwitch.SetName( 'EndSwitch' ) + EndSwitch.SetAuthor( '' ) + EndSwitch.SetComment( 'Compute Node' ) + EndSwitch.Coords( 605 , 382 ) + PyEndSwitch = [] + EndSwitch.SetPyFunction( '' , PyEndSwitch ) + IEndSwitcha = EndSwitch.InPort( 'a' , 'long' ) + IEndSwitchDefault = EndSwitch.GetInPort( 'Default' ) + OEndSwitcha = EndSwitch.OutPort( 'a' , 'long' ) + OEndSwitchGate = EndSwitch.GetOutPort( 'Gate' ) + Switch_1.SetName( 'Switch_1' ) + Switch_1.SetAuthor( '' ) + Switch_1.SetComment( 'Compute Node' ) + Switch_1.Coords( 193 , 388 ) + ISwitch_1a = Switch_1.InPort( 'a' , 'long' ) + ISwitch_1Gate = Switch_1.GetInPort( 'Gate' ) + OSwitch_1Odd = Switch_1.OutPort( 'Odd' , 'long' ) + OSwitch_1Even = Switch_1.OutPort( 'Even' , 'int' ) + OSwitch_1a = Switch_1.OutPort( 'a' , 'int' ) + OSwitch_1Default = Switch_1.GetOutPort( 'Default' ) + + # Creation of Links + LIsOddaEndOfSwitcha = GraphEditSwitchs.Link( OIsOdda , IEndOfSwitcha ) + LIsOddaEndOfSwitcha.AddCoord( 1 , 573 , 160 ) + LIsOddaEndOfSwitcha.AddCoord( 2 , 572 , 130 ) + + LIsEvenaEndSwitcha = GraphEditSwitchs.Link( OIsEvena , IEndSwitcha ) + LIsEvenaEndSwitcha.AddCoord( 1 , 599 , 416 ) + LIsEvenaEndSwitcha.AddCoord( 2 , 598 , 389 ) + + LInitLoopIndexSwitch_1a = GraphEditSwitchs.Link( OInitLoopIndex , ISwitch_1a ) + + LInitLoopIndexSwitcha = GraphEditSwitchs.Link( OInitLoopIndex , ISwitcha ) + + LInitLoopMinEndOfInitLoopMin = GraphEditSwitchs.Link( OInitLoopMin , IEndOfInitLoopMin ) + + LInitLoopMaxEndOfInitLoopMax = GraphEditSwitchs.Link( OInitLoopMax , IEndOfInitLoopMax ) + + LSwitchOddIsOddGate = GraphEditSwitchs.Link( OSwitchOdd , IIsOddGate ) + + LSwitchaIsOdda = GraphEditSwitchs.Link( OSwitcha , IIsOdda ) + LSwitchaIsOdda.AddCoord( 1 , 365 , 129 ) + LSwitchaIsOdda.AddCoord( 2 , 365 , 222 ) + + LSwitchDefaultEndOfSwitchDefault = GraphEditSwitchs.Link( OSwitchDefault , IEndOfSwitchDefault ) + LSwitchDefaultEndOfSwitchDefault.AddCoord( 1 , 572 , 194 ) + LSwitchDefaultEndOfSwitchDefault.AddCoord( 2 , 571 , 257 ) + + LEndOfSwitchaEndOfInitLoopIndex = GraphEditSwitchs.Link( OEndOfSwitcha , IEndOfInitLoopIndex ) + + LSwitch_1EvenEndSwitchDefault = GraphEditSwitchs.Link( OSwitch_1Even , IEndSwitchDefault ) + + LSwitch_1EvenIsEvenGate = GraphEditSwitchs.Link( OSwitch_1Even , IIsEvenGate ) + + LEndSwitchGateEndOfInitLoopGate = GraphEditSwitchs.Link( OEndSwitchGate , IEndOfInitLoopGate ) + + # Input datas + IInitLoopIndex.Input( 0 ) + IInitLoopMin.Input( 0 ) + IInitLoopMax.Input( 20 ) + + # Input Ports of the graph + #IIsEvena = IsEven.GetInPort( 'a' ) + + # Output Ports of the graph + #OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) + #OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) + #OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) + #OSwitchEven = Switch.GetOutPort( 'Even' ) + #OSwitch_1Odd = Switch_1.GetOutPort( 'Odd' ) + #OSwitch_1a = Switch_1.GetOutPort( 'a' ) + #OEndSwitcha = EndSwitch.GetOutPort( 'a' ) + return GraphEditSwitchs + + +GraphEditSwitchs = DefGraphEditSwitchs() diff --git a/examples/GraphEditGraphSwitchs_4.xml b/examples/GraphEditGraphSwitchs_4.xml new file mode 100644 index 0000000..c1157a0 --- /dev/null +++ b/examples/GraphEditGraphSwitchs_4.xml @@ -0,0 +1,499 @@ + + + + + +? + ? + GraphEditSwitchs + 1 + ? + +GraphEditSwitchs + + +long + IsEven__a + +long + InitLoop__Index + +long + InitLoop__Min + +long + InitLoop__Max + + +long + EndOfInitLoop__Index + +long + EndOfInitLoop__Min + +long + EndOfInitLoop__Max + +int + Switch__Even + +long + Switch_1__Odd + +int + Switch_1__a + +long + EndSwitch__a + + + 3/2/2005 - 16:14:10 + 3/2/2005 - 16:56:34 + 2.0 + ? + ? + ? + 0 + 0 + + +? + ? + IsOdd + 3 + ? + +IsOdd + + +long + a + + +long + a + + + +IsOdd + + + + + + 3/2/2005 - 16:54:2 + 3/2/2005 - 16:54:2 + 2.0 + ? + ? + Python function + 388 + 50 + +? + ? + IsEven + 3 + ? + +IsOdd_1 + + +long + a + + +long + a + + + +IsOdd + + + + + + 3/2/2005 - 16:54:2 + 3/2/2005 - 16:54:2 + 2.0 + ? + ? + Python function + 419 + 308 + +? + ? + InitLoop + 4 + EndOfInitLoop + +InitLoop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +InitLoop + + + +MoreLoop + + + + + + + +NextLoop + + + + 3/2/2005 - 16:54:2 + 3/2/2005 - 16:54:2 + 2.0 + ? + ? + Compute Node + 10 + 388 + +? + ? + EndOfInitLoop + 5 + InitLoop + +EndOfInitLoop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +? + + 3/2/2005 - 16:54:2 + 3/2/2005 - 16:54:2 + 2.0 + ? + ? + Compute Node + 783 + 381 + +? + ? + Switch + 6 + EndOfSwitch + +Switch + + +long + a + + +long + Odd + +int + Even + +int + a + + + +Switch + + + + + + 3/2/2005 - 16:54:2 + 3/2/2005 - 16:54:2 + 2.0 + ? + ? + Compute Node + 186 + 130 + +? + ? + EndOfSwitch + 7 + Switch + +EndOfSwitch + + +long + a + + +long + a + + + +? + + 3/2/2005 - 16:54:2 + 3/2/2005 - 16:54:2 + 2.0 + ? + ? + Compute Node + 587 + 126 + +? + ? + Switch_1 + 6 + EndSwitch + +Switch_1 + + +long + a + + +long + Odd + +int + Even + +int + a + + + +Switch + + + + + + 3/2/2005 - 16:54:2 + 3/2/2005 - 16:54:2 + 2.0 + ? + ? + Compute Node + 193 + 388 + +? + ? + EndSwitch + 7 + Switch_1 + +EndSwitch + + +long + a + + +long + a + + + +? + + 3/2/2005 - 16:54:2 + 3/2/2005 - 16:54:2 + 2.0 + ? + ? + Compute Node + 605 + 382 + + +IsOdd + a + EndOfSwitch + a + + +573 + 160 + +572 + 130 + +IsEven + a + EndSwitch + a + + +599 + 416 + +598 + 389 + +InitLoop + DoLoop + EndOfInitLoop + DoLoop + + +InitLoop + Index + Switch_1 + a + + +InitLoop + Index + Switch + a + + +InitLoop + Min + EndOfInitLoop + Min + + +InitLoop + Max + EndOfInitLoop + Max + + +EndOfInitLoop + DoLoop + InitLoop + DoLoop + + +Switch + Odd + IsOdd + Gate + + +Switch + a + IsOdd + a + + +365 + 129 + +365 + 222 + +Switch + Default + EndOfSwitch + Default + + +572 + 194 + +571 + 257 + +EndOfSwitch + a + EndOfInitLoop + Index + + +Switch_1 + Even + EndSwitch + Default + + +Switch_1 + Even + IsEven + Gate + + +EndSwitch + Gate + EndOfInitLoop + Gate + + + +GraphEditSwitchs + InitLoop__Index + InitLoop + Index + +3 + 0 + + +GraphEditSwitchs + InitLoop__Min + InitLoop + Min + +3 + 0 + + +GraphEditSwitchs + InitLoop__Max + InitLoop + Max + +3 + 20 + diff --git a/examples/GraphEditGraphSwitchs_5.py b/examples/GraphEditGraphSwitchs_5.py new file mode 100644 index 0000000..8bd31d4 --- /dev/null +++ b/examples/GraphEditGraphSwitchs_5.py @@ -0,0 +1,196 @@ + +# Generated python file of Graph GraphEditSwitchs_5 + +from SuperV import * + +# Graph creation of GraphEditSwitchs_5 +def DefGraphEditSwitchs_5() : + GraphEditSwitchs_5 = Graph( 'GraphEditSwitchs_5' ) + GraphEditSwitchs_5.SetName( 'GraphEditSwitchs_5' ) + GraphEditSwitchs_5.SetAuthor( '' ) + GraphEditSwitchs_5.SetComment( '' ) + GraphEditSwitchs_5.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsOdd = [] + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd(a) : ' ) + PyIsOdd.append( ' print a,"IsOdd (GraphSwitchs)" ' ) + PyIsOdd.append( ' sleep( 1 ) ' ) + PyIsOdd.append( ' return a ' ) + IsOdd = GraphEditSwitchs_5.INode( 'IsOdd' , PyIsOdd ) + IsOdd.SetName( 'IsOdd' ) + IsOdd.SetAuthor( '' ) + IsOdd.SetComment( 'Python function' ) + IsOdd.Coords( 393 , 67 ) + IIsOdda = IsOdd.InPort( 'a' , 'long' ) + IIsOddGate = IsOdd.GetInPort( 'Gate' ) + OIsOdda = IsOdd.OutPort( 'a' , 'long' ) + OIsOddGate = IsOdd.GetOutPort( 'Gate' ) + + PyIsEven = [] + PyIsEven.append( 'from time import * ' ) + PyIsEven.append( 'def IsEven(a) : ' ) + PyIsEven.append( ' print a,"IsEven" ' ) + PyIsEven.append( ' sleep( 1 ) ' ) + PyIsEven.append( ' return a ' ) + IsEven = GraphEditSwitchs_5.INode( 'IsEven' , PyIsEven ) + IsEven.SetName( 'IsEven' ) + IsEven.SetAuthor( '' ) + IsEven.SetComment( 'Python function' ) + IsEven.Coords( 408 , 343 ) + IIsEvena = IsEven.InPort( 'a' , 'long' ) + IIsEvenGate = IsEven.GetInPort( 'Gate' ) + OIsEvena = IsEven.OutPort( 'a' , 'long' ) + OIsEvenGate = IsEven.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyInitLoop = [] + PyInitLoop.append( 'def InitLoop(Index,Min,Max) : ' ) + PyInitLoop.append( ' return Index,Min,Max ' ) + PyMoreInitLoop = [] + PyMoreInitLoop.append( 'def MoreLoop(Index,Min,Max) : ' ) + PyMoreInitLoop.append( ' if Index <= Max : ' ) + PyMoreInitLoop.append( ' DoLoop = 1 ' ) + PyMoreInitLoop.append( ' else : ' ) + PyMoreInitLoop.append( ' DoLoop = 0 ' ) + PyMoreInitLoop.append( ' return DoLoop,Index,Min,Max ' ) + PyNextInitLoop = [] + PyNextInitLoop.append( 'def NextLoop(Index,Min,Max) : ' ) + PyNextInitLoop.append( ' Index = Index + 1 ' ) + PyNextInitLoop.append( ' return Index,Min,Max ' ) + InitLoop,EndOfInitLoop = GraphEditSwitchs_5.LNode( 'InitLoop' , PyInitLoop , 'MoreLoop' , PyMoreInitLoop , 'NextLoop' , PyNextInitLoop ) + EndOfInitLoop.SetName( 'EndOfInitLoop' ) + EndOfInitLoop.SetAuthor( '' ) + EndOfInitLoop.SetComment( 'Compute Node' ) + EndOfInitLoop.Coords( 823 , 259 ) + PyEndOfInitLoop = [] + EndOfInitLoop.SetPyFunction( '' , PyEndOfInitLoop ) + IInitLoopDoLoop = InitLoop.GetInPort( 'DoLoop' ) + IInitLoopIndex = InitLoop.InPort( 'Index' , 'long' ) + IInitLoopMin = InitLoop.InPort( 'Min' , 'long' ) + IInitLoopMax = InitLoop.InPort( 'Max' , 'long' ) + IInitLoopGate = InitLoop.GetInPort( 'Gate' ) + OInitLoopDoLoop = InitLoop.GetOutPort( 'DoLoop' ) + OInitLoopIndex = InitLoop.GetOutPort( 'Index' ) + OInitLoopMin = InitLoop.GetOutPort( 'Min' ) + OInitLoopMax = InitLoop.GetOutPort( 'Max' ) + IEndOfInitLoopDoLoop = EndOfInitLoop.GetInPort( 'DoLoop' ) + IEndOfInitLoopIndex = EndOfInitLoop.GetInPort( 'Index' ) + IEndOfInitLoopMin = EndOfInitLoop.GetInPort( 'Min' ) + IEndOfInitLoopMax = EndOfInitLoop.GetInPort( 'Max' ) + IEndOfInitLoopGate = EndOfInitLoop.GetInPort( 'Gate' ) + OEndOfInitLoopDoLoop = EndOfInitLoop.GetOutPort( 'DoLoop' ) + OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) + OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) + OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) + OEndOfInitLoopGate = EndOfInitLoop.GetOutPort( 'Gate' ) + InitLoop.SetName( 'InitLoop' ) + InitLoop.SetAuthor( '' ) + InitLoop.SetComment( 'Compute Node' ) + InitLoop.Coords( 10 , 248 ) + + # Creation of Switch Nodes + PySwitch = [] + PySwitch.append( 'from time import * ' ) + PySwitch.append( 'def Switch(a) : ' ) + PySwitch.append( ' if ( a & 1 ) == 0 : ' ) + PySwitch.append( ' sleep(1) ' ) + PySwitch.append( ' return a & 1,1-(a&1),a ' ) + Switch,EndOfSwitch = GraphEditSwitchs_5.SNode( 'Switch' , PySwitch ) + EndOfSwitch.SetName( 'EndOfSwitch' ) + EndOfSwitch.SetAuthor( '' ) + EndOfSwitch.SetComment( 'Compute Node' ) + EndOfSwitch.Coords( 584 , 172 ) + PyEndOfSwitch = [] + EndOfSwitch.SetPyFunction( '' , PyEndOfSwitch ) + IEndOfSwitcha = EndOfSwitch.InPort( 'a' , 'long' ) + IEndOfSwitchDefault = EndOfSwitch.GetInPort( 'Default' ) + OEndOfSwitcha = EndOfSwitch.OutPort( 'a' , 'long' ) + OEndOfSwitchGate = EndOfSwitch.GetOutPort( 'Gate' ) + Switch.SetName( 'Switch' ) + Switch.SetAuthor( '' ) + Switch.SetComment( 'Compute Node' ) + Switch.Coords( 199 , 132 ) + ISwitcha = Switch.InPort( 'a' , 'long' ) + ISwitchGate = Switch.GetInPort( 'Gate' ) + OSwitchOdd = Switch.OutPort( 'Odd' , 'long' ) + OSwitchEven = Switch.OutPort( 'Even' , 'int' ) + OSwitcha = Switch.OutPort( 'a' , 'int' ) + OSwitchDefault = Switch.GetOutPort( 'Default' ) + + PySwitch_1 = [] + PySwitch_1.append( 'from time import * ' ) + PySwitch_1.append( 'def Switch(a) : ' ) + PySwitch_1.append( ' if ( a & 1 ) == 0 : ' ) + PySwitch_1.append( ' sleep(1) ' ) + PySwitch_1.append( ' return a & 1,1-(a&1),a ' ) + Switch_1,EndSwitch = GraphEditSwitchs_5.SNode( 'Switch' , PySwitch_1 ) + EndSwitch.SetName( 'EndSwitch' ) + EndSwitch.SetAuthor( '' ) + EndSwitch.SetComment( 'Compute Node' ) + EndSwitch.Coords( 608 , 430 ) + PyEndSwitch = [] + EndSwitch.SetPyFunction( '' , PyEndSwitch ) + IEndSwitcha = EndSwitch.InPort( 'a' , 'long' ) + IEndSwitchDefault = EndSwitch.GetInPort( 'Default' ) + OEndSwitcha = EndSwitch.OutPort( 'a' , 'long' ) + OEndSwitchGate = EndSwitch.GetOutPort( 'Gate' ) + Switch_1.SetName( 'Switch_1' ) + Switch_1.SetAuthor( '' ) + Switch_1.SetComment( 'Compute Node' ) + Switch_1.Coords( 201 , 388 ) + ISwitch_1a = Switch_1.InPort( 'a' , 'long' ) + ISwitch_1Gate = Switch_1.GetInPort( 'Gate' ) + OSwitch_1Odd = Switch_1.OutPort( 'Odd' , 'long' ) + OSwitch_1Even = Switch_1.OutPort( 'Even' , 'int' ) + OSwitch_1a = Switch_1.OutPort( 'a' , 'int' ) + OSwitch_1Default = Switch_1.GetOutPort( 'Default' ) + + # Creation of Links + LIsOddaEndOfSwitcha = GraphEditSwitchs_5.Link( OIsOdda , IEndOfSwitcha ) + + LIsEvenaEndSwitcha = GraphEditSwitchs_5.Link( OIsEvena , IEndSwitcha ) + + LInitLoopIndexSwitch_1a = GraphEditSwitchs_5.Link( OInitLoopIndex , ISwitch_1a ) + + LInitLoopIndexSwitcha = GraphEditSwitchs_5.Link( OInitLoopIndex , ISwitcha ) + + LInitLoopMinEndOfInitLoopMin = GraphEditSwitchs_5.Link( OInitLoopMin , IEndOfInitLoopMin ) + + LInitLoopMaxEndOfInitLoopMax = GraphEditSwitchs_5.Link( OInitLoopMax , IEndOfInitLoopMax ) + + LSwitchOddIsOddGate = GraphEditSwitchs_5.Link( OSwitchOdd , IIsOddGate ) + + LSwitchaIsOdda = GraphEditSwitchs_5.Link( OSwitcha , IIsOdda ) + + LSwitchDefaultEndOfSwitchDefault = GraphEditSwitchs_5.Link( OSwitchDefault , IEndOfSwitchDefault ) + + LEndOfSwitchaEndOfInitLoopIndex = GraphEditSwitchs_5.Link( OEndOfSwitcha , IEndOfInitLoopIndex ) + + LSwitch_1EvenIsEvenGate = GraphEditSwitchs_5.Link( OSwitch_1Even , IIsEvenGate ) + + LSwitch_1aIsEvena = GraphEditSwitchs_5.Link( OSwitch_1a , IIsEvena ) + + LSwitch_1DefaultEndSwitchDefault = GraphEditSwitchs_5.Link( OSwitch_1Default , IEndSwitchDefault ) + + LEndSwitchGateEndOfInitLoopGate = GraphEditSwitchs_5.Link( OEndSwitchGate , IEndOfInitLoopGate ) + + # Input datas + IInitLoopIndex.Input( 0 ) + IInitLoopMin.Input( 0 ) + IInitLoopMax.Input( 20 ) + + # Output Ports of the graph + #OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) + #OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) + #OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) + #OSwitchEven = Switch.GetOutPort( 'Even' ) + #OSwitch_1Odd = Switch_1.GetOutPort( 'Odd' ) + #OEndSwitcha = EndSwitch.GetOutPort( 'a' ) + return GraphEditSwitchs_5 + + +GraphEditSwitchs_5 = DefGraphEditSwitchs_5() diff --git a/examples/GraphEditGraphSwitchs_5.xml b/examples/GraphEditGraphSwitchs_5.xml new file mode 100644 index 0000000..a90ad55 --- /dev/null +++ b/examples/GraphEditGraphSwitchs_5.xml @@ -0,0 +1,475 @@ + + + + + +? + ? + GraphEditSwitchs_5 + 1 + ? + +GraphEditSwitchs_5 + + +long + InitLoop__Index + +long + InitLoop__Min + +long + InitLoop__Max + + +long + EndOfInitLoop__Index + +long + EndOfInitLoop__Min + +long + EndOfInitLoop__Max + +int + Switch__Even + +long + Switch_1__Odd + +long + EndSwitch__a + + + 3/2/2005 - 16:14:10 + 24/2/2005 - 14:34:28 + 2.0 + ? + ? + ? + 0 + 0 + + +? + ? + IsOdd + 3 + ? + +IsOdd + + +long + a + + +long + a + + + +IsOdd + + + + + + 24/2/2005 - 14:34:28 + 24/2/2005 - 14:34:28 + 2.0 + ? + ? + Python function + 393 + 67 + +? + ? + IsEven + 3 + ? + +IsEven + + +long + a + + +long + a + + + +IsEven + + + + + + 24/2/2005 - 14:34:28 + 24/2/2005 - 14:34:28 + 2.0 + ? + ? + Python function + 408 + 343 + +? + ? + InitLoop + 4 + EndOfInitLoop + +InitLoop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +InitLoop + + + +MoreLoop + + + + + + + +NextLoop + + + + 24/2/2005 - 14:34:28 + 24/2/2005 - 14:34:28 + 2.0 + ? + ? + Compute Node + 10 + 248 + +? + ? + EndOfInitLoop + 5 + InitLoop + +EndOfInitLoop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +? + + 24/2/2005 - 14:34:28 + 24/2/2005 - 14:34:28 + 2.0 + ? + ? + Compute Node + 823 + 259 + +? + ? + Switch + 6 + EndOfSwitch + +Switch + + +long + a + + +long + Odd + +int + Even + +int + a + + + +Switch + + + + + + 24/2/2005 - 14:34:28 + 24/2/2005 - 14:34:28 + 2.0 + ? + ? + Compute Node + 199 + 132 + +? + ? + EndOfSwitch + 7 + Switch + +EndOfSwitch + + +long + a + + +long + a + + + +? + + 24/2/2005 - 14:34:28 + 24/2/2005 - 14:34:28 + 2.0 + ? + ? + Compute Node + 584 + 172 + +? + ? + Switch_1 + 6 + EndSwitch + +Switch_1 + + +long + a + + +long + Odd + +int + Even + +int + a + + + +Switch + + + + + + 24/2/2005 - 14:34:28 + 24/2/2005 - 14:34:28 + 2.0 + ? + ? + Compute Node + 201 + 388 + +? + ? + EndSwitch + 7 + Switch_1 + +EndSwitch + + +long + a + + +long + a + + + +? + + 24/2/2005 - 14:34:28 + 24/2/2005 - 14:34:28 + 2.0 + ? + ? + Compute Node + 608 + 430 + + +IsOdd + a + EndOfSwitch + a + + +IsEven + a + EndSwitch + a + + +InitLoop + DoLoop + EndOfInitLoop + DoLoop + + +InitLoop + Index + Switch_1 + a + + +InitLoop + Index + Switch + a + + +InitLoop + Min + EndOfInitLoop + Min + + +InitLoop + Max + EndOfInitLoop + Max + + +EndOfInitLoop + DoLoop + InitLoop + DoLoop + + +Switch + Odd + IsOdd + Gate + + +Switch + a + IsOdd + a + + +Switch + Default + EndOfSwitch + Default + + +EndOfSwitch + a + EndOfInitLoop + Index + + +Switch_1 + Even + IsEven + Gate + + +Switch_1 + a + IsEven + a + + +Switch_1 + Default + EndSwitch + Default + + +EndSwitch + Gate + EndOfInitLoop + Gate + + + +GraphEditSwitchs_5 + InitLoop__Index + InitLoop + Index + +3 + 0 + + +GraphEditSwitchs_5 + InitLoop__Min + InitLoop + Min + +3 + 0 + + +GraphEditSwitchs_5 + InitLoop__Max + InitLoop + Max + +3 + 20 + diff --git a/examples/GraphEmbeddedComponents.py b/examples/GraphEmbeddedComponents.py index 01ac324..40827a2 100644 --- a/examples/GraphEmbeddedComponents.py +++ b/examples/GraphEmbeddedComponents.py @@ -1,19 +1,19 @@ -# Generated python file of Graph GraphEssai3 +# Generated python file of Graph GraphEmbeddedComponents from SuperV import * -# Graph creation of GraphEssai3 -def DefGraphEssai3() : - GraphEssai3 = Graph( 'GraphEssai3' ) - GraphEssai3.SetName( 'GraphEssai3' ) - GraphEssai3.SetAuthor( '' ) - GraphEssai3.SetComment( '' ) - GraphEssai3.Coords( 0 , 0 ) +# Graph creation of GraphEmbeddedComponents +def DefGraphEmbeddedComponents() : + GraphEmbeddedComponents = Graph( 'GraphEmbeddedComponents' ) + GraphEmbeddedComponents.SetName( 'GraphEmbeddedComponents' ) + GraphEmbeddedComponents.SetAuthor( '' ) + GraphEmbeddedComponents.SetComment( '' ) + GraphEmbeddedComponents.Coords( 0 , 0 ) # Creation of Factory Nodes - Add = GraphEssai3.FNode( 'AddComponent' , 'AddComponent' , 'Add' ) + Add = GraphEmbeddedComponents.FNode( 'AddComponent' , 'AddComponent' , 'Add' ) Add.SetName( 'Add' ) Add.SetAuthor( '' ) Add.SetContainer( 'localhost/FactoryServer' ) @@ -26,7 +26,7 @@ def DefGraphEssai3() : OAddz = Add.GetOutPort( 'z' ) OAddGate = Add.GetOutPort( 'Gate' ) - Sub = GraphEssai3.FNode( 'SubComponent' , 'SubComponent' , 'Sub' ) + Sub = GraphEmbeddedComponents.FNode( 'SubComponent' , 'SubComponent' , 'Sub' ) Sub.SetName( 'Sub' ) Sub.SetAuthor( '' ) Sub.SetContainer( 'localhost/FactoryServer' ) @@ -38,7 +38,7 @@ def DefGraphEssai3() : OSubz = Sub.GetOutPort( 'z' ) OSubGate = Sub.GetOutPort( 'Gate' ) - Mul = GraphEssai3.FNode( 'MulComponent' , 'MulComponent' , 'Mul' ) + Mul = GraphEmbeddedComponents.FNode( 'MulComponent' , 'MulComponent' , 'Mul' ) Mul.SetName( 'Mul' ) Mul.SetAuthor( '' ) Mul.SetContainer( 'localhost/FactoryServer' ) @@ -50,7 +50,7 @@ def DefGraphEssai3() : OMulz = Mul.GetOutPort( 'z' ) OMulGate = Mul.GetOutPort( 'Gate' ) - Div = GraphEssai3.FNode( 'DivComponent' , 'DivComponent' , 'Div' ) + Div = GraphEmbeddedComponents.FNode( 'DivComponent' , 'DivComponent' , 'Div' ) Div.SetName( 'Div' ) Div.SetAuthor( '' ) Div.SetContainer( 'localhost/FactoryServer' ) @@ -62,7 +62,7 @@ def DefGraphEssai3() : ODivz = Div.GetOutPort( 'z' ) ODivGate = Div.GetOutPort( 'Gate' ) - Addition = GraphEssai3.FNode( 'AddComponent' , 'AddComponent' , 'Addition' ) + Addition = GraphEmbeddedComponents.FNode( 'AddComponent' , 'AddComponent' , 'Addition' ) Addition.SetName( 'Addition' ) Addition.SetAuthor( '' ) Addition.SetContainer( 'localhost/AdditionServer' ) @@ -72,7 +72,7 @@ def DefGraphEssai3() : OAdditionAdder = Addition.GetOutPort( 'Adder' ) OAdditionGate = Addition.GetOutPort( 'Gate' ) - Addition_1 = GraphEssai3.FNode( 'AddComponent' , 'AddComponent' , 'Addition' ) + Addition_1 = GraphEmbeddedComponents.FNode( 'AddComponent' , 'AddComponent' , 'Addition' ) Addition_1.SetName( 'Addition_1' ) Addition_1.SetAuthor( '' ) Addition_1.SetContainer( 'localhost/Addition_1Server' ) @@ -94,7 +94,7 @@ def DefGraphEssai3() : AddAndCompare_ServiceinStreamParameter = [] AddAndCompare_ServiceoutStreamParameter = [] AddAndCompare_Service = SALOME_ModuleCatalog.Service( 'AddAndCompare' , AddAndCompare_ServiceinParameter , AddAndCompare_ServiceoutParameter , AddAndCompare_ServiceinStreamParameter , AddAndCompare_ServiceoutStreamParameter , 0 , 0 ) - AddAndCompare = GraphEssai3.CNode( AddAndCompare_Service ) + AddAndCompare = GraphEmbeddedComponents.CNode( AddAndCompare_Service ) AddAndCompare.SetName( 'AddAndCompare' ) AddAndCompare.SetAuthor( '' ) AddAndCompare.SetComment( 'Python function' ) @@ -109,29 +109,29 @@ def DefGraphEssai3() : OAddAndCompareGate = AddAndCompare.GetOutPort( 'Gate' ) # Creation of Links - LAddFuncValueMulx = GraphEssai3.Link( OAddFuncValue , IMulx ) + LAddFuncValueMulx = GraphEmbeddedComponents.Link( OAddFuncValue , IMulx ) - LAddFuncValueAddAndComparex = GraphEssai3.Link( OAddFuncValue , IAddAndComparex ) + LAddFuncValueAddAndComparex = GraphEmbeddedComponents.Link( OAddFuncValue , IAddAndComparex ) LAddFuncValueAddAndComparex.AddCoord( 1 , 195 , 108 ) LAddFuncValueAddAndComparex.AddCoord( 2 , 195 , 233 ) - LAddzSubx = GraphEssai3.Link( OAddz , ISubx ) + LAddzSubx = GraphEmbeddedComponents.Link( OAddz , ISubx ) LAddzSubx.AddCoord( 1 , 187 , 459 ) LAddzSubx.AddCoord( 2 , 186 , 262 ) - LAddzAddAndComparey = GraphEssai3.Link( OAddz , IAddAndComparey ) + LAddzAddAndComparey = GraphEmbeddedComponents.Link( OAddz , IAddAndComparey ) LAddzAddAndComparey.AddCoord( 1 , 187 , 139 ) LAddzAddAndComparey.AddCoord( 2 , 186 , 261 ) - LSubzDivx = GraphEssai3.Link( OSubz , IDivx ) + LSubzDivx = GraphEmbeddedComponents.Link( OSubz , IDivx ) LSubzDivx.AddCoord( 1 , 598 , 203 ) LSubzDivx.AddCoord( 2 , 598 , 457 ) - LMulzDivy = GraphEssai3.Link( OMulz , IDivy ) + LMulzDivy = GraphEmbeddedComponents.Link( OMulz , IDivy ) - LAdditionAdderAddAndCompareAdder = GraphEssai3.Link( OAdditionAdder , IAddAndCompareAdder ) + LAdditionAdderAddAndCompareAdder = GraphEmbeddedComponents.Link( OAdditionAdder , IAddAndCompareAdder ) - LAddition_1AdderAddAndCompareanOtherAdder = GraphEssai3.Link( OAddition_1Adder , IAddAndCompareanOtherAdder ) + LAddition_1AdderAddAndCompareanOtherAdder = GraphEmbeddedComponents.Link( OAddition_1Adder , IAddAndCompareanOtherAdder ) LAddition_1AdderAddAndCompareanOtherAdder.AddCoord( 1 , 215 , 168 ) LAddition_1AdderAddAndCompareanOtherAdder.AddCoord( 2 , 214 , 407 ) @@ -145,7 +145,7 @@ def DefGraphEssai3() : #ODivz = Div.GetOutPort( 'z' ) #OAddAndCompareFuncValue = AddAndCompare.GetOutPort( 'FuncValue' ) #OAddAndComparez = AddAndCompare.GetOutPort( 'z' ) - return GraphEssai3 + return GraphEmbeddedComponents -GraphEssai3 = DefGraphEssai3() +GraphEmbeddedComponents = DefGraphEmbeddedComponents() diff --git a/examples/GraphEmbeddedComponents.xml b/examples/GraphEmbeddedComponents.xml index ab9c151..5a2f962 100644 --- a/examples/GraphEmbeddedComponents.xml +++ b/examples/GraphEmbeddedComponents.xml @@ -1,365 +1,461 @@ - - - -? + + + + ? ? - GraphEssai3 + GraphEmbeddedComponents 1 ? -GraphEssai3 + GraphEmbeddedComponents - -double - Add__x -double - Add__y + double + Add__x + + + double + Add__y + -double - Sub__y + double + Sub__y + -double - Mul__y + double + Mul__y + + - -double - Div__z -double - AddAndCompare__FuncValue + double + Div__z + + + double + AddAndCompare__FuncValue + -double - AddAndCompare__z + double + AddAndCompare__z + + + 11/3/2003 - 10:59:37 - 11/1/2005 - 16:42:5 + 3/8/2005 - 14:58:47 1.04 ? ? ? 0 - 0 + 0 + + - -AddComponent + + AddComponent AddComponent Add 0 ? -Add + Add - -double - x -double - y + double + x + + + double + y + + - -double - FuncValue -double - z + double + FuncValue + + + double + z + + + - 11/1/2005 - 16:42:5 - 11/1/2005 - 16:42:5 + 3/8/2005 - 14:58:47 + 3/8/2005 - 14:58:47 1.04 ? localhost/FactoryServer Add from AddComponent 1 - 152 + 152 + -SubComponent + SubComponent SubComponent Sub 0 ? -Sub + Sub - -double - x -double - y + double + x + + + double + y + + - -double - z + + double + z + + + - 11/1/2005 - 16:42:5 - 11/1/2005 - 16:42:5 + 3/8/2005 - 14:58:47 + 3/8/2005 - 14:58:47 1.04 ? localhost/FactoryServer Sub from SubComponent 412 - 377 + 377 + -MulComponent + MulComponent MulComponent Mul 0 ? -Mul + Mul - -double - x -double - y + double + x + + + double + y + + - -double - z + + double + z + + + - 11/1/2005 - 16:42:5 - 11/1/2005 - 16:42:5 + 3/8/2005 - 14:58:47 + 3/8/2005 - 14:58:47 1.04 ? localhost/FactoryServer Mul from MulComponent 412 - 152 + 152 + -DivComponent + DivComponent DivComponent Div 0 ? -Div + Div - -double - x -double - y + double + x + + + double + y + + - -double - z + + double + z + + + - 11/1/2005 - 16:42:5 - 11/1/2005 - 16:42:5 + 3/8/2005 - 14:58:47 + 3/8/2005 - 14:58:47 1.04 ? localhost/FactoryServer Div from DivComponent 622 - 124 + 124 + -AddComponent + AddComponent AddComponent Addition 0 ? -Addition + Addition - -Adder - Adder + + Adder + Adder + + + - 11/1/2005 - 16:42:5 - 11/1/2005 - 16:42:5 + 3/8/2005 - 14:58:47 + 3/8/2005 - 14:58:47 1.04 ? localhost/AdditionServer Addition from AddComponent 0 - 0 + 0 + -AddComponent + AddComponent AddComponent Addition_1 0 ? -Addition + Addition - -Adder - Adder + + Adder + Adder + + + - 11/1/2005 - 16:42:5 - 11/1/2005 - 16:42:5 + 3/8/2005 - 14:58:47 + 3/8/2005 - 14:58:47 1.04 ? localhost/Addition_1Server Addition from AddComponent 4 - 327 + 327 + -? + ? ? AddAndCompare 2 ? -AddAndCompare + AddAndCompare - -Adder - Adder -double - x + Adder + Adder + + + double + x + -double - y + double + y + -Adder - anOtherAdder + Adder + anOtherAdder + + - -double - FuncValue -double - z + double + FuncValue + + + double + z + + + - 11/1/2005 - 16:42:5 - 11/1/2005 - 16:42:5 + 3/8/2005 - 14:58:47 + 3/8/2005 - 14:58:47 1.04 ? ? Python function 233 - 0 + 0 + + - -Add + + Add FuncValue Mul x - + + -Add + Add FuncValue AddAndCompare x - -195 - 108 -195 - 233 + 195 + 108 + + + 195 + 233 + + + -Add + Add z Sub x - -187 - 459 -186 - 262 + 187 + 459 + + + 186 + 262 + + + -Add + Add z AddAndCompare y - -187 - 139 -186 - 261 + 187 + 139 + + + 186 + 261 + + + -Sub + Sub z Div x - -598 - 203 -598 - 457 + 598 + 203 + + + 598 + 457 + + + -Mul + Mul z Div y - + + -Addition + Addition Adder AddAndCompare Adder - + + -Addition_1 + Addition_1 Adder AddAndCompare anOtherAdder - -215 - 168 -214 - 407 + 215 + 168 + + + 214 + 407 + + + + - -GraphEssai3 + + GraphEmbeddedComponents Add__x Add x -7 - 1 - + 7 + 1 + + + -GraphEssai3 + GraphEmbeddedComponents Add__y Add y -7 - 2 - + 7 + 2 + + + -GraphEssai3 + GraphEmbeddedComponents Sub__y Sub y -7 - 3 - + 7 + 3 + + + -GraphEssai3 + GraphEmbeddedComponents Mul__y Mul y -7 - 4 - + 7 + 4 + + + + + + + diff --git a/examples/GraphEmbeddedComponentsCrash.py b/examples/GraphEmbeddedComponentsCrash.py new file mode 100644 index 0000000..13662ea --- /dev/null +++ b/examples/GraphEmbeddedComponentsCrash.py @@ -0,0 +1,155 @@ + +# Generated python file of Graph GraphEmbeddedComponentsCrash + +from SuperV import * + +# Graph creation of GraphEmbeddedComponentsCrash +def DefGraphEmbeddedComponentsCrash() : + GraphEmbeddedComponentsCrash = Graph( 'GraphEmbeddedComponentsCrash' ) + GraphEmbeddedComponentsCrash.SetName( 'GraphEmbeddedComponentsCrash' ) + GraphEmbeddedComponentsCrash.SetAuthor( '' ) + GraphEmbeddedComponentsCrash.SetComment( '' ) + GraphEmbeddedComponentsCrash.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + Add = GraphEmbeddedComponentsCrash.FNode( 'AddComponent' , 'AddComponent' , 'Add' ) + Add.SetName( 'Add' ) + Add.SetAuthor( '' ) + Add.SetContainer( 'localhost/FactoryServer' ) + Add.SetComment( 'Add from AddComponent' ) + Add.Coords( 1 , 152 ) + IAddx = Add.GetInPort( 'x' ) + IAddy = Add.GetInPort( 'y' ) + IAddGate = Add.GetInPort( 'Gate' ) + OAddFuncValue = Add.GetOutPort( 'FuncValue' ) + OAddz = Add.GetOutPort( 'z' ) + OAddGate = Add.GetOutPort( 'Gate' ) + + Sub = GraphEmbeddedComponentsCrash.FNode( 'SubComponent' , 'SubComponent' , 'Sub' ) + Sub.SetName( 'Sub' ) + Sub.SetAuthor( '' ) + Sub.SetContainer( 'localhost/FactoryServer' ) + Sub.SetComment( 'Sub from SubComponent' ) + Sub.Coords( 477 , 381 ) + ISubx = Sub.GetInPort( 'x' ) + ISuby = Sub.GetInPort( 'y' ) + ISubGate = Sub.GetInPort( 'Gate' ) + OSubz = Sub.GetOutPort( 'z' ) + OSubGate = Sub.GetOutPort( 'Gate' ) + + Mul = GraphEmbeddedComponentsCrash.FNode( 'MulComponent' , 'MulComponent' , 'Mul' ) + Mul.SetName( 'Mul' ) + Mul.SetAuthor( '' ) + Mul.SetContainer( 'localhost/FactoryServer' ) + Mul.SetComment( 'Mul from MulComponent' ) + Mul.Coords( 480 , 152 ) + IMulx = Mul.GetInPort( 'x' ) + IMuly = Mul.GetInPort( 'y' ) + IMulGate = Mul.GetInPort( 'Gate' ) + OMulz = Mul.GetOutPort( 'z' ) + OMulGate = Mul.GetOutPort( 'Gate' ) + + Div = GraphEmbeddedComponentsCrash.FNode( 'DivComponent' , 'DivComponent' , 'Div' ) + Div.SetName( 'Div' ) + Div.SetAuthor( '' ) + Div.SetContainer( 'localhost/FactoryServer' ) + Div.SetComment( 'Div from DivComponent' ) + Div.Coords( 714 , 136 ) + IDivx = Div.GetInPort( 'x' ) + IDivy = Div.GetInPort( 'y' ) + IDivGate = Div.GetInPort( 'Gate' ) + ODivz = Div.GetOutPort( 'z' ) + ODivGate = Div.GetOutPort( 'Gate' ) + + Addition = GraphEmbeddedComponentsCrash.FNode( 'AddComponent' , 'AddComponent' , 'Addition' ) + Addition.SetName( 'Addition' ) + Addition.SetAuthor( '' ) + Addition.SetContainer( 'localhost/AdditionServer' ) + Addition.SetComment( 'Addition from AddComponent' ) + Addition.Coords( 0 , 0 ) + IAdditionGate = Addition.GetInPort( 'Gate' ) + OAdditionAdder = Addition.GetOutPort( 'Adder' ) + OAdditionGate = Addition.GetOutPort( 'Gate' ) + + Addition_1 = GraphEmbeddedComponentsCrash.FNode( 'AddComponent' , 'AddComponent' , 'Addition' ) + Addition_1.SetName( 'Addition_1' ) + Addition_1.SetAuthor( '' ) + Addition_1.SetContainer( 'localhost/Addition_1Server' ) + Addition_1.SetComment( 'Addition from AddComponent' ) + Addition_1.Coords( 4 , 327 ) + IAddition_1Gate = Addition_1.GetInPort( 'Gate' ) + OAddition_1Adder = Addition_1.GetOutPort( 'Adder' ) + OAddition_1Gate = Addition_1.GetOutPort( 'Gate' ) + + # Creation of Computing Nodes + AddAndCompare_ServiceinParameter = [] + AddAndCompare_ServiceinParameter.append( SALOME_ModuleCatalog.ServicesParameter( 'Adder' , 'Adder' ) ) + AddAndCompare_ServiceinParameter.append( SALOME_ModuleCatalog.ServicesParameter( 'double' , 'x' ) ) + AddAndCompare_ServiceinParameter.append( SALOME_ModuleCatalog.ServicesParameter( 'double' , 'y' ) ) + AddAndCompare_ServiceinParameter.append( SALOME_ModuleCatalog.ServicesParameter( 'Adder' , 'anOtherAdder' ) ) + AddAndCompare_ServiceoutParameter = [] + AddAndCompare_ServiceoutParameter.append( SALOME_ModuleCatalog.ServicesParameter( 'double' , 'FuncValue' ) ) + AddAndCompare_ServiceoutParameter.append( SALOME_ModuleCatalog.ServicesParameter( 'double' , 'z' ) ) + AddAndCompare_ServiceinStreamParameter = [] + AddAndCompare_ServiceoutStreamParameter = [] + AddAndCompare_Service = SALOME_ModuleCatalog.Service( 'AddAndCompare' , AddAndCompare_ServiceinParameter , AddAndCompare_ServiceoutParameter , AddAndCompare_ServiceinStreamParameter , AddAndCompare_ServiceoutStreamParameter , 0 , 0 ) + AddAndCompare = GraphEmbeddedComponentsCrash.CNode( AddAndCompare_Service ) + AddAndCompare.SetName( 'AddAndCompare' ) + AddAndCompare.SetAuthor( '' ) + AddAndCompare.SetComment( 'Python function' ) + AddAndCompare.Coords( 233 , 0 ) + IAddAndCompareAdder = AddAndCompare.GetInPort( 'Adder' ) + IAddAndComparex = AddAndCompare.GetInPort( 'x' ) + IAddAndComparey = AddAndCompare.GetInPort( 'y' ) + IAddAndCompareanOtherAdder = AddAndCompare.GetInPort( 'anOtherAdder' ) + IAddAndCompareGate = AddAndCompare.GetInPort( 'Gate' ) + OAddAndCompareFuncValue = AddAndCompare.GetOutPort( 'FuncValue' ) + OAddAndComparez = AddAndCompare.GetOutPort( 'z' ) + OAddAndCompareGate = AddAndCompare.GetOutPort( 'Gate' ) + + # Creation of Links + LAddFuncValueMulx = GraphEmbeddedComponentsCrash.Link( OAddFuncValue , IMulx ) + + LAddFuncValueAddAndComparex = GraphEmbeddedComponentsCrash.Link( OAddFuncValue , IAddAndComparex ) + LAddFuncValueAddAndComparex.AddCoord( 1 , 195 , 108 ) + LAddFuncValueAddAndComparex.AddCoord( 2 , 195 , 233 ) + + LAddzSubx = GraphEmbeddedComponentsCrash.Link( OAddz , ISubx ) + LAddzSubx.AddCoord( 1 , 187 , 459 ) + LAddzSubx.AddCoord( 2 , 186 , 262 ) + + LAddzAddAndComparey = GraphEmbeddedComponentsCrash.Link( OAddz , IAddAndComparey ) + LAddzAddAndComparey.AddCoord( 1 , 187 , 139 ) + LAddzAddAndComparey.AddCoord( 2 , 186 , 261 ) + + LSubzDivx = GraphEmbeddedComponentsCrash.Link( OSubz , IDivx ) + LSubzDivx.AddCoord( 1 , 670 , 206 ) + LSubzDivx.AddCoord( 2 , 680 , 447 ) + + LMulzDivy = GraphEmbeddedComponentsCrash.Link( OMulz , IDivy ) + + LAdditionAdderAddAndCompareAdder = GraphEmbeddedComponentsCrash.Link( OAdditionAdder , IAddAndCompareAdder ) + + LAddition_1AdderAddAndCompareanOtherAdder = GraphEmbeddedComponentsCrash.Link( OAddition_1Adder , IAddAndCompareanOtherAdder ) + LAddition_1AdderAddAndCompareanOtherAdder.AddCoord( 1 , 215 , 168 ) + LAddition_1AdderAddAndCompareanOtherAdder.AddCoord( 2 , 214 , 407 ) + + LAddAndCompareGateMulGate = GraphEmbeddedComponentsCrash.Link( OAddAndCompareGate , IMulGate ) + + LAddAndCompareGateSubGate = GraphEmbeddedComponentsCrash.Link( OAddAndCompareGate , ISubGate ) + + # Input datas + IAddx.Input( 1 ) + IAddy.Input( 2 ) + ISuby.Input( 3 ) + IMuly.Input( 4 ) + + # Output Ports of the graph + #ODivz = Div.GetOutPort( 'z' ) + #OAddAndCompareFuncValue = AddAndCompare.GetOutPort( 'FuncValue' ) + #OAddAndComparez = AddAndCompare.GetOutPort( 'z' ) + return GraphEmbeddedComponentsCrash + + +GraphEmbeddedComponentsCrash = DefGraphEmbeddedComponentsCrash() diff --git a/examples/GraphEmbeddedComponentsCrash.xml b/examples/GraphEmbeddedComponentsCrash.xml new file mode 100644 index 0000000..5d752af --- /dev/null +++ b/examples/GraphEmbeddedComponentsCrash.xml @@ -0,0 +1,475 @@ + + + + + + ? + ? + GraphEmbeddedComponentsCrash + 1 + ? + + GraphEmbeddedComponentsCrash + + + 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 + 3/8/2005 - 15:53:13 + 1.04 + ? + ? + ? + 0 + 0 + + + + + AddComponent + AddComponent + Add + 0 + ? + + Add + + + double + x + + + double + y + + + + + double + FuncValue + + + double + z + + + + + + 3/8/2005 - 15:52:50 + 3/8/2005 - 15:52:50 + 1.04 + ? + localhost/FactoryServer + Add from AddComponent + 1 + 152 + + + SubComponent + SubComponent + Sub + 0 + ? + + Sub + + + double + x + + + double + y + + + + + double + z + + + + + + 3/8/2005 - 15:52:50 + 3/8/2005 - 15:52:50 + 1.04 + ? + localhost/FactoryServer + Sub from SubComponent + 477 + 381 + + + MulComponent + MulComponent + Mul + 0 + ? + + Mul + + + double + x + + + double + y + + + + + double + z + + + + + + 3/8/2005 - 15:52:50 + 3/8/2005 - 15:52:50 + 1.04 + ? + localhost/FactoryServer + Mul from MulComponent + 480 + 152 + + + DivComponent + DivComponent + Div + 0 + ? + + Div + + + double + x + + + double + y + + + + + double + z + + + + + + 3/8/2005 - 15:52:50 + 3/8/2005 - 15:52:50 + 1.04 + ? + localhost/FactoryServer + Div from DivComponent + 714 + 136 + + + AddComponent + AddComponent + Addition + 0 + ? + + Addition + + + + Adder + Adder + + + + + + 3/8/2005 - 15:52:50 + 3/8/2005 - 15:52:50 + 1.04 + ? + localhost/AdditionServer + Addition from AddComponent + 0 + 0 + + + AddComponent + AddComponent + Addition_1 + 0 + ? + + Addition + + + + Adder + Adder + + + + + + 3/8/2005 - 15:52:50 + 3/8/2005 - 15:52:50 + 1.04 + ? + localhost/Addition_1Server + Addition from AddComponent + 4 + 327 + + + ? + ? + AddAndCompare + 2 + ? + + AddAndCompare + + + Adder + Adder + + + double + x + + + double + y + + + Adder + anOtherAdder + + + + + double + FuncValue + + + double + z + + + + + + 3/8/2005 - 15:52:50 + 3/8/2005 - 15:52:50 + 1.04 + ? + ? + Python function + 233 + 0 + + + + + Add + FuncValue + Mul + x + + + + Add + FuncValue + AddAndCompare + x + + + 195 + 108 + + + 195 + 233 + + + + + Add + z + Sub + x + + + 187 + 459 + + + 186 + 262 + + + + + Add + z + AddAndCompare + y + + + 187 + 139 + + + 186 + 261 + + + + + Sub + z + Div + x + + + 670 + 206 + + + 680 + 447 + + + + + Mul + z + Div + y + + + + Addition + Adder + AddAndCompare + Adder + + + + Addition_1 + Adder + AddAndCompare + anOtherAdder + + + 215 + 168 + + + 214 + 407 + + + + + AddAndCompare + Gate + Mul + Gate + + + + AddAndCompare + Gate + Sub + Gate + + + + + + GraphEmbeddedComponentsCrash + Add__x + Add + x + + 7 + 1 + + + + + GraphEmbeddedComponentsCrash + Add__y + Add + y + + 7 + 2 + + + + + GraphEmbeddedComponentsCrash + Sub__y + Sub + y + + 7 + 3 + + + + + GraphEmbeddedComponentsCrash + Mul__y + Mul + y + + 7 + 4 + + + + + + + diff --git a/examples/GraphEmbeddedComponentsCrash1.py b/examples/GraphEmbeddedComponentsCrash1.py new file mode 100644 index 0000000..fddabda --- /dev/null +++ b/examples/GraphEmbeddedComponentsCrash1.py @@ -0,0 +1,151 @@ + +# Generated python file of Graph GraphEmbeddedComponentsCrash1 + +from SuperV import * + +# Graph creation of GraphEmbeddedComponentsCrash1 +def DefGraphEmbeddedComponentsCrash1() : + GraphEmbeddedComponentsCrash1 = Graph( 'GraphEmbeddedComponentsCrash1' ) + GraphEmbeddedComponentsCrash1.SetName( 'GraphEmbeddedComponentsCrash1' ) + GraphEmbeddedComponentsCrash1.SetAuthor( '' ) + GraphEmbeddedComponentsCrash1.SetComment( '' ) + GraphEmbeddedComponentsCrash1.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + Add = GraphEmbeddedComponentsCrash1.FNode( 'AddComponent' , 'AddComponent' , 'Add' ) + Add.SetName( 'Add' ) + Add.SetAuthor( '' ) + Add.SetContainer( 'localhost/SuperVisionContainer' ) + Add.SetComment( 'Add from AddComponent' ) + Add.Coords( 1 , 152 ) + IAddx = Add.GetInPort( 'x' ) + IAddy = Add.GetInPort( 'y' ) + IAddGate = Add.GetInPort( 'Gate' ) + OAddFuncValue = Add.GetOutPort( 'FuncValue' ) + OAddz = Add.GetOutPort( 'z' ) + OAddGate = Add.GetOutPort( 'Gate' ) + + Sub = GraphEmbeddedComponentsCrash1.FNode( 'SubComponent' , 'SubComponent' , 'Sub' ) + Sub.SetName( 'Sub' ) + Sub.SetAuthor( '' ) + Sub.SetContainer( 'localhost/SuperVisionContainer' ) + Sub.SetComment( 'Sub from SubComponent' ) + Sub.Coords( 477 , 381 ) + ISubx = Sub.GetInPort( 'x' ) + ISuby = Sub.GetInPort( 'y' ) + ISubGate = Sub.GetInPort( 'Gate' ) + OSubz = Sub.GetOutPort( 'z' ) + OSubGate = Sub.GetOutPort( 'Gate' ) + + Mul = GraphEmbeddedComponentsCrash1.FNode( 'MulComponent' , 'MulComponent' , 'Mul' ) + Mul.SetName( 'Mul' ) + Mul.SetAuthor( '' ) + Mul.SetContainer( 'localhost/SuperVisionContainer' ) + Mul.SetComment( 'Mul from MulComponent' ) + Mul.Coords( 480 , 152 ) + IMulx = Mul.GetInPort( 'x' ) + IMuly = Mul.GetInPort( 'y' ) + IMulGate = Mul.GetInPort( 'Gate' ) + OMulz = Mul.GetOutPort( 'z' ) + OMulGate = Mul.GetOutPort( 'Gate' ) + + Div = GraphEmbeddedComponentsCrash1.FNode( 'DivComponent' , 'DivComponent' , 'Div' ) + Div.SetName( 'Div' ) + Div.SetAuthor( '' ) + Div.SetContainer( 'localhost/SuperVisionContainer' ) + Div.SetComment( 'Div from DivComponent' ) + Div.Coords( 714 , 136 ) + IDivx = Div.GetInPort( 'x' ) + IDivy = Div.GetInPort( 'y' ) + IDivGate = Div.GetInPort( 'Gate' ) + ODivz = Div.GetOutPort( 'z' ) + ODivGate = Div.GetOutPort( 'Gate' ) + + Addition = GraphEmbeddedComponentsCrash1.FNode( 'AddComponent' , 'AddComponent' , 'Addition' ) + Addition.SetName( 'Addition' ) + Addition.SetAuthor( '' ) + Addition.SetContainer( 'localhost/SuperVisionContainer' ) + Addition.SetComment( 'Addition from AddComponent' ) + Addition.Coords( 0 , 0 ) + IAdditionGate = Addition.GetInPort( 'Gate' ) + OAdditionAdder = Addition.GetOutPort( 'Adder' ) + OAdditionGate = Addition.GetOutPort( 'Gate' ) + + Addition_1 = GraphEmbeddedComponentsCrash1.FNode( 'AddComponent' , 'AddComponent' , 'Addition' ) + Addition_1.SetName( 'Addition_1' ) + Addition_1.SetAuthor( '' ) + Addition_1.SetContainer( 'localhost/SuperVisionContainer' ) + Addition_1.SetComment( 'Addition from AddComponent' ) + Addition_1.Coords( 4 , 327 ) + IAddition_1Gate = Addition_1.GetInPort( 'Gate' ) + OAddition_1Adder = Addition_1.GetOutPort( 'Adder' ) + OAddition_1Gate = Addition_1.GetOutPort( 'Gate' ) + + # Creation of Computing Nodes + AddAndCompare_ServiceinParameter = [] + AddAndCompare_ServiceinParameter.append( SALOME_ModuleCatalog.ServicesParameter( 'Adder' , 'Adder' ) ) + AddAndCompare_ServiceinParameter.append( SALOME_ModuleCatalog.ServicesParameter( 'double' , 'x' ) ) + AddAndCompare_ServiceinParameter.append( SALOME_ModuleCatalog.ServicesParameter( 'double' , 'y' ) ) + AddAndCompare_ServiceinParameter.append( SALOME_ModuleCatalog.ServicesParameter( 'Adder' , 'anOtherAdder' ) ) + AddAndCompare_ServiceoutParameter = [] + AddAndCompare_ServiceoutParameter.append( SALOME_ModuleCatalog.ServicesParameter( 'double' , 'FuncValue' ) ) + AddAndCompare_ServiceoutParameter.append( SALOME_ModuleCatalog.ServicesParameter( 'double' , 'z' ) ) + AddAndCompare_ServiceinStreamParameter = [] + AddAndCompare_ServiceoutStreamParameter = [] + AddAndCompare_Service = SALOME_ModuleCatalog.Service( 'AddAndCompare' , AddAndCompare_ServiceinParameter , AddAndCompare_ServiceoutParameter , AddAndCompare_ServiceinStreamParameter , AddAndCompare_ServiceoutStreamParameter , 0 , 0 ) + AddAndCompare = GraphEmbeddedComponentsCrash1.CNode( AddAndCompare_Service ) + AddAndCompare.SetName( 'AddAndCompare' ) + AddAndCompare.SetAuthor( '' ) + AddAndCompare.SetComment( 'Python function' ) + AddAndCompare.Coords( 233 , 0 ) + IAddAndCompareAdder = AddAndCompare.GetInPort( 'Adder' ) + IAddAndComparex = AddAndCompare.GetInPort( 'x' ) + IAddAndComparey = AddAndCompare.GetInPort( 'y' ) + IAddAndCompareanOtherAdder = AddAndCompare.GetInPort( 'anOtherAdder' ) + IAddAndCompareGate = AddAndCompare.GetInPort( 'Gate' ) + OAddAndCompareFuncValue = AddAndCompare.GetOutPort( 'FuncValue' ) + OAddAndComparez = AddAndCompare.GetOutPort( 'z' ) + OAddAndCompareGate = AddAndCompare.GetOutPort( 'Gate' ) + + # Creation of Links + LAddFuncValueMulx = GraphEmbeddedComponentsCrash1.Link( OAddFuncValue , IMulx ) + + LAddFuncValueAddAndComparex = GraphEmbeddedComponentsCrash1.Link( OAddFuncValue , IAddAndComparex ) + LAddFuncValueAddAndComparex.AddCoord( 1 , 195 , 108 ) + LAddFuncValueAddAndComparex.AddCoord( 2 , 195 , 233 ) + + LAddzSubx = GraphEmbeddedComponentsCrash1.Link( OAddz , ISubx ) + LAddzSubx.AddCoord( 1 , 187 , 459 ) + LAddzSubx.AddCoord( 2 , 186 , 262 ) + + LAddzAddAndComparey = GraphEmbeddedComponentsCrash1.Link( OAddz , IAddAndComparey ) + LAddzAddAndComparey.AddCoord( 1 , 187 , 139 ) + LAddzAddAndComparey.AddCoord( 2 , 186 , 261 ) + + LSubzDivx = GraphEmbeddedComponentsCrash1.Link( OSubz , IDivx ) + LSubzDivx.AddCoord( 1 , 670 , 206 ) + LSubzDivx.AddCoord( 2 , 680 , 447 ) + + LMulzDivy = GraphEmbeddedComponentsCrash1.Link( OMulz , IDivy ) + + LAdditionAdderAddAndCompareAdder = GraphEmbeddedComponentsCrash1.Link( OAdditionAdder , IAddAndCompareAdder ) + + LAddition_1AdderAddAndCompareanOtherAdder = GraphEmbeddedComponentsCrash1.Link( OAddition_1Adder , IAddAndCompareanOtherAdder ) + LAddition_1AdderAddAndCompareanOtherAdder.AddCoord( 1 , 215 , 168 ) + LAddition_1AdderAddAndCompareanOtherAdder.AddCoord( 2 , 214 , 407 ) + + # Input datas + IAddx.Input( 1 ) + IAddy.Input( 2 ) + ISuby.Input( 3 ) + IMuly.Input( 4 ) + + # Output Ports of the graph + #ODivz = Div.GetOutPort( 'z' ) + #OAddAndCompareFuncValue = AddAndCompare.GetOutPort( 'FuncValue' ) + #OAddAndComparez = AddAndCompare.GetOutPort( 'z' ) + return GraphEmbeddedComponentsCrash1 + + +GraphEmbeddedComponentsCrash1 = DefGraphEmbeddedComponentsCrash1() diff --git a/examples/GraphEmbeddedComponentsCrash1.xml b/examples/GraphEmbeddedComponentsCrash1.xml new file mode 100644 index 0000000..97b63f2 --- /dev/null +++ b/examples/GraphEmbeddedComponentsCrash1.xml @@ -0,0 +1,461 @@ + + + + + + ? + ? + GraphEmbeddedComponentsCrash1 + 1 + ? + + GraphEmbeddedComponentsCrash1 + + + 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 + 5/8/2005 - 11:41:6 + 1.04 + ? + ? + ? + 0 + 0 + + + + + AddComponent + AddComponent + Add + 0 + ? + + Add + + + double + x + + + double + y + + + + + double + FuncValue + + + double + z + + + + + + 5/8/2005 - 11:40:48 + 5/8/2005 - 11:40:48 + 1.04 + ? + localhost/SuperVisionContainer + Add from AddComponent + 1 + 152 + + + SubComponent + SubComponent + Sub + 0 + ? + + Sub + + + double + x + + + double + y + + + + + double + z + + + + + + 5/8/2005 - 11:40:48 + 5/8/2005 - 11:40:48 + 1.04 + ? + localhost/SuperVisionContainer + Sub from SubComponent + 477 + 381 + + + MulComponent + MulComponent + Mul + 0 + ? + + Mul + + + double + x + + + double + y + + + + + double + z + + + + + + 5/8/2005 - 11:40:48 + 5/8/2005 - 11:40:48 + 1.04 + ? + localhost/SuperVisionContainer + Mul from MulComponent + 480 + 152 + + + DivComponent + DivComponent + Div + 0 + ? + + Div + + + double + x + + + double + y + + + + + double + z + + + + + + 5/8/2005 - 11:40:48 + 5/8/2005 - 11:40:48 + 1.04 + ? + localhost/SuperVisionContainer + Div from DivComponent + 714 + 136 + + + AddComponent + AddComponent + Addition + 0 + ? + + Addition + + + + Adder + Adder + + + + + + 5/8/2005 - 11:40:48 + 5/8/2005 - 11:40:48 + 1.04 + ? + localhost/SuperVisionContainer + Addition from AddComponent + 0 + 0 + + + AddComponent + AddComponent + Addition_1 + 0 + ? + + Addition + + + + Adder + Adder + + + + + + 5/8/2005 - 11:40:48 + 5/8/2005 - 11:40:48 + 1.04 + ? + localhost/SuperVisionContainer + Addition from AddComponent + 4 + 327 + + + ? + ? + AddAndCompare + 2 + ? + + AddAndCompare + + + Adder + Adder + + + double + x + + + double + y + + + Adder + anOtherAdder + + + + + double + FuncValue + + + double + z + + + + + + 5/8/2005 - 11:40:48 + 5/8/2005 - 11:40:48 + 1.04 + ? + ? + Python function + 233 + 0 + + + + + Add + FuncValue + Mul + x + + + + Add + FuncValue + AddAndCompare + x + + + 195 + 108 + + + 195 + 233 + + + + + Add + z + Sub + x + + + 187 + 459 + + + 186 + 262 + + + + + Add + z + AddAndCompare + y + + + 187 + 139 + + + 186 + 261 + + + + + Sub + z + Div + x + + + 670 + 206 + + + 680 + 447 + + + + + Mul + z + Div + y + + + + Addition + Adder + AddAndCompare + Adder + + + + Addition_1 + Adder + AddAndCompare + anOtherAdder + + + 215 + 168 + + + 214 + 407 + + + + + + + GraphEmbeddedComponentsCrash1 + Add__x + Add + x + + 7 + 1 + + + + + GraphEmbeddedComponentsCrash1 + Add__y + Add + y + + 7 + 2 + + + + + GraphEmbeddedComponentsCrash1 + Sub__y + Sub + y + + 7 + 3 + + + + + GraphEmbeddedComponentsCrash1 + Mul__y + Mul + y + + 7 + 4 + + + + + + + diff --git a/examples/GraphErrMsgs.py b/examples/GraphErrMsgs.py new file mode 100644 index 0000000..f1075b3 --- /dev/null +++ b/examples/GraphErrMsgs.py @@ -0,0 +1,1234 @@ +from SuperV import * + +GraphErrMsgs = Graph( "GraphErrMsgs" ) + +anXmlFile = os.getenv('SUPERV_ROOT_DIR') + '/examples/SyrStruct.xml' + +GraphErrMsgs.Import( anXmlFile ) + +exec GraphErrMsgs.ListNodes( 'GraphErrMsgs' ) +# ==> m3,m3incr,incra,div2,incrb,SyrComponent,forN,whileNotOne,fori,whileEven,EndOfforN,EndOfwhileNotOne,EndOffori,EndOfwhileEven,ifNotEven,EndOfifNotEven + +exec ifNotEven.ListPorts() +# ==> IifNotEvenSyrComponent,IifNotEvenN,IifNotEvenK,IifNotEvenGate,OifNotEvenOdd,OifNotEvenEven,OifNotEvenSyrComponent,OifNotEvenN,OifNotEvenK,OifNotEvenDefault + +exec EndOfifNotEven.ListPorts() +# ==> IEndOfifNotEvenN,IEndOfifNotEvenK,IEndOfifNotEvenDefault,OEndOfifNotEvenN,OEndOfifNotEvenK,OEndOfifNotEvenGate + +aLink = GraphErrMsgs.Link( OifNotEvenEven , IEndOfifNotEvenN ) +if aLink != None : + print "Error link from OifNotEvenEven to IEndOfifNotEvenN was created" + print "GraphErrMsgs test failed" + sys.exit(1) + +exec EndOfwhileEven.ListPorts() +# ==> IEndOfwhileEvenSyrComponent,IEndOfwhileEvenN,IEndOfwhileEvenK,IEndOfwhileEvenGate,OEndOfwhileEvenSyrComponent,OEndOfwhileEvenN,OEndOfwhileEvenK,OEndOfwhileEvenGate + +exec EndOffori.ListPorts() +# ==> IEndOfforii,IEndOfforiK,IEndOfforiGate,OEndOfforii,OEndOfforiK,OEndOfforiGate + +aLink = GraphErrMsgs.Link( OEndOfwhileEvenK , IEndOfifNotEvenK ) +aLink.destroy() + +aLink = GraphErrMsgs.Link( OEndOfforiK , IEndOfifNotEvenK ) +aLink.destroy() + +aLink = GraphErrMsgs.Link( OifNotEvenN , IEndOfifNotEvenK ) +if aLink == None : + print "Error link from OifNotEvenN to IEndOfifNotEvenK was not created" + print "GraphErrMsgs test failed" + sys.exit(1) + +exec whileEven.ListPorts() +# ==>IwhileEvenSyrComponent,IwhileEvenN,IwhileEvenK,IwhileEvenGate,OwhileEvenSyrComponent,OwhileEvenN,OwhileEvenK,OwhileEvenGate + +aLink = GraphErrMsgs.Link( OifNotEvenK , IwhileEvenK ) +aLink.destroy() + +aLink = GraphErrMsgs.Link( OifNotEvenOdd , IwhileEvenK ) +if aLink != None : + print "Error link from OifNotEvenOdd to IwhileEvenK was created" + print "GraphErrMsgs test failed" + sys.exit(1) + +aLink = GraphErrMsgs.Link( OifNotEvenDefault , IwhileEvenK ) +if aLink != None : + print "Error link from OifNotEvenDefault to IwhileEvenK was created" + print "GraphErrMsgs test failed" + sys.exit(1) + +exec div2.ListPorts() +# ==> Idiv2anEvenInteger,Idiv2Gate,Odiv2anInteger,Odiv2Gate + +aLink = GraphErrMsgs.Link( OwhileEvenN , Idiv2Gate ) +if aLink != None : + print "Error link from OwhileEvenN to Idiv2Gate was created" + print "GraphErrMsgs test failed" + sys.exit(1) + +print "GraphErrMsgs Errors Messages :" +print GraphErrMsgs.Messages() + +RunOk = GraphErrMsgs.Run() +if RunOk != 0 : + print "Error : Success call to Run" + print "GraphErrMsgs test failed" + sys.exit(1) + +GraphErrMsgs.DoneW() + +print "GraphErrMsgs Errors Messages :" +print GraphErrMsgs.Messages() + + +from SuperV import * + +# GraphBadInputInLoop +GraphBadInputInLoop = Graph( "GraphBadInputInLoop" ) + +anXmlFile = os.getenv('SUPERV_ROOT_DIR') + '/examples/GraphBadInputInLoop.xml' + +GraphBadInputInLoop.Import( anXmlFile ) + +RunOk = GraphBadInputInLoop.Run() +if RunOk != 0 : + print "Error : Success call to Run" + print "GraphBadInputInLoop test failed" + sys.exit(1) + +GraphBadInputInLoop.DoneW() + +print "GraphBadInputInLoop Errors Messages :" +print GraphBadInputInLoop.Messages() + + + +from SuperV import * + +# GraphBadInputInLoop1 +GraphBadInputInLoop1 = Graph( "GraphBadInputInLoop1" ) + +anXmlFile = os.getenv('SUPERV_ROOT_DIR') + '/examples/GraphBadInputInLoop1.xml' + +GraphBadInputInLoop1.Import( anXmlFile ) + +RunOk = GraphBadInputInLoop1.Run() +if RunOk != 0 : + print "Error : Success call to Run" + print "GraphBadInputInLoop1 test failed" + sys.exit(1) + +GraphBadInputInLoop1.DoneW() + +print "GraphBadInputInLoop1 Errors Messages :" +print GraphBadInputInLoop1.Messages() + + + +from SuperV import * + +# GraphBadInputInLoop2 +GraphBadInputInLoop2 = Graph( "GraphBadInputInLoop2" ) + +anXmlFile = os.getenv('SUPERV_ROOT_DIR') + '/examples/GraphBadInputInLoop2.xml' + +GraphBadInputInLoop2.Import( anXmlFile ) + +RunOk = GraphBadInputInLoop2.Run() +if RunOk != 0 : + print "Error : Success call to Run" + print "GraphBadInputInLoop2 test failed" + sys.exit(1) + +GraphBadInputInLoop2.DoneW() + +print "GraphBadInputInLoop2 Errors Messages :" +print GraphBadInputInLoop2.Messages() + + + +from SuperV import * + +# GraphBadInputInLoop3 +GraphBadInputInLoop3 = Graph( "GraphBadInputInLoop3" ) + +anXmlFile = os.getenv('SUPERV_ROOT_DIR') + '/examples/GraphBadInputInLoop3.xml' + +GraphBadInputInLoop3.Import( anXmlFile ) + +RunOk = GraphBadInputInLoop3.Run() +if RunOk != 0 : + print "Error : Success call to Run" + print "GraphBadInputInLoop3 test failed" + sys.exit(1) + +GraphBadInputInLoop3.DoneW() + +print "GraphBadInputInLoop3 Errors Messages :" +print GraphBadInputInLoop3.Messages() + + + +from SuperV import * + +# GraphBadOutputOfLoop +GraphBadOutputOfLoop = Graph( "GraphBadOutputOfLoop" ) + +anXmlFile = os.getenv('SUPERV_ROOT_DIR') + '/examples/GraphBadOutputOfLoop.xml' + +GraphBadOutputOfLoop.Import( anXmlFile ) + +RunOk = GraphBadOutputOfLoop.Run() +if RunOk != 0 : + print "Error : Success call to Run" + print "GraphBadOutputOfLoop test failed" + sys.exit(1) + +GraphBadOutputOfLoop.DoneW() + +print "GraphBadOutputOfLoop Errors Messages :" +print GraphBadOutputOfLoop.Messages() + + + +from SuperV import * + +# GraphBadOutputOfLoop1 +GraphBadOutputOfLoop1 = Graph( "GraphBadOutputOfLoop1" ) + +anXmlFile = os.getenv('SUPERV_ROOT_DIR') + '/examples/GraphBadOutputOfLoop1.xml' + +GraphBadOutputOfLoop1.Import( anXmlFile ) + +RunOk = GraphBadOutputOfLoop1.Run() +if RunOk != 0 : + print "Error : Success call to Run" + print "GraphBadOutputOfLoop1 test failed" + sys.exit(1) + +GraphBadOutputOfLoop1.DoneW() + +print "GraphBadOutputOfLoop1 Errors Messages :" +print GraphBadOutputOfLoop1.Messages() + + + +from SuperV import * + +# GraphBadOutputOfLoop2 +GraphBadOutputOfLoop2 = Graph( "GraphBadOutputOfLoop2" ) + +anXmlFile = os.getenv('SUPERV_ROOT_DIR') + '/examples/GraphBadOutputOfLoop2.xml' + +GraphBadOutputOfLoop2.Import( anXmlFile ) + +RunOk = GraphBadOutputOfLoop2.Run() +if RunOk != 0 : + print "Error : Success call to Run" + print "GraphBadOutputOfLoop2 test failed" + sys.exit(1) + +GraphBadOutputOfLoop2.DoneW() + +print "GraphBadOutputOfLoop2 Errors Messages :" +print GraphBadOutputOfLoop2.Messages() + + + +from SuperV import * + +# GraphConvertObjRefCheckNotCompatible +GraphConvertObjRefCheckNotCompatible = Graph( "GraphConvertObjRefCheckNotCompatible" ) + +anXmlFile = os.getenv('SUPERV_ROOT_DIR') + '/examples/GraphConvertObjRefCheckNotCompatible.xml' + +GraphConvertObjRefCheckNotCompatible.Import( anXmlFile ) + +RunOk = GraphConvertObjRefCheckNotCompatible.Run() +if RunOk != 0 : + print "Error : Success call to Run" + print "GraphConvertObjRefCheckNotCompatible test failed" + sys.exit(1) + +GraphConvertObjRefCheckNotCompatible.DoneW() + +print "GraphConvertObjRefCheckNotCompatible Errors Messages :" +print GraphConvertObjRefCheckNotCompatible.Messages() + + + + +from SuperV import * + +# GraphWrongPythonFunctions +GraphWrongPythonFunctions = Graph( "GraphWrongPythonFunctions" ) + +anXmlFile = os.getenv('SUPERV_ROOT_DIR') + '/examples/GraphWrongPythonFunctions.xml' + +GraphWrongPythonFunctions.Import( anXmlFile ) + +RunOk = GraphWrongPythonFunctions.Run() +if RunOk != 0 : + print "Error : Success call to Run" + print "GraphWrongPythonFunctions test failed" + sys.exit(1) + +GraphWrongPythonFunctions.DoneW() + +print "GraphWrongPythonFunctions Errors Messages :" +print GraphWrongPythonFunctions.Messages() + + + +from SuperV import * + +# GraphWrongContainerOrComponent +GraphWrongContainerOrComponent = Graph( "GraphWrongContainerOrComponent" ) + +anXmlFile = os.getenv('SUPERV_ROOT_DIR') + '/examples/GraphWrongContainerOrComponent.xml' + +GraphWrongContainerOrComponent.Import( anXmlFile ) + +RunOk = GraphWrongContainerOrComponent.Run() +if RunOk == 0 : + print "Error : UnSuccess call to Run" + print "GraphWrongContainerOrComponent test failed" + sys.exit(1) + +GraphWrongContainerOrComponent.DoneW() + +print "GraphWrongContainerOrComponent Errors Messages :" +print GraphWrongContainerOrComponent.Messages() + + + +from SuperV import * + +# GraphLoopSwitchDefaultAborted +GraphLoopSwitchDefaultAborted = Graph( "GraphLoopSwitchDefaultAborted" ) + +anXmlFile = os.getenv('SUPERV_ROOT_DIR') + '/examples/GraphLoopSwitchDefaultAborted.xml' + +GraphLoopSwitchDefaultAborted.Import( anXmlFile ) + +RunOk = GraphLoopSwitchDefaultAborted.Run() +if RunOk == 0 : + print "Error : UnSuccess call to Run" + print "GraphLoopSwitchDefaultAborted test failed" + sys.exit(1) + +GraphLoopSwitchDefaultAborted.DoneW() + +print "GraphLoopSwitchDefaultAborted Errors Messages :" +print GraphLoopSwitchDefaultAborted.Messages() + + + +from SuperV import * + +# GraphLoopSwitchOfSwitchAborted +GraphLoopSwitchOfSwitchAborted = Graph( "GraphLoopSwitchOfSwitchAborted" ) + +anXmlFile = os.getenv('SUPERV_ROOT_DIR') + '/examples/GraphLoopSwitchOfSwitchAborted.xml' + +GraphLoopSwitchOfSwitchAborted.Import( anXmlFile ) + +RunOk = GraphLoopSwitchOfSwitchAborted.Run() +if RunOk == 0 : + print "Error : UnSuccess call to Run" + print "GraphLoopSwitchOfSwitchAborted test failed" + sys.exit(1) + +GraphLoopSwitchOfSwitchAborted.DoneW() + +print "GraphLoopSwitchOfSwitchAborted Errors Messages :" +print GraphLoopSwitchOfSwitchAborted.Messages() + + + +from SuperV import * + +# GraphLoopSwitchOfSwitchNOTValid +GraphLoopSwitchOfSwitchNOTValid = Graph( "GraphLoopSwitchOfSwitchNOTValid" ) + +anXmlFile = os.getenv('SUPERV_ROOT_DIR') + '/examples/GraphLoopSwitchOfSwitchNOTValid.xml' + +GraphLoopSwitchOfSwitchNOTValid.Import( anXmlFile ) + +RunOk = GraphLoopSwitchOfSwitchNOTValid.Run() +if RunOk != 0 : + print "Error : Success call to Run" + print "GraphLoopSwitchOfSwitchNOTValid test failed" + sys.exit(1) + +GraphLoopSwitchOfSwitchNOTValid.DoneW() + +print "GraphLoopSwitchOfSwitchNOTValid Errors Messages :" +print GraphLoopSwitchOfSwitchNOTValid.Messages() + + +from SuperV import * + +# GraphLoopSwitchsAborted +GraphLoopSwitchsAborted = Graph( "GraphLoopSwitchsAborted" ) + +anXmlFile = os.getenv('SUPERV_ROOT_DIR') + '/examples/GraphLoopSwitchsAborted.xml' + +GraphLoopSwitchsAborted.Import( anXmlFile ) + +RunOk = GraphLoopSwitchsAborted.Run() +if RunOk == 0 : + print "Error : UnSuccess call to Run" + print "GraphLoopSwitchsAborted test failed" + sys.exit(1) + +GraphLoopSwitchsAborted.DoneW() + +print "GraphLoopSwitchsAborted Errors Messages :" +print GraphLoopSwitchsAborted.Messages() + + + +from SuperV import * + +# GraphLoopSwitchsBranchesDefaultAborted +GraphLoopSwitchsBranchesDefaultAborted = Graph( "GraphLoopSwitchsBranchesDefaultAborted" ) + +anXmlFile = os.getenv('SUPERV_ROOT_DIR') + '/examples/GraphLoopSwitchsBranchesDefaultAborted.xml' + +GraphLoopSwitchsBranchesDefaultAborted.Import( anXmlFile ) + +RunOk = GraphLoopSwitchsBranchesDefaultAborted.Run() +if RunOk == 0 : + print "Error : UnSuccess call to Run" + print "GraphLoopSwitchsBranchesDefaultAborted test failed" + sys.exit(1) + +GraphLoopSwitchsBranchesDefaultAborted.DoneW() + +print "GraphLoopSwitchsBranchesDefaultAborted Errors Messages :" +print GraphLoopSwitchsBranchesDefaultAborted.Messages() + + + +from SuperV import * + +# GraphLoopSwitchsNOTValid +GraphLoopSwitchsNOTValid = Graph( "GraphLoopSwitchsNOTValid" ) + +anXmlFile = os.getenv('SUPERV_ROOT_DIR') + '/examples/GraphLoopSwitchsNOTValid.xml' + +GraphLoopSwitchsNOTValid.Import( anXmlFile ) + +RunOk = GraphLoopSwitchsNOTValid.Run() +if RunOk != 0 : + print "Error : Success call to Run" + print "GraphLoopSwitchsNOTValid test failed" + sys.exit(1) + +GraphLoopSwitchsNOTValid.DoneW() + +print "GraphLoopSwitchsNOTValid Errors Messages :" +print GraphLoopSwitchsNOTValid.Messages() + + +from SuperV import * + +# GraphSwitchCheckBranch2NOTValid +GraphSwitchCheckBranch2NOTValid = Graph( "GraphSwitchCheckBranch2NOTValid" ) + +anXmlFile = os.getenv('SUPERV_ROOT_DIR') + '/examples/GraphSwitchCheckBranch2NOTValid.xml' + +GraphSwitchCheckBranch2NOTValid.Import( anXmlFile ) + +RunOk = GraphSwitchCheckBranch2NOTValid.Run() +if RunOk != 0 : + print "Error : Success call to Run" + print "GraphSwitchCheckBranch2NOTValid test failed" + sys.exit(1) + +GraphSwitchCheckBranch2NOTValid.DoneW() + +print "GraphSwitchCheckBranch2NOTValid Errors Messages :" +print GraphSwitchCheckBranch2NOTValid.Messages() + + +from SuperV import * + +# GraphSwitchCheckDefault1NOTValid +GraphSwitchCheckDefault1NOTValid = Graph( "GraphSwitchCheckDefault1NOTValid" ) + +anXmlFile = os.getenv('SUPERV_ROOT_DIR') + '/examples/GraphSwitchCheckDefault1NOTValid.xml' + +GraphSwitchCheckDefault1NOTValid.Import( anXmlFile ) + +RunOk = GraphSwitchCheckDefault1NOTValid.Run() +if RunOk != 0 : + print "Error : Success call to Run" + print "GraphSwitchCheckDefault1NOTValid test failed" + sys.exit(1) + +GraphSwitchCheckDefault1NOTValid.DoneW() + +print "GraphSwitchCheckDefault1NOTValid Errors Messages :" +print GraphSwitchCheckDefault1NOTValid.Messages() + + +from SuperV import * + +# GraphSwitchCheckDefault2NOTValid +GraphSwitchCheckDefault2NOTValid = Graph( "GraphSwitchCheckDefault2NOTValid" ) + +anXmlFile = os.getenv('SUPERV_ROOT_DIR') + '/examples/GraphSwitchCheckDefault2NOTValid.xml' + +GraphSwitchCheckDefault2NOTValid.Import( anXmlFile ) + +RunOk = GraphSwitchCheckDefault2NOTValid.Run() +if RunOk != 0 : + print "Error : Success call to Run" + print "GraphSwitchCheckDefault2NOTValid test failed" + sys.exit(1) + +GraphSwitchCheckDefault2NOTValid.DoneW() + +print "GraphSwitchCheckDefault2NOTValid Errors Messages :" +print GraphSwitchCheckDefault2NOTValid.Messages() + + +from SuperV import * + +# GraphSwitchCheckDefault2NOTValid1 +GraphSwitchCheckDefault2NOTValid1 = Graph( "GraphSwitchCheckDefault2NOTValid1" ) + +anXmlFile = os.getenv('SUPERV_ROOT_DIR') + '/examples/GraphSwitchCheckDefault2NOTValid1.xml' + +GraphSwitchCheckDefault2NOTValid1.Import( anXmlFile ) + +RunOk = GraphSwitchCheckDefault2NOTValid1.Run() +if RunOk != 0 : + print "Error : Success call to Run" + print "GraphSwitchCheckDefault2NOTValid1 test failed" + sys.exit(1) + +GraphSwitchCheckDefault2NOTValid1.DoneW() + +print "GraphSwitchCheckDefault2NOTValid1 Errors Messages :" +print GraphSwitchCheckDefault2NOTValid1.Messages() + + +from SuperV import * + +# GraphSwitchCheckDefault2NOTValid2 +GraphSwitchCheckDefault2NOTValid2 = Graph( "GraphSwitchCheckDefault2NOTValid2" ) + +anXmlFile = os.getenv('SUPERV_ROOT_DIR') + '/examples/GraphSwitchCheckDefault2NOTValid2.xml' + +GraphSwitchCheckDefault2NOTValid2.Import( anXmlFile ) + +RunOk = GraphSwitchCheckDefault2NOTValid2.Run() +if RunOk != 0 : + print "Error : Success call to Run" + print "GraphSwitchCheckDefault2NOTValid2 test failed" + sys.exit(1) + +GraphSwitchCheckDefault2NOTValid2.DoneW() + +print "GraphSwitchCheckDefault2NOTValid2 Errors Messages :" +print GraphSwitchCheckDefault2NOTValid2.Messages() + + +from SuperV import * + +# GraphSwitchCrash +GraphSwitchCrash = Graph( "GraphSwitchCrash" ) + +anXmlFile = os.getenv('SUPERV_ROOT_DIR') + '/examples/GraphSwitchCrash.xml' + +GraphSwitchCrash.Import( anXmlFile ) + +RunOk = GraphSwitchCrash.Run() +if RunOk == 0 : + print "Error : UnSuccess call to Run" + print "GraphSwitchCrash test failed" + sys.exit(1) + +GraphSwitchCrash.DoneW() + +print "GraphSwitchCrash Errors Messages :" +print GraphSwitchCrash.Messages() + + +from SuperV import * + +# GraphSwitchErrExec +GraphSwitchErrExec = Graph( "GraphSwitchErrExec" ) + +anXmlFile = os.getenv('SUPERV_ROOT_DIR') + '/examples/GraphSwitchErrExec.xml' + +GraphSwitchErrExec.Import( anXmlFile ) + +RunOk = GraphSwitchErrExec.Run() +if RunOk == 0 : + print "Error : UnSuccess call to Run" + print "GraphSwitchErrExec test failed" + sys.exit(1) + +GraphSwitchErrExec.DoneW() + +print "GraphSwitchErrExec Errors Messages :" +print GraphSwitchErrExec.Messages() + + +from SuperV import * + +# GraphSwitchGatesNoDefaultAborted +GraphSwitchGatesNoDefaultAborted = Graph( "GraphSwitchGatesNoDefaultAborted" ) + +anXmlFile = os.getenv('SUPERV_ROOT_DIR') + '/examples/GraphSwitchGatesNoDefaultAborted.xml' + +GraphSwitchGatesNoDefaultAborted.Import( anXmlFile ) + +RunOk = GraphSwitchGatesNoDefaultAborted.Run() +if RunOk == 0 : + print "Error : UnSuccess call to Run" + print "GraphSwitchGatesNoDefaultAborted test failed" + sys.exit(1) + +GraphSwitchGatesNoDefaultAborted.DoneW() + +print "GraphSwitchGatesNoDefaultAborted Errors Messages :" +print GraphSwitchGatesNoDefaultAborted.Messages() + + +from SuperV import * + +# GraphSwitchOutputNOTValid +GraphSwitchOutputNOTValid = Graph( "GraphSwitchOutputNOTValid" ) + +anXmlFile = os.getenv('SUPERV_ROOT_DIR') + '/examples/GraphSwitchOutputNOTValid.xml' + +GraphSwitchOutputNOTValid.Import( anXmlFile ) + +RunOk = GraphSwitchOutputNOTValid.Run() +if RunOk != 0 : + print "Error : Success call to Run" + print "GraphSwitchOutputNOTValid test failed" + sys.exit(1) + +GraphSwitchOutputNOTValid.DoneW() + +print "GraphSwitchOutputNOTValid Errors Messages :" +print GraphSwitchOutputNOTValid.Messages() + + +from SuperV import * + +# GraphSyrControlAborted +GraphSyrControlAborted = Graph( "GraphSyrControlAborted" ) + +anXmlFile = os.getenv('SUPERV_ROOT_DIR') + '/examples/GraphSyrControlAborted.xml' + +GraphSyrControlAborted.Import( anXmlFile ) + +RunOk = GraphSyrControlAborted.Run() +if RunOk == 0 : + print "Error : UnSuccess call to Run" + print "GraphSyrControlAborted test failed" + sys.exit(1) + +GraphSyrControlAborted.DoneW() + +print "GraphSyrControlAborted Errors Messages :" +print GraphSyrControlAborted.Messages() + + +from SuperV import * + +# GraphSyrControlAve +GraphSyrControlAve = Graph( "GraphSyrControlAve" ) + +anXmlFile = os.getenv('SUPERV_ROOT_DIR') + '/examples/GraphSyrControlAve.xml' + +GraphSyrControlAve.Import( anXmlFile ) + +RunOk = GraphSyrControlAve.Run() +if RunOk == 0 : + print "Error : Success call to Run" + print "GraphSyrControlAve test failed" + sys.exit(1) + +GraphSyrControlAve.DoneW() + +Messages = GraphSyrControlAve.Messages() +if Messages != "" : + print "Error GraphSyrControlAve has Messages :" + print Messages + sys.exit(1) + + +from SuperV import * + +# GraphSyrControlAveValid +GraphSyrControlAveValid = Graph( "GraphSyrControlAveValid" ) + +anXmlFile = os.getenv('SUPERV_ROOT_DIR') + '/examples/GraphSyrControlAveValid.xml' + +GraphSyrControlAveValid.Import( anXmlFile ) + +RunOk = GraphSyrControlAveValid.Run() +if RunOk == 0 : + print "Error : Success call to Run" + print "GraphSyrControlAveValid test failed" + sys.exit(1) + +GraphSyrControlAveValid.DoneW() + +Messages = GraphSyrControlAveValid.Messages() +if Messages != "" : + print "Error GraphSyrControlAveValid has Messages :" + print Messages + sys.exit(1) + + +from SuperV import * + +# GraphSyrControlAveExecutable +GraphSyrControlAveExecutable = Graph( "GraphSyrControlAveExecutable" ) + +anXmlFile = os.getenv('SUPERV_ROOT_DIR') + '/examples/GraphSyrControlAveExecutable.xml' + +GraphSyrControlAveExecutable.Import( anXmlFile ) + +RunOk = GraphSyrControlAveExecutable.Run() +if RunOk == 0 : + print "Error : UnSuccess call to Run" + print "GraphSyrControlAveExecutable test failed" + sys.exit(1) + +GraphSyrControlAveExecutable.DoneW() + +Messages = GraphSyrControlAveExecutable.Messages() +if Messages != "" : + print "Error GraphSyrControlAveExecutable has Messages :" + print Messages + sys.exit(1) + + +from SuperV import * + +# GraphSyrControlAveNOTValid +GraphSyrControlAveNOTValid = Graph( "GraphSyrControlAveNOTValid" ) + +anXmlFile = os.getenv('SUPERV_ROOT_DIR') + '/examples/GraphSyrControlAveNOTValid.xml' + +GraphSyrControlAveNOTValid.Import( anXmlFile ) + +RunOk = GraphSyrControlAveNOTValid.Run() +if RunOk != 0 : + print "Error : Success call to Run" + print "GraphSyrControlAveNOTValid test failed" + sys.exit(1) + +GraphSyrControlAveNOTValid.DoneW() + +print "GraphSyrControlAveNOTValid Errors Messages :" +print GraphSyrControlAveNOTValid.Messages() + + +from SuperV import * + +# GraphSyrControlAveNOTValid1 +GraphSyrControlAveNOTValid1 = Graph( "GraphSyrControlAveNOTValid1" ) + +anXmlFile = os.getenv('SUPERV_ROOT_DIR') + '/examples/GraphSyrControlAveNOTValid1.xml' + +GraphSyrControlAveNOTValid1.Import( anXmlFile ) + +RunOk = GraphSyrControlAveNOTValid1.Run() +if RunOk == 0 : + print "Error : UnSuccess call to Run" + print "GraphSyrControlAveNOTValid1 test failed" + sys.exit(1) + +GraphSyrControlAveNOTValid1.DoneW() + +print "GraphSyrControlAveNOTValid1 Errors Messages :" +print GraphSyrControlAveNOTValid1.Messages() + + +from SuperV import * + +# GraphSwitch +GraphSwitch = Graph( "GraphSwitch" ) + +anXmlFile = os.getenv('SUPERV_ROOT_DIR') + '/examples/GraphSwitch.xml' + +GraphSwitch.Import( anXmlFile ) + +RunOk = GraphSwitch.Run() +if RunOk == 0 : + print "Error : UnSuccess call to Run" + print "GraphSwitch test failed" + sys.exit(1) + +GraphSwitch.DoneW() + +Messages = GraphSwitch.Messages() +if Messages != "" : + print "Error GraphSwitch has Messages :" + print Messages + sys.exit(1) + + +from SuperV import * + +# GraphSwitchExecutable +GraphSwitchExecutable = Graph( "GraphSwitchExecutable" ) + +anXmlFile = os.getenv('SUPERV_ROOT_DIR') + '/examples/GraphSwitchExecutable.xml' + +GraphSwitchExecutable.Import( anXmlFile ) + +RunOk = GraphSwitchExecutable.Run() +if RunOk == 0 : + print "Error : UnSuccess call to Run" + print "GraphSwitchExecutable test failed" + sys.exit(1) + +GraphSwitchExecutable.DoneW() + +Messages = GraphSwitchExecutable.Messages() +if Messages != "" : + print "Error GraphSwitchExecutable has Messages :" + print Messages + sys.exit(1) + + +from SuperV import * + +# GraphSwitchNOTExecutable +GraphSwitchNOTExecutable = Graph( "GraphSwitchNOTExecutable" ) + +anXmlFile = os.getenv('SUPERV_ROOT_DIR') + '/examples/GraphSwitchNOTExecutable.xml' + +GraphSwitchNOTExecutable.Import( anXmlFile ) + +RunOk = GraphSwitchNOTExecutable.Run() +if RunOk != 0 : + print "Error : Success call to Run" + print "GraphSwitchNOTExecutable test failed" + sys.exit(1) + +GraphSwitchNOTExecutable.DoneW() + +print "GraphSwitchNOTExecutable Errors Messages :" +print GraphSwitchNOTExecutable.Messages() + + +from SuperV import * + +# GraphSwitchNOTExecutable1 +GraphSwitchNOTExecutable1 = Graph( "GraphSwitchNOTExecutable1" ) + +anXmlFile = os.getenv('SUPERV_ROOT_DIR') + '/examples/GraphSwitchNOTExecutable1.xml' + +GraphSwitchNOTExecutable1.Import( anXmlFile ) + +RunOk = GraphSwitchNOTExecutable1.Run() +if RunOk != 0 : + print "Error : Success call to Run" + print "GraphSwitchNOTExecutable1 test failed" + sys.exit(1) + +GraphSwitchNOTExecutable1.DoneW() + +print "GraphSwitchNOTExecutable1 Errors Messages :" +print GraphSwitchNOTExecutable1.Messages() + + + +from SuperV import * + +# GraphSwitchNOTExecutable2 +GraphSwitchNOTExecutable2 = Graph( "GraphSwitchNOTExecutable2" ) + +anXmlFile = os.getenv('SUPERV_ROOT_DIR') + '/examples/GraphSwitchNOTExecutable2.xml' + +GraphSwitchNOTExecutable2.Import( anXmlFile ) + +RunOk = GraphSwitchNOTExecutable2.Run() +if RunOk != 0 : + print "Error : Success call to Run" + print "GraphSwitchNOTExecutable2 test failed" + sys.exit(1) + +GraphSwitchNOTExecutable2.DoneW() + +print "GraphSwitchNOTExecutable2 Errors Messages :" +print GraphSwitchNOTExecutable2.Messages() + + + +from SuperV import * + +# GraphSwitchBranchGates +GraphSwitchBranchGates = Graph( "GraphSwitchBranchGates" ) + +anXmlFile = os.getenv('SUPERV_ROOT_DIR') + '/examples/GraphSwitchBranchGates.xml' + +GraphSwitchBranchGates.Import( anXmlFile ) + +RunOk = GraphSwitchBranchGates.Run() +if RunOk == 0 : + print "Error : UnSuccess call to Run" + print "GraphSwitchBranchGates test failed" + sys.exit(1) + +GraphSwitchBranchGates.DoneW() + +Messages = GraphSwitchBranchGates.Messages() +if Messages != "" : + print "Error GraphSwitchBranchGates has Messages :" + print Messages + sys.exit(1) + + +from SuperV import * + +# GraphInLinesUnValid +GraphInLinesUnValid = Graph( "GraphInLinesUnValid" ) + +anXmlFile = os.getenv('SUPERV_ROOT_DIR') + '/examples/GraphInLinesUnValid.xml' + +GraphInLinesUnValid.Import( anXmlFile ) + +RunOk = GraphInLinesUnValid.Run() +if RunOk != 0 : + print "Error : Success call to Run" + print "GraphInLinesUnValid test failed" + sys.exit(1) + +GraphInLinesUnValid.DoneW() + +print "GraphInLinesUnValid Errors Messages :" +print GraphInLinesUnValid.Messages() + + + +from SuperV import * + +# GraphSwitchCheckBranch2NOTValid +GraphSwitchCheckBranch2NOTValid = Graph( "GraphSwitchCheckBranch2NOTValid" ) + +anXmlFile = os.getenv('SUPERV_ROOT_DIR') + '/examples/GraphSwitchCheckBranch2NOTValid.xml' + +GraphSwitchCheckBranch2NOTValid.Import( anXmlFile ) + +RunOk = GraphSwitchCheckBranch2NOTValid.Run() +if RunOk != 0 : + print "Error : Success call to Run" + print "GraphSwitchCheckBranch2NOTValid test failed" + sys.exit(1) + +GraphSwitchCheckBranch2NOTValid.DoneW() + +print "GraphSwitchCheckBranch2NOTValid Errors Messages :" +print GraphSwitchCheckBranch2NOTValid.Messages() + + + +from SuperV import * + +# GraphSwitchCheckDefault1NOTValid +GraphSwitchCheckDefault1NOTValid = Graph( "GraphSwitchCheckDefault1NOTValid" ) + +anXmlFile = os.getenv('SUPERV_ROOT_DIR') + '/examples/GraphSwitchCheckDefault1NOTValid.xml' + +GraphSwitchCheckDefault1NOTValid.Import( anXmlFile ) + +RunOk = GraphSwitchCheckDefault1NOTValid.Run() +if RunOk != 0 : + print "Error : Success call to Run" + print "GraphSwitchCheckDefault1NOTValid test failed" + sys.exit(1) + +GraphSwitchCheckDefault1NOTValid.DoneW() + +print "GraphSwitchCheckDefault1NOTValid Errors Messages :" +print GraphSwitchCheckDefault1NOTValid.Messages() + + +from SuperV import * + +# GraphSwitchCheckDefault2NOTValid +GraphSwitchCheckDefault2NOTValid = Graph( "GraphSwitchCheckDefault2NOTValid" ) + +anXmlFile = os.getenv('SUPERV_ROOT_DIR') + '/examples/GraphSwitchCheckDefault2NOTValid.xml' + +GraphSwitchCheckDefault2NOTValid.Import( anXmlFile ) + +RunOk = GraphSwitchCheckDefault2NOTValid.Run() +if RunOk != 0 : + print "Error : Success call to Run" + print "GraphSwitchCheckDefault2NOTValid test failed" + sys.exit(1) + +GraphSwitchCheckDefault2NOTValid.DoneW() + +print "GraphSwitchCheckDefault2NOTValid Errors Messages :" +print GraphSwitchCheckDefault2NOTValid.Messages() + + + + +from SuperV import * + +# GraphSwitchCheckDefault2NOTValid1 +GraphSwitchCheckDefault2NOTValid1 = Graph( "GraphSwitchCheckDefault2NOTValid1" ) + +anXmlFile = os.getenv('SUPERV_ROOT_DIR') + '/examples/GraphSwitchCheckDefault2NOTValid1.xml' + +GraphSwitchCheckDefault2NOTValid1.Import( anXmlFile ) + +RunOk = GraphSwitchCheckDefault2NOTValid1.Run() +if RunOk != 0 : + print "Error : Success call to Run" + print "GraphSwitchCheckDefault2NOTValid1 test failed" + sys.exit(1) + +GraphSwitchCheckDefault2NOTValid1.DoneW() + +print "GraphSwitchCheckDefault2NOTValid1 Errors Messages :" +print GraphSwitchCheckDefault2NOTValid1.Messages() + + + +from SuperV import * + +# GraphSwitchCheckDefault2NOTValid2 +GraphSwitchCheckDefault2NOTValid2 = Graph( "GraphSwitchCheckDefault2NOTValid2" ) + +anXmlFile = os.getenv('SUPERV_ROOT_DIR') + '/examples/GraphSwitchCheckDefault2NOTValid2.xml' + +GraphSwitchCheckDefault2NOTValid2.Import( anXmlFile ) + +RunOk = GraphSwitchCheckDefault2NOTValid2.Run() +if RunOk != 0 : + print "Error : Success call to Run" + print "GraphSwitchCheckDefault2NOTValid2 test failed" + sys.exit(1) + +GraphSwitchCheckDefault2NOTValid2.DoneW() + +print "GraphSwitchCheckDefault2NOTValid2 Errors Messages :" +print GraphSwitchCheckDefault2NOTValid2.Messages() + + +from SuperV import * + +# GraphLoopsCoupled +GraphLoopsCoupled = Graph( "GraphLoopsCoupled" ) + +anXmlFile = os.getenv('SUPERV_ROOT_DIR') + '/examples/GraphLoopsCoupled.xml' + +GraphLoopsCoupled.Import( anXmlFile ) + +RunOk = GraphLoopsCoupled.Run() +if RunOk != 0 : + print "Error : Success call to Run" + print "GraphLoopsCoupled test failed" + sys.exit(1) + +GraphLoopsCoupled.DoneW() + +print "GraphLoopsCoupled Errors Messages :" +print GraphLoopsCoupled.Messages() + + +from SuperV import * + +# GraphLoopGates +GraphLoopGates = Graph( "GraphLoopGates" ) + +anXmlFile = os.getenv('SUPERV_ROOT_DIR') + '/examples/GraphLoopGates.xml' + +GraphLoopGates.Import( anXmlFile ) + +RunOk = GraphLoopGates.Run() +if RunOk == 0 : + print "Error : UnSuccess call to Run" + print "GraphLoopGates test failed" + sys.exit(1) + +GraphLoopGates.DoneW() + +Messages = GraphSwitchBranchGates.Messages() +if Messages != "" : + print "Error GraphSwitchBranchGates has Messages :" + print Messages + sys.exit(1) + + + +from SuperV import * + +# GraphLoopGatesNOTValid +GraphLoopGatesNOTValid = Graph( "GraphLoopGatesNOTValid" ) + +anXmlFile = os.getenv('SUPERV_ROOT_DIR') + '/examples/GraphLoopGatesNOTValid.xml' + +GraphLoopGatesNOTValid.Import( anXmlFile ) + +RunOk = GraphLoopGatesNOTValid.Run() +if RunOk != 0 : + print "Error : Success call to Run" + print "GraphLoopGatesNOTValid test failed" + sys.exit(1) + +GraphLoopGatesNOTValid.DoneW() + +print "GraphLoopGatesNOTValid Errors Messages :" +print GraphLoopGatesNOTValid.Messages() + + +from SuperV import * + +# GraphSwitchManyCases +GraphSwitchManyCases = Graph( "GraphSwitchManyCases" ) + +anXmlFile = os.getenv('SUPERV_ROOT_DIR') + '/examples/GraphSwitchManyCases.xml' + +GraphSwitchManyCases.Import( anXmlFile ) + +RunOk = GraphSwitchManyCases.Run() +if RunOk != 0 : + print "Error : Success call to Run" + print "GraphSwitchManyCases test failed" + sys.exit(1) + +GraphSwitchManyCases.DoneW() + +print "GraphSwitchManyCases Errors Messages :" +print GraphSwitchManyCases.Messages() + + + +from SuperV import * + +# GraphLoopTwoBranches +GraphLoopTwoBranches = Graph( "GraphLoopTwoBranches" ) + +anXmlFile = os.getenv('SUPERV_ROOT_DIR') + '/examples/GraphLoopTwoBranches.xml' + +GraphLoopTwoBranches.Import( anXmlFile ) + +RunOk = GraphLoopTwoBranches.Run() +if RunOk == 0 : + print "Error : UnSuccess call to Run" + print "GraphLoopTwoBranches test failed" + sys.exit(1) + +GraphLoopTwoBranches.DoneW() + +print "GraphLoopTwoBranches Errors Messages :" +print GraphLoopTwoBranches.Messages() + + + +from SuperV import * + +# GraphSwitchOutputNOTValid +GraphSwitchOutputNOTValid = Graph( "GraphSwitchOutputNOTValid" ) + +anXmlFile = os.getenv('SUPERV_ROOT_DIR') + '/examples/GraphSwitchOutputNOTValid.xml' + +GraphSwitchOutputNOTValid.Import( anXmlFile ) + +RunOk = GraphSwitchOutputNOTValid.Run() +if RunOk != 0 : + print "Error : Success call to Run" + print "GraphSwitchOutputNOTValid test failed" + sys.exit(1) + +GraphSwitchOutputNOTValid.DoneW() + +print "GraphSwitchOutputNOTValid Errors Messages :" +print GraphSwitchOutputNOTValid.Messages() + + + +from SuperV import * + +# GraphLoopSwitch +GraphLoopSwitch = Graph( "GraphLoopSwitch" ) + +anXmlFile = os.getenv('SUPERV_ROOT_DIR') + '/examples/GraphLoopSwitch.xml' + +GraphLoopSwitch.Import( anXmlFile ) + +RunOk = GraphLoopSwitch.Run() +if RunOk == 0 : + print "Error : UnSuccess call to Run" + print "GraphLoopSwitch test failed" + sys.exit(1) + +GraphLoopSwitch.DoneW() + +Messages = GraphLoopSwitch.Messages() +if Messages != "" : + print "Error GraphLoopSwitch has Messages :" + print Messages + sys.exit(1) + + + +from SuperV import * + +# GraphLoopSwitchGateDefault +GraphLoopSwitchGateDefault = Graph( "GraphLoopSwitchGateDefault" ) + +anXmlFile = os.getenv('SUPERV_ROOT_DIR') + '/examples/GraphLoopSwitchGateDefault.xml' + +GraphLoopSwitchGateDefault.Import( anXmlFile ) + +RunOk = GraphLoopSwitchGateDefault.Run() +if RunOk == 0 : + print "Error : UnSuccess call to Run" + print "GraphLoopSwitchGateDefault test failed" + sys.exit(1) + +GraphLoopSwitchGateDefault.DoneW() + +Messages = GraphLoopSwitchGateDefault.Messages() +if Messages != "" : + print "Error GraphLoopSwitchGateDefault has Messages :" + print Messages + sys.exit(1) + + +from SuperV import * + +# GraphLoopSwitchGatesDefault +GraphLoopSwitchGatesDefault = Graph( "GraphLoopSwitchGatesDefault" ) + +anXmlFile = os.getenv('SUPERV_ROOT_DIR') + '/examples/GraphLoopSwitchGatesDefault.xml' + +GraphLoopSwitchGatesDefault.Import( anXmlFile ) + +RunOk = GraphLoopSwitchGatesDefault.Run() +if RunOk == 1 : + print "Error : Success call to Run" + print "GraphLoopSwitchGatesDefault test failed" + sys.exit(1) + +GraphLoopSwitchGatesDefault.DoneW() + +print "GraphLoopSwitchGatesDefault Errors Messages :" +print GraphLoopSwitchGatesDefault.Messages() + + + + + +sys.exit(0) + diff --git a/examples/GraphGOTO1.py b/examples/GraphGOTO1.py index 7201a44..6731b6b 100755 --- a/examples/GraphGOTO1.py +++ b/examples/GraphGOTO1.py @@ -1,19 +1,19 @@ -# Generated python file of Graph GraphGOTO_2_2 +# Generated python file of Graph GraphGOTO1 from SuperV import * -# Graph creation of GraphGOTO_2_2 -def DefGraphGOTO_2_2() : - GraphGOTO_2_2 = Graph( 'GraphGOTO_2_2' ) - GraphGOTO_2_2.SetName( 'GraphGOTO_2_2' ) - GraphGOTO_2_2.SetAuthor( 'JR' ) - GraphGOTO_2_2.SetComment( 'Syracuse algorithm' ) - GraphGOTO_2_2.Coords( 0 , 0 ) +# Graph creation of GraphGOTO1 +def DefGraphGOTO1() : + GraphGOTO1 = Graph( 'GraphGOTO1' ) + GraphGOTO1.SetName( 'GraphGOTO1' ) + GraphGOTO1.SetAuthor( 'JR' ) + GraphGOTO1.SetComment( 'Syracuse algorithm' ) + GraphGOTO1.Coords( 0 , 0 ) # Creation of Factory Nodes - test_ISEVEN = GraphGOTO_2_2.FNode( 'SyrComponent' , 'SyrComponent' , 'C_ISEVEN' ) + test_ISEVEN = GraphGOTO1.FNode( 'SyrComponent' , 'SyrComponent' , 'C_ISEVEN' ) test_ISEVEN.SetName( 'test_ISEVEN' ) test_ISEVEN.SetAuthor( '' ) test_ISEVEN.SetContainer( 'localhost/FactoryServer' ) @@ -24,7 +24,7 @@ def DefGraphGOTO_2_2() : Otest_ISEVENBoolEven = test_ISEVEN.GetOutPort( 'BoolEven' ) Otest_ISEVENGate = test_ISEVEN.GetOutPort( 'Gate' ) - test_ISONE = GraphGOTO_2_2.FNode( 'SyrComponent' , 'SyrComponent' , 'C_ISONE' ) + test_ISONE = GraphGOTO1.FNode( 'SyrComponent' , 'SyrComponent' , 'C_ISONE' ) test_ISONE.SetName( 'test_ISONE' ) test_ISONE.SetAuthor( '' ) test_ISONE.SetContainer( 'localhost/FactoryServer' ) @@ -35,7 +35,7 @@ def DefGraphGOTO_2_2() : Otest_ISONEBoolOne = test_ISONE.GetOutPort( 'BoolOne' ) Otest_ISONEGate = test_ISONE.GetOutPort( 'Gate' ) - m3p1 = GraphGOTO_2_2.FNode( 'SyrComponent' , 'SyrComponent' , 'C_M3P1' ) + m3p1 = GraphGOTO1.FNode( 'SyrComponent' , 'SyrComponent' , 'C_M3P1' ) m3p1.SetName( 'm3p1' ) m3p1.SetAuthor( '' ) m3p1.SetContainer( 'localhost/FactoryServer' ) @@ -46,7 +46,7 @@ def DefGraphGOTO_2_2() : Om3p1anEvenInteger = m3p1.GetOutPort( 'anEvenInteger' ) Om3p1Gate = m3p1.GetOutPort( 'Gate' ) - div2 = GraphGOTO_2_2.FNode( 'SyrComponent' , 'SyrComponent' , 'C_DIV2' ) + div2 = GraphGOTO1.FNode( 'SyrComponent' , 'SyrComponent' , 'C_DIV2' ) div2.SetName( 'div2' ) div2.SetAuthor( '' ) div2.SetContainer( 'localhost/FactoryServer' ) @@ -57,7 +57,7 @@ def DefGraphGOTO_2_2() : Odiv2anInteger = div2.GetOutPort( 'anInteger' ) Odiv2Gate = div2.GetOutPort( 'Gate' ) - incr = GraphGOTO_2_2.FNode( 'SyrComponent' , 'SyrComponent' , 'C_INCR' ) + incr = GraphGOTO1.FNode( 'SyrComponent' , 'SyrComponent' , 'C_INCR' ) incr.SetName( 'incr' ) incr.SetAuthor( '' ) incr.SetContainer( 'localhost/FactoryServer' ) @@ -73,7 +73,7 @@ def DefGraphGOTO_2_2() : Pylabel_begin.append( 'def label_begin( NB , KB ):' ) Pylabel_begin.append( ' print "label_begin",NB,KB' ) Pylabel_begin.append( ' return NB,KB' ) - label_begin = GraphGOTO_2_2.INode( 'label_begin' , Pylabel_begin ) + label_begin = GraphGOTO1.INode( 'label_begin' , Pylabel_begin ) label_begin.SetName( 'label_begin' ) label_begin.SetAuthor( '' ) label_begin.SetComment( 'Python function' ) @@ -89,7 +89,7 @@ def DefGraphGOTO_2_2() : 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 = GraphGOTO_2_2.INode( 'label_test' , Pylabel_test ) + label_test = GraphGOTO1.INode( 'label_test' , Pylabel_test ) label_test.SetName( 'label_test' ) label_test.SetAuthor( '' ) label_test.SetComment( 'Python function' ) @@ -122,7 +122,7 @@ def DefGraphGOTO_2_2() : Pytest.append( ' Odd = 0' ) Pytest.append( ' Even = ValEven' ) Pytest.append( ' return Finished,Incr,Even,Odd,NT,KT' ) - test,EndSwitch_OneEven = GraphGOTO_2_2.SNode( 'Switch_OneEven' , Pytest ) + test,EndSwitch_OneEven = GraphGOTO1.SNode( 'Switch_OneEven' , Pytest ) EndSwitch_OneEven.SetName( 'EndSwitch_OneEven' ) EndSwitch_OneEven.SetAuthor( '' ) EndSwitch_OneEven.SetComment( 'Compute Node' ) @@ -159,7 +159,7 @@ def DefGraphGOTO_2_2() : Pycontrol_m3p1 = [] Pycontrol_m3p1.append( 'def control_m3p1( N , K ):' ) Pycontrol_m3p1.append( ' return 0,1,N,K' ) - control_m3p1 = GraphGOTO_2_2.GNode( 'control_m3p1' , Pycontrol_m3p1 , 'label_test' ) + control_m3p1 = GraphGOTO1.GNode( 'control_m3p1' , Pycontrol_m3p1 , 'label_test' ) control_m3p1.SetName( 'control_m3p1' ) control_m3p1.SetAuthor( '' ) control_m3p1.SetComment( 'Compute Node' ) @@ -176,7 +176,7 @@ def DefGraphGOTO_2_2() : Pycontrol_div2 = [] Pycontrol_div2.append( 'def control_div2( N , NB ) :' ) Pycontrol_div2.append( ' return N,NB' ) - control_div2 = GraphGOTO_2_2.GNode( 'control_div2' , Pycontrol_div2 , 'label_begin' ) + control_div2 = GraphGOTO1.GNode( 'control_div2' , Pycontrol_div2 , 'label_begin' ) control_div2.SetName( 'control_div2' ) control_div2.SetAuthor( '' ) control_div2.SetComment( 'Compute Node' ) @@ -189,81 +189,81 @@ def DefGraphGOTO_2_2() : Ocontrol_div2Gate = control_div2.GetOutPort( 'Gate' ) # Creation of Links - Ltest_ISEVENBoolEvenlabel_testValEven = GraphGOTO_2_2.Link( Otest_ISEVENBoolEven , Ilabel_testValEven ) + Ltest_ISEVENBoolEvenlabel_testValEven = GraphGOTO1.Link( Otest_ISEVENBoolEven , Ilabel_testValEven ) Ltest_ISEVENBoolEvenlabel_testValEven.AddCoord( 1 , 369 , 273 ) Ltest_ISEVENBoolEvenlabel_testValEven.AddCoord( 2 , 370 , 498 ) - Ltest_ISONEBoolOnelabel_testValOne = GraphGOTO_2_2.Link( Otest_ISONEBoolOne , Ilabel_testValOne ) + Ltest_ISONEBoolOnelabel_testValOne = GraphGOTO1.Link( Otest_ISONEBoolOne , Ilabel_testValOne ) Ltest_ISONEBoolOnelabel_testValOne.AddCoord( 1 , 384 , 281 ) Ltest_ISONEBoolOnelabel_testValOne.AddCoord( 2 , 384 , 225 ) - Lm3p1anEvenIntegercontrol_m3p1N = GraphGOTO_2_2.Link( Om3p1anEvenInteger , Icontrol_m3p1N ) + Lm3p1anEvenIntegercontrol_m3p1N = GraphGOTO1.Link( Om3p1anEvenInteger , Icontrol_m3p1N ) - Ldiv2anIntegercontrol_div2N = GraphGOTO_2_2.Link( Odiv2anInteger , Icontrol_div2N ) + Ldiv2anIntegercontrol_div2N = GraphGOTO1.Link( Odiv2anInteger , Icontrol_div2N ) - LincraNewCountcontrol_m3p1K = GraphGOTO_2_2.Link( OincraNewCount , Icontrol_m3p1K ) + LincraNewCountcontrol_m3p1K = GraphGOTO1.Link( OincraNewCount , Icontrol_m3p1K ) LincraNewCountcontrol_m3p1K.AddCoord( 1 , 1048 , 139 ) LincraNewCountcontrol_m3p1K.AddCoord( 2 , 1048 , 241 ) - LincraNewCountcontrol_div2K = GraphGOTO_2_2.Link( OincraNewCount , Icontrol_div2K ) + LincraNewCountcontrol_div2K = GraphGOTO1.Link( OincraNewCount , Icontrol_div2K ) LincraNewCountcontrol_div2K.AddCoord( 1 , 1052 , 504 ) LincraNewCountcontrol_div2K.AddCoord( 2 , 1049 , 239 ) - Llabel_beginNTlabel_testNT = GraphGOTO_2_2.Link( Olabel_beginNT , Ilabel_testNT ) + Llabel_beginNTlabel_testNT = GraphGOTO1.Link( Olabel_beginNT , Ilabel_testNT ) - Llabel_beginNTtest_ISONEanInteger = GraphGOTO_2_2.Link( Olabel_beginNT , Itest_ISONEanInteger ) + Llabel_beginNTtest_ISONEanInteger = GraphGOTO1.Link( Olabel_beginNT , Itest_ISONEanInteger ) Llabel_beginNTtest_ISONEanInteger.AddCoord( 1 , 192 , 226 ) Llabel_beginNTtest_ISONEanInteger.AddCoord( 2 , 191 , 331 ) - Llabel_beginNTtest_ISEVENanInteger = GraphGOTO_2_2.Link( Olabel_beginNT , Itest_ISEVENanInteger ) + Llabel_beginNTtest_ISEVENanInteger = GraphGOTO1.Link( Olabel_beginNT , Itest_ISEVENanInteger ) Llabel_beginNTtest_ISEVENanInteger.AddCoord( 1 , 191 , 494 ) Llabel_beginNTtest_ISEVENanInteger.AddCoord( 2 , 192 , 331 ) - Llabel_beginKTlabel_testKT = GraphGOTO_2_2.Link( Olabel_beginKT , Ilabel_testKT ) + Llabel_beginKTlabel_testKT = GraphGOTO1.Link( Olabel_beginKT , Ilabel_testKT ) - Llabel_testValEventestValEven = GraphGOTO_2_2.Link( Olabel_testValEven , ItestValEven ) + Llabel_testValEventestValEven = GraphGOTO1.Link( Olabel_testValEven , ItestValEven ) - Llabel_testValOnetestValOne = GraphGOTO_2_2.Link( Olabel_testValOne , ItestValOne ) + Llabel_testValOnetestValOne = GraphGOTO1.Link( Olabel_testValOne , ItestValOne ) - Llabel_testNTtestNT = GraphGOTO_2_2.Link( Olabel_testNT , ItestNT ) + Llabel_testNTtestNT = GraphGOTO1.Link( Olabel_testNT , ItestNT ) - Llabel_testKTtestKT = GraphGOTO_2_2.Link( Olabel_testKT , ItestKT ) + Llabel_testKTtestKT = GraphGOTO1.Link( Olabel_testKT , ItestKT ) - LtestFinishedEndSwitch_OneEvenFinished = GraphGOTO_2_2.Link( OtestFinished , IEndSwitch_OneEvenFinished ) + LtestFinishedEndSwitch_OneEvenFinished = GraphGOTO1.Link( OtestFinished , IEndSwitch_OneEvenFinished ) - LtestEvendiv2Gate = GraphGOTO_2_2.Link( OtestEven , Idiv2Gate ) + LtestEvendiv2Gate = GraphGOTO1.Link( OtestEven , Idiv2Gate ) LtestEvendiv2Gate.AddCoord( 1 , 793 , 561 ) LtestEvendiv2Gate.AddCoord( 2 , 794 , 310 ) - LtestOddm3p1Gate = GraphGOTO_2_2.Link( OtestOdd , Im3p1Gate ) + LtestOddm3p1Gate = GraphGOTO1.Link( OtestOdd , Im3p1Gate ) LtestOddm3p1Gate.AddCoord( 1 , 778 , 138 ) LtestOddm3p1Gate.AddCoord( 2 , 780 , 328 ) - LtestNm3p1anOddInteger = GraphGOTO_2_2.Link( OtestN , Im3p1anOddInteger ) + LtestNm3p1anOddInteger = GraphGOTO1.Link( OtestN , Im3p1anOddInteger ) LtestNm3p1anOddInteger.AddCoord( 1 , 808 , 113 ) LtestNm3p1anOddInteger.AddCoord( 2 , 807 , 352 ) - LtestNdiv2anEvenInteger = GraphGOTO_2_2.Link( OtestN , Idiv2anEvenInteger ) + LtestNdiv2anEvenInteger = GraphGOTO1.Link( OtestN , Idiv2anEvenInteger ) LtestNdiv2anEvenInteger.AddCoord( 1 , 806 , 537 ) LtestNdiv2anEvenInteger.AddCoord( 2 , 807 , 351 ) - LtestKEndSwitch_OneEvenK = GraphGOTO_2_2.Link( OtestK , IEndSwitch_OneEvenK ) + LtestKEndSwitch_OneEvenK = GraphGOTO1.Link( OtestK , IEndSwitch_OneEvenK ) - LtestKincraCount = GraphGOTO_2_2.Link( OtestK , IincraCount ) + LtestKincraCount = GraphGOTO1.Link( OtestK , IincraCount ) LtestKincraCount.AddCoord( 1 , 773 , 236 ) LtestKincraCount.AddCoord( 2 , 773 , 370 ) - LtestDefaultEndSwitch_OneEvenDefault = GraphGOTO_2_2.Link( OtestDefault , IEndSwitch_OneEvenDefault ) + LtestDefaultEndSwitch_OneEvenDefault = GraphGOTO1.Link( OtestDefault , IEndSwitch_OneEvenDefault ) LtestDefaultEndSwitch_OneEvenDefault.AddCoord( 1 , 840 , 381 ) LtestDefaultEndSwitch_OneEvenDefault.AddCoord( 2 , 839 , 394 ) - Lcontrol_m3p1Gatelabel_testGate = GraphGOTO_2_2.Link( Ocontrol_m3p1Gate , Ilabel_testGate ) + Lcontrol_m3p1Gatelabel_testGate = GraphGOTO1.Link( Ocontrol_m3p1Gate , Ilabel_testGate ) Lcontrol_m3p1Gatelabel_testGate.AddCoord( 1 , 388 , 388 ) Lcontrol_m3p1Gatelabel_testGate.AddCoord( 2 , 389 , 597 ) Lcontrol_m3p1Gatelabel_testGate.AddCoord( 3 , 1441 , 604 ) Lcontrol_m3p1Gatelabel_testGate.AddCoord( 4 , 1441 , 199 ) - Lcontrol_div2Gatelabel_beginGate = GraphGOTO_2_2.Link( Ocontrol_div2Gate , Ilabel_beginGate ) + Lcontrol_div2Gatelabel_beginGate = GraphGOTO1.Link( Ocontrol_div2Gate , Ilabel_beginGate ) Lcontrol_div2Gatelabel_beginGate.AddCoord( 1 , 4 , 388 ) Lcontrol_div2Gatelabel_beginGate.AddCoord( 2 , 3 , 587 ) Lcontrol_div2Gatelabel_beginGate.AddCoord( 3 , 1307 , 586 ) @@ -277,7 +277,7 @@ def DefGraphGOTO_2_2() : #OtestIncr = test.GetOutPort( 'Incr' ) #OEndSwitch_OneEvenFinished = EndSwitch_OneEven.GetOutPort( 'Finished' ) #OEndSwitch_OneEvenK = EndSwitch_OneEven.GetOutPort( 'K' ) - return GraphGOTO_2_2 + return GraphGOTO1 -GraphGOTO_2_2 = DefGraphGOTO_2_2() +GraphGOTO1 = DefGraphGOTO1() diff --git a/examples/GraphGOTO1.xml b/examples/GraphGOTO1.xml index 7aa0df2..620e0db 100755 --- a/examples/GraphGOTO1.xml +++ b/examples/GraphGOTO1.xml @@ -5,11 +5,11 @@ ? ? - GraphGOTO_2_2 + GraphGOTO1 1 ? -GraphGOTO_2_2 +GraphGOTO_2_2_3 long @@ -30,7 +30,7 @@ 17/1/2005 - 13:44:46 - 18/1/2005 - 16:18:56 + 6/6/2005 - 14:54:25 2.0 JR ? @@ -56,8 +56,8 @@ BoolEven - 18/1/2005 - 16:18:56 - 18/1/2005 - 16:18:56 + 6/6/2005 - 14:54:25 + 6/6/2005 - 14:54:25 2.0 ? localhost/FactoryServer @@ -82,8 +82,8 @@ BoolOne - 18/1/2005 - 16:18:56 - 18/1/2005 - 16:18:56 + 6/6/2005 - 14:54:25 + 6/6/2005 - 14:54:25 2.0 ? localhost/FactoryServer @@ -108,8 +108,8 @@ anEvenInteger - 18/1/2005 - 16:18:56 - 18/1/2005 - 16:18:56 + 6/6/2005 - 14:54:25 + 6/6/2005 - 14:54:25 2.0 ? localhost/FactoryServer @@ -134,8 +134,8 @@ anInteger - 18/1/2005 - 16:18:56 - 18/1/2005 - 16:18:56 + 6/6/2005 - 14:54:25 + 6/6/2005 - 14:54:25 2.0 ? localhost/FactoryServer @@ -160,8 +160,8 @@ aNewCount - 18/1/2005 - 16:18:56 - 18/1/2005 - 16:18:56 + 6/6/2005 - 14:54:25 + 6/6/2005 - 14:54:25 2.0 ? localhost/FactoryServer @@ -197,8 +197,8 @@ - 18/1/2005 - 16:18:56 - 18/1/2005 - 16:18:56 + 6/6/2005 - 14:54:25 + 6/6/2005 - 14:54:25 2.0 ? ? @@ -246,8 +246,8 @@ - 18/1/2005 - 16:18:56 - 18/1/2005 - 16:18:56 + 6/6/2005 - 14:54:25 + 6/6/2005 - 14:54:25 2.0 ? ? @@ -313,8 +313,8 @@ - 18/1/2005 - 16:18:56 - 18/1/2005 - 16:18:56 + 6/6/2005 - 14:54:25 + 6/6/2005 - 14:54:25 2.0 ? ? @@ -350,8 +350,8 @@ - 18/1/2005 - 16:18:56 - 18/1/2005 - 16:18:56 + 6/6/2005 - 14:54:25 + 6/6/2005 - 14:54:25 2.0 ? ? @@ -392,8 +392,8 @@ control_m3p1 - 18/1/2005 - 16:18:56 - 18/1/2005 - 16:18:56 + 6/6/2005 - 14:54:25 + 6/6/2005 - 14:54:25 2.0 ? ? @@ -428,8 +428,8 @@ control_div2 - 18/1/2005 - 16:18:56 - 18/1/2005 - 16:18:56 + 6/6/2005 - 14:54:25 + 6/6/2005 - 14:54:25 2.0 ? ? @@ -679,7 +679,7 @@ 528 -GraphGOTO_2_2 +GraphGOTO1 label_begin__NB label_begin NB @@ -688,7 +688,7 @@ 7 -GraphGOTO_2_2 +GraphGOTO1 label_begin__KB label_begin KB diff --git a/examples/GraphGOTOAborted.py b/examples/GraphGOTOAborted.py index 95519b9..f9dc8b3 100644 --- a/examples/GraphGOTOAborted.py +++ b/examples/GraphGOTOAborted.py @@ -1,19 +1,19 @@ -# Generated python file of Graph GraphGOTO_2_2 +# Generated python file of Graph GraphGOTOAborted from SuperV import * -# Graph creation of GraphGOTO_2_2 -def DefGraphGOTO_2_2() : - GraphGOTO_2_2 = Graph( 'GraphGOTO_2_2' ) - GraphGOTO_2_2.SetName( 'GraphGOTO_2_2' ) - GraphGOTO_2_2.SetAuthor( 'JR' ) - GraphGOTO_2_2.SetComment( 'Syracuse algorithm' ) - GraphGOTO_2_2.Coords( 0 , 0 ) +# Graph creation of GraphGOTOAborted +def DefGraphGOTOAborted() : + GraphGOTOAborted = Graph( 'GraphGOTOAborted' ) + GraphGOTOAborted.SetName( 'GraphGOTOAborted' ) + GraphGOTOAborted.SetAuthor( 'JR' ) + GraphGOTOAborted.SetComment( 'Syracuse algorithm' ) + GraphGOTOAborted.Coords( 0 , 0 ) # Creation of Factory Nodes - test_ISEVEN = GraphGOTO_2_2.FNode( 'SyrComponent' , 'SyrComponent' , 'C_ISEVEN' ) + test_ISEVEN = GraphGOTOAborted.FNode( 'SyrComponent' , 'SyrComponent' , 'C_ISEVEN' ) test_ISEVEN.SetName( 'test_ISEVEN' ) test_ISEVEN.SetAuthor( '' ) test_ISEVEN.SetContainer( 'localhost/FactoryServer' ) @@ -24,7 +24,7 @@ def DefGraphGOTO_2_2() : Otest_ISEVENBoolEven = test_ISEVEN.GetOutPort( 'BoolEven' ) Otest_ISEVENGate = test_ISEVEN.GetOutPort( 'Gate' ) - test_ISONE = GraphGOTO_2_2.FNode( 'SyrComponent' , 'SyrComponent' , 'C_ISONE' ) + test_ISONE = GraphGOTOAborted.FNode( 'SyrComponent' , 'SyrComponent' , 'C_ISONE' ) test_ISONE.SetName( 'test_ISONE' ) test_ISONE.SetAuthor( '' ) test_ISONE.SetContainer( 'localhost/FactoryServer' ) @@ -35,7 +35,7 @@ def DefGraphGOTO_2_2() : Otest_ISONEBoolOne = test_ISONE.GetOutPort( 'BoolOne' ) Otest_ISONEGate = test_ISONE.GetOutPort( 'Gate' ) - m3p1 = GraphGOTO_2_2.FNode( 'SyrComponent' , 'SyrComponent' , 'C_M3P1' ) + m3p1 = GraphGOTOAborted.FNode( 'SyrComponent' , 'SyrComponent' , 'C_M3P1' ) m3p1.SetName( 'm3p1' ) m3p1.SetAuthor( '' ) m3p1.SetContainer( 'localhost/FactoryServer' ) @@ -46,7 +46,7 @@ def DefGraphGOTO_2_2() : Om3p1anEvenInteger = m3p1.GetOutPort( 'anEvenInteger' ) Om3p1Gate = m3p1.GetOutPort( 'Gate' ) - div2 = GraphGOTO_2_2.FNode( 'SyrComponent' , 'SyrComponent' , 'C_DIV2' ) + div2 = GraphGOTOAborted.FNode( 'SyrComponent' , 'SyrComponent' , 'C_DIV2' ) div2.SetName( 'div2' ) div2.SetAuthor( '' ) div2.SetContainer( 'localhost/FactoryServer' ) @@ -57,7 +57,7 @@ def DefGraphGOTO_2_2() : Odiv2anInteger = div2.GetOutPort( 'anInteger' ) Odiv2Gate = div2.GetOutPort( 'Gate' ) - incr = GraphGOTO_2_2.FNode( 'SyrComponent' , 'SyrComponent' , 'C_INCR' ) + incr = GraphGOTOAborted.FNode( 'SyrComponent' , 'SyrComponent' , 'C_INCR' ) incr.SetName( 'incr' ) incr.SetAuthor( '' ) incr.SetContainer( 'localhost/FactoryServer' ) @@ -73,7 +73,7 @@ def DefGraphGOTO_2_2() : Pylabel_begin.append( 'def label_begin( NB , KB ):' ) Pylabel_begin.append( ' print "label_begin",NB,KB' ) Pylabel_begin.append( ' return NB,KB' ) - label_begin = GraphGOTO_2_2.INode( 'label_begin' , Pylabel_begin ) + label_begin = GraphGOTOAborted.INode( 'label_begin' , Pylabel_begin ) label_begin.SetName( 'label_begin' ) label_begin.SetAuthor( '' ) label_begin.SetComment( 'Python function' ) @@ -89,7 +89,7 @@ def DefGraphGOTO_2_2() : 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 = GraphGOTO_2_2.INode( 'label_test' , Pylabel_test ) + label_test = GraphGOTOAborted.INode( 'label_test' , Pylabel_test ) label_test.SetName( 'label_test' ) label_test.SetAuthor( '' ) label_test.SetComment( 'Python function' ) @@ -122,7 +122,7 @@ def DefGraphGOTO_2_2() : Pytest.append( ' Odd = 0' ) Pytest.append( ' Even = ValEven' ) Pytest.append( ' return Finished,Incr,Even,Odd,NT,KT' ) - test,EndSwitch_OneEven = GraphGOTO_2_2.SNode( 'Switch_OneEven' , Pytest ) + test,EndSwitch_OneEven = GraphGOTOAborted.SNode( 'Switch_OneEven' , Pytest ) EndSwitch_OneEven.SetName( 'EndSwitch_OneEven' ) EndSwitch_OneEven.SetAuthor( '' ) EndSwitch_OneEven.SetComment( 'Compute Node' ) @@ -159,7 +159,7 @@ def DefGraphGOTO_2_2() : Pycontrol_m3p1 = [] Pycontrol_m3p1.append( 'def control_m3p1( N , K ):' ) Pycontrol_m3p1.append( ' return 0,1,N,K' ) - control_m3p1 = GraphGOTO_2_2.GNode( 'control_m3p1' , Pycontrol_m3p1 , 'label_test' ) + control_m3p1 = GraphGOTOAborted.GNode( 'control_m3p1' , Pycontrol_m3p1 , 'label_test' ) control_m3p1.SetName( 'control_m3p1' ) control_m3p1.SetAuthor( '' ) control_m3p1.SetComment( 'Compute Node' ) @@ -176,7 +176,7 @@ def DefGraphGOTO_2_2() : Pycontrol_div2 = [] Pycontrol_div2.append( 'def control_div2( N , NB ) :' ) Pycontrol_div2.append( ' return N,NB' ) - control_div2 = GraphGOTO_2_2.GNode( 'control_div2' , Pycontrol_div2 , 'label_begin' ) + control_div2 = GraphGOTOAborted.GNode( 'control_div2' , Pycontrol_div2 , 'label_begin' ) control_div2.SetName( 'control_div2' ) control_div2.SetAuthor( '' ) control_div2.SetComment( 'Compute Node' ) @@ -189,83 +189,83 @@ def DefGraphGOTO_2_2() : Ocontrol_div2Gate = control_div2.GetOutPort( 'Gate' ) # Creation of Links - Ltest_ISEVENBoolEvenlabel_testValEven = GraphGOTO_2_2.Link( Otest_ISEVENBoolEven , Ilabel_testValEven ) + Ltest_ISEVENBoolEvenlabel_testValEven = GraphGOTOAborted.Link( Otest_ISEVENBoolEven , Ilabel_testValEven ) Ltest_ISEVENBoolEvenlabel_testValEven.AddCoord( 1 , 369 , 273 ) Ltest_ISEVENBoolEvenlabel_testValEven.AddCoord( 2 , 370 , 498 ) - Ltest_ISONEBoolOnelabel_testValOne = GraphGOTO_2_2.Link( Otest_ISONEBoolOne , Ilabel_testValOne ) + Ltest_ISONEBoolOnelabel_testValOne = GraphGOTOAborted.Link( Otest_ISONEBoolOne , Ilabel_testValOne ) Ltest_ISONEBoolOnelabel_testValOne.AddCoord( 1 , 384 , 281 ) Ltest_ISONEBoolOnelabel_testValOne.AddCoord( 2 , 384 , 225 ) - Lm3p1anEvenIntegercontrol_m3p1N = GraphGOTO_2_2.Link( Om3p1anEvenInteger , Icontrol_m3p1N ) + Lm3p1anEvenIntegercontrol_m3p1N = GraphGOTOAborted.Link( Om3p1anEvenInteger , Icontrol_m3p1N ) - Ldiv2anIntegercontrol_div2N = GraphGOTO_2_2.Link( Odiv2anInteger , Icontrol_div2N ) + Ldiv2anIntegercontrol_div2N = GraphGOTOAborted.Link( Odiv2anInteger , Icontrol_div2N ) - LincraNewCountcontrol_m3p1K = GraphGOTO_2_2.Link( OincraNewCount , Icontrol_m3p1K ) + LincraNewCountcontrol_m3p1K = GraphGOTOAborted.Link( OincraNewCount , Icontrol_m3p1K ) LincraNewCountcontrol_m3p1K.AddCoord( 1 , 1048 , 139 ) LincraNewCountcontrol_m3p1K.AddCoord( 2 , 1048 , 241 ) - LincraNewCountcontrol_div2K = GraphGOTO_2_2.Link( OincraNewCount , Icontrol_div2K ) + LincraNewCountcontrol_div2K = GraphGOTOAborted.Link( OincraNewCount , Icontrol_div2K ) LincraNewCountcontrol_div2K.AddCoord( 1 , 1052 , 504 ) LincraNewCountcontrol_div2K.AddCoord( 2 , 1049 , 239 ) - Llabel_beginNTlabel_testNT = GraphGOTO_2_2.Link( Olabel_beginNT , Ilabel_testNT ) + Llabel_beginNTlabel_testNT = GraphGOTOAborted.Link( Olabel_beginNT , Ilabel_testNT ) - Llabel_beginNTtest_ISONEanInteger = GraphGOTO_2_2.Link( Olabel_beginNT , Itest_ISONEanInteger ) + Llabel_beginNTtest_ISONEanInteger = GraphGOTOAborted.Link( Olabel_beginNT , Itest_ISONEanInteger ) Llabel_beginNTtest_ISONEanInteger.AddCoord( 1 , 192 , 226 ) Llabel_beginNTtest_ISONEanInteger.AddCoord( 2 , 191 , 331 ) - Llabel_beginNTtest_ISEVENanInteger = GraphGOTO_2_2.Link( Olabel_beginNT , Itest_ISEVENanInteger ) + Llabel_beginNTtest_ISEVENanInteger = GraphGOTOAborted.Link( Olabel_beginNT , Itest_ISEVENanInteger ) Llabel_beginNTtest_ISEVENanInteger.AddCoord( 1 , 191 , 494 ) Llabel_beginNTtest_ISEVENanInteger.AddCoord( 2 , 192 , 331 ) - Llabel_beginKTlabel_testKT = GraphGOTO_2_2.Link( Olabel_beginKT , Ilabel_testKT ) + Llabel_beginKTlabel_testKT = GraphGOTOAborted.Link( Olabel_beginKT , Ilabel_testKT ) - Llabel_testValEventestValEven = GraphGOTO_2_2.Link( Olabel_testValEven , ItestValEven ) + Llabel_testValEventestValEven = GraphGOTOAborted.Link( Olabel_testValEven , ItestValEven ) - Llabel_testValOnetestValOne = GraphGOTO_2_2.Link( Olabel_testValOne , ItestValOne ) + Llabel_testValOnetestValOne = GraphGOTOAborted.Link( Olabel_testValOne , ItestValOne ) - Llabel_testNTtestNT = GraphGOTO_2_2.Link( Olabel_testNT , ItestNT ) + Llabel_testNTtestNT = GraphGOTOAborted.Link( Olabel_testNT , ItestNT ) - Llabel_testKTtestKT = GraphGOTO_2_2.Link( Olabel_testKT , ItestKT ) + Llabel_testKTtestKT = GraphGOTOAborted.Link( Olabel_testKT , ItestKT ) - LtestFinishedEndSwitch_OneEvenFinished = GraphGOTO_2_2.Link( OtestFinished , IEndSwitch_OneEvenFinished ) + LtestFinishedEndSwitch_OneEvenFinished = GraphGOTOAborted.Link( OtestFinished , IEndSwitch_OneEvenFinished ) - LtestIncrincrGate = GraphGOTO_2_2.Link( OtestIncr , IincrGate ) + LtestIncrincrGate = GraphGOTOAborted.Link( OtestIncr , IincrGate ) - LtestEvendiv2Gate = GraphGOTO_2_2.Link( OtestEven , Idiv2Gate ) + LtestEvendiv2Gate = GraphGOTOAborted.Link( OtestEven , Idiv2Gate ) LtestEvendiv2Gate.AddCoord( 1 , 793 , 561 ) LtestEvendiv2Gate.AddCoord( 2 , 794 , 310 ) - LtestOddm3p1Gate = GraphGOTO_2_2.Link( OtestOdd , Im3p1Gate ) + LtestOddm3p1Gate = GraphGOTOAborted.Link( OtestOdd , Im3p1Gate ) LtestOddm3p1Gate.AddCoord( 1 , 778 , 138 ) LtestOddm3p1Gate.AddCoord( 2 , 780 , 328 ) - LtestNm3p1anOddInteger = GraphGOTO_2_2.Link( OtestN , Im3p1anOddInteger ) + LtestNm3p1anOddInteger = GraphGOTOAborted.Link( OtestN , Im3p1anOddInteger ) LtestNm3p1anOddInteger.AddCoord( 1 , 808 , 113 ) LtestNm3p1anOddInteger.AddCoord( 2 , 807 , 352 ) - LtestNdiv2anEvenInteger = GraphGOTO_2_2.Link( OtestN , Idiv2anEvenInteger ) + LtestNdiv2anEvenInteger = GraphGOTOAborted.Link( OtestN , Idiv2anEvenInteger ) LtestNdiv2anEvenInteger.AddCoord( 1 , 806 , 537 ) LtestNdiv2anEvenInteger.AddCoord( 2 , 807 , 351 ) - LtestKEndSwitch_OneEvenK = GraphGOTO_2_2.Link( OtestK , IEndSwitch_OneEvenK ) + LtestKEndSwitch_OneEvenK = GraphGOTOAborted.Link( OtestK , IEndSwitch_OneEvenK ) - LtestKincraCount = GraphGOTO_2_2.Link( OtestK , IincraCount ) + LtestKincraCount = GraphGOTOAborted.Link( OtestK , IincraCount ) LtestKincraCount.AddCoord( 1 , 773 , 236 ) LtestKincraCount.AddCoord( 2 , 773 , 370 ) - LtestDefaultEndSwitch_OneEvenDefault = GraphGOTO_2_2.Link( OtestDefault , IEndSwitch_OneEvenDefault ) + LtestDefaultEndSwitch_OneEvenDefault = GraphGOTOAborted.Link( OtestDefault , IEndSwitch_OneEvenDefault ) LtestDefaultEndSwitch_OneEvenDefault.AddCoord( 1 , 840 , 381 ) LtestDefaultEndSwitch_OneEvenDefault.AddCoord( 2 , 839 , 394 ) - Lcontrol_m3p1Gatelabel_testGate = GraphGOTO_2_2.Link( Ocontrol_m3p1Gate , Ilabel_testGate ) + Lcontrol_m3p1Gatelabel_testGate = GraphGOTOAborted.Link( Ocontrol_m3p1Gate , Ilabel_testGate ) Lcontrol_m3p1Gatelabel_testGate.AddCoord( 1 , 388 , 388 ) Lcontrol_m3p1Gatelabel_testGate.AddCoord( 2 , 389 , 597 ) Lcontrol_m3p1Gatelabel_testGate.AddCoord( 3 , 1441 , 604 ) Lcontrol_m3p1Gatelabel_testGate.AddCoord( 4 , 1441 , 199 ) - Lcontrol_div2Gatelabel_beginGate = GraphGOTO_2_2.Link( Ocontrol_div2Gate , Ilabel_beginGate ) + Lcontrol_div2Gatelabel_beginGate = GraphGOTOAborted.Link( Ocontrol_div2Gate , Ilabel_beginGate ) Lcontrol_div2Gatelabel_beginGate.AddCoord( 1 , 4 , 388 ) Lcontrol_div2Gatelabel_beginGate.AddCoord( 2 , 3 , 587 ) Lcontrol_div2Gatelabel_beginGate.AddCoord( 3 , 1307 , 586 ) @@ -278,7 +278,7 @@ def DefGraphGOTO_2_2() : # Output Ports of the graph #OEndSwitch_OneEvenFinished = EndSwitch_OneEven.GetOutPort( 'Finished' ) #OEndSwitch_OneEvenK = EndSwitch_OneEven.GetOutPort( 'K' ) - return GraphGOTO_2_2 + return GraphGOTOAborted -GraphGOTO_2_2 = DefGraphGOTO_2_2() +GraphGOTOAborted = DefGraphGOTOAborted() diff --git a/examples/GraphGOTOAborted.xml b/examples/GraphGOTOAborted.xml index 2f25ecd..02feebc 100644 --- a/examples/GraphGOTOAborted.xml +++ b/examples/GraphGOTOAborted.xml @@ -5,11 +5,11 @@ ? ? - GraphGOTO_2_2 + GraphGOTOAborted 1 ? -GraphGOTO_2_2 +GraphGOTO_2_2_2 long @@ -27,7 +27,7 @@ 17/1/2005 - 13:44:46 - 19/1/2005 - 18:25:16 + 6/6/2005 - 14:53:29 2.0 JR ? @@ -53,8 +53,8 @@ BoolEven - 19/1/2005 - 18:24:34 - 19/1/2005 - 18:24:34 + 6/6/2005 - 14:53:29 + 6/6/2005 - 14:53:29 2.0 ? localhost/FactoryServer @@ -79,8 +79,8 @@ BoolOne - 19/1/2005 - 18:24:34 - 19/1/2005 - 18:24:34 + 6/6/2005 - 14:53:29 + 6/6/2005 - 14:53:29 2.0 ? localhost/FactoryServer @@ -105,8 +105,8 @@ anEvenInteger - 19/1/2005 - 18:24:34 - 19/1/2005 - 18:24:34 + 6/6/2005 - 14:53:29 + 6/6/2005 - 14:53:29 2.0 ? localhost/FactoryServer @@ -131,8 +131,8 @@ anInteger - 19/1/2005 - 18:24:34 - 19/1/2005 - 18:24:34 + 6/6/2005 - 14:53:29 + 6/6/2005 - 14:53:29 2.0 ? localhost/FactoryServer @@ -157,8 +157,8 @@ aNewCount - 19/1/2005 - 18:24:34 - 19/1/2005 - 18:24:34 + 6/6/2005 - 14:53:29 + 6/6/2005 - 14:53:29 2.0 ? localhost/FactoryServer @@ -194,8 +194,8 @@ - 19/1/2005 - 18:24:34 - 19/1/2005 - 18:24:34 + 6/6/2005 - 14:53:29 + 6/6/2005 - 14:53:29 2.0 ? ? @@ -243,8 +243,8 @@ - 19/1/2005 - 18:24:34 - 19/1/2005 - 18:24:34 + 6/6/2005 - 14:53:29 + 6/6/2005 - 14:53:29 2.0 ? ? @@ -310,8 +310,8 @@ - 19/1/2005 - 18:24:34 - 19/1/2005 - 18:24:34 + 6/6/2005 - 14:53:29 + 6/6/2005 - 14:53:29 2.0 ? ? @@ -347,8 +347,8 @@ - 19/1/2005 - 18:24:34 - 19/1/2005 - 18:24:34 + 6/6/2005 - 14:53:29 + 6/6/2005 - 14:53:29 2.0 ? ? @@ -389,8 +389,8 @@ control_m3p1 - 19/1/2005 - 18:24:34 - 19/1/2005 - 18:24:34 + 6/6/2005 - 14:53:29 + 6/6/2005 - 14:53:29 2.0 ? ? @@ -425,8 +425,8 @@ control_div2 - 19/1/2005 - 18:24:34 - 19/1/2005 - 18:24:34 + 6/6/2005 - 14:53:29 + 6/6/2005 - 14:53:29 2.0 ? ? @@ -682,7 +682,7 @@ 528 -GraphGOTO_2_2 +GraphGOTOAborted label_begin__NB label_begin NB @@ -691,7 +691,7 @@ 7 -GraphGOTO_2_2 +GraphGOTOAborted label_begin__KB label_begin KB diff --git a/examples/GraphGOTOAddMemory.py b/examples/GraphGOTOAddMemory.py new file mode 100644 index 0000000..5484a36 --- /dev/null +++ b/examples/GraphGOTOAddMemory.py @@ -0,0 +1,68 @@ + +# Generated python file of Graph GraphGOTOAddMemory + +from SuperV import * + +# Graph creation of GraphGOTOAddMemory +def DefGraphGOTOAddMemory() : + GraphGOTOAddMemory = Graph( 'GraphGOTOAddMemory' ) + GraphGOTOAddMemory.SetName( 'GraphGOTOAddMemory' ) + GraphGOTOAddMemory.SetAuthor( 'JR' ) + GraphGOTOAddMemory.SetComment( 'To study memory leaks' ) + GraphGOTOAddMemory.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + AddWithoutSleep = GraphGOTOAddMemory.FNode( 'AddComponent' , 'AddComponent' , 'AddWithoutSleep' ) + AddWithoutSleep.SetName( 'AddWithoutSleep' ) + AddWithoutSleep.SetAuthor( '' ) + AddWithoutSleep.SetContainer( 'localhost/FactoryServer' ) + AddWithoutSleep.SetComment( 'AddWithoutSleep from AddComponent' ) + AddWithoutSleep.Coords( 297 , 138 ) + IAddWithoutSleepx = AddWithoutSleep.GetInPort( 'x' ) + IAddWithoutSleepy = AddWithoutSleep.GetInPort( 'y' ) + IAddWithoutSleepGate = AddWithoutSleep.GetInPort( 'Gate' ) + OAddWithoutSleepFuncValue = AddWithoutSleep.GetOutPort( 'FuncValue' ) + OAddWithoutSleepz = AddWithoutSleep.GetOutPort( 'z' ) + OAddWithoutSleepGate = AddWithoutSleep.GetOutPort( 'Gate' ) + + # Creation of InLine Nodes + PyInLine = [] + InLine = GraphGOTOAddMemory.INode( '' , PyInLine ) + InLine.SetName( 'InLine' ) + InLine.SetAuthor( '' ) + InLine.SetComment( 'Compute Node' ) + InLine.Coords( 74 , 178 ) + IInLineGate = InLine.GetInPort( 'Gate' ) + OInLineGate = InLine.GetOutPort( 'Gate' ) + + # Creation of GOTO Nodes + PyGoTo = [] + GoTo = GraphGOTOAddMemory.GNode( '' , PyGoTo , 'InLine' ) + GoTo.SetName( 'GoTo' ) + GoTo.SetAuthor( '' ) + GoTo.SetComment( 'Compute Node' ) + GoTo.Coords( 533 , 218 ) + IGoToGate = GoTo.GetInPort( 'Gate' ) + OGoToGate = GoTo.GetOutPort( 'Gate' ) + + # Creation of Links + LInLineGateAddWithoutSleepGate = GraphGOTOAddMemory.Link( OInLineGate , IAddWithoutSleepGate ) + + LGoToGateInLineGate = GraphGOTOAddMemory.Link( OGoToGate , IInLineGate ) + LGoToGateInLineGate.AddCoord( 1 , 69 , 420 ) + LGoToGateInLineGate.AddCoord( 2 , 700 , 420 ) + + LAddWithoutSleepGateGoToGate = GraphGOTOAddMemory.Link( OAddWithoutSleepGate , IGoToGate ) + + # Input datas + IAddWithoutSleepx.Input( 1 ) + IAddWithoutSleepy.Input( 2 ) + + # Output Ports of the graph + #OAddWithoutSleepFuncValue = AddWithoutSleep.GetOutPort( 'FuncValue' ) + #OAddWithoutSleepz = AddWithoutSleep.GetOutPort( 'z' ) + return GraphGOTOAddMemory + + +GraphGOTOAddMemory = DefGraphGOTOAddMemory() diff --git a/examples/GraphGOTOAddMemory.xml b/examples/GraphGOTOAddMemory.xml new file mode 100644 index 0000000..02c082b --- /dev/null +++ b/examples/GraphGOTOAddMemory.xml @@ -0,0 +1,159 @@ + + + + + +? + ? + GraphGOTOAddMemory + 1 + ? + +GraphGOTOAddMemory_1 + + +double + AddWithoutSleep__x + +double + AddWithoutSleep__y + + +double + AddWithoutSleep__FuncValue + +double + AddWithoutSleep__z + + + 17/2/2005 - 14:8:55 + 21/2/2005 - 10:9:51 + 2.0 + JR + ? + To study memory leaks + 0 + 0 + + +? + ? + InLine + 3 + ? + +InLine + + + + + +? + + 21/2/2005 - 10:9:51 + 21/2/2005 - 10:9:51 + 2.0 + ? + ? + Compute Node + 74 + 178 + +? + ? + GoTo + 8 + InLine + +GoTo + + + + + +? + + 21/2/2005 - 10:9:51 + 21/2/2005 - 10:9:51 + 2.0 + ? + ? + Compute Node + 533 + 218 + +AddComponent + AddComponent + AddWithoutSleep + 0 + ? + +AddWithoutSleep + + +double + x + +double + y + + +double + FuncValue + +double + z + + + 21/2/2005 - 10:9:51 + 21/2/2005 - 10:9:51 + 2.0 + ? + localhost/FactoryServer + AddWithoutSleep from AddComponent + 297 + 138 + + +InLine + Gate + AddWithoutSleep + Gate + + +GoTo + Gate + InLine + Gate + + +69 + 420 + +700 + 420 + +AddWithoutSleep + Gate + GoTo + Gate + + + +GraphGOTOAddMemory + AddWithoutSleep__x + AddWithoutSleep + x + +7 + 1 + + +GraphGOTOAddMemory + AddWithoutSleep__y + AddWithoutSleep + y + +7 + 2 + diff --git a/examples/GraphGOTOMemory.py b/examples/GraphGOTOMemory.py new file mode 100644 index 0000000..45d24c7 --- /dev/null +++ b/examples/GraphGOTOMemory.py @@ -0,0 +1,47 @@ + +# Generated python file of Graph GraphGOTOMemory + +from SuperV import * + +# Graph creation of GraphGOTOMemory +def DefGraphGOTOMemory() : + GraphGOTOMemory = Graph( 'GraphGOTOMemory' ) + GraphGOTOMemory.SetName( 'GraphGOTOMemory' ) + GraphGOTOMemory.SetAuthor( 'JR' ) + GraphGOTOMemory.SetComment( 'To study memory leaks' ) + GraphGOTOMemory.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyInLine = [] + InLine = GraphGOTOMemory.INode( '' , PyInLine ) + InLine.SetName( 'InLine' ) + InLine.SetAuthor( '' ) + InLine.SetComment( 'Compute Node' ) + InLine.Coords( 74 , 178 ) + IInLineGate = InLine.GetInPort( 'Gate' ) + OInLineGate = InLine.GetOutPort( 'Gate' ) + + # Creation of GOTO Nodes + PyGoTo = [] + GoTo = GraphGOTOMemory.GNode( '' , PyGoTo , 'InLine' ) + GoTo.SetName( 'GoTo' ) + GoTo.SetAuthor( '' ) + GoTo.SetComment( 'Compute Node' ) + GoTo.Coords( 533 , 218 ) + IGoToGate = GoTo.GetInPort( 'Gate' ) + OGoToGate = GoTo.GetOutPort( 'Gate' ) + + # Creation of Links + LInLineGateGoToGate = GraphGOTOMemory.Link( OInLineGate , IGoToGate ) + + LGoToGateInLineGate = GraphGOTOMemory.Link( OGoToGate , IInLineGate ) + LGoToGateInLineGate.AddCoord( 1 , 69 , 420 ) + LGoToGateInLineGate.AddCoord( 2 , 700 , 420 ) + + # Output Ports of the graph + return GraphGOTOMemory + + +GraphGOTOMemory = DefGraphGOTOMemory() diff --git a/examples/GraphGOTOMemory.xml b/examples/GraphGOTOMemory.xml new file mode 100644 index 0000000..d9a98a9 --- /dev/null +++ b/examples/GraphGOTOMemory.xml @@ -0,0 +1,91 @@ + + + + + +? + ? + GraphGOTOMemory + 1 + ? + +GraphGOTOAddMemory_2 + + + + + 17/2/2005 - 14:8:55 + 21/2/2005 - 10:10:15 + 2.0 + JR + ? + To study memory leaks + 0 + 0 + + +? + ? + InLine + 3 + ? + +InLine + + + + + +? + + 21/2/2005 - 10:10:15 + 21/2/2005 - 10:10:15 + 2.0 + ? + ? + Compute Node + 74 + 178 + +? + ? + GoTo + 8 + InLine + +GoTo + + + + + +? + + 21/2/2005 - 10:10:15 + 21/2/2005 - 10:10:15 + 2.0 + ? + ? + Compute Node + 533 + 218 + + +InLine + Gate + GoTo + Gate + + +GoTo + Gate + InLine + Gate + + +69 + 420 + +700 + 420 + diff --git a/examples/GraphInputInLoop.py b/examples/GraphInputInLoop.py index eff96a9..a228eb3 100644 --- a/examples/GraphInputInLoop.py +++ b/examples/GraphInputInLoop.py @@ -1,15 +1,15 @@ -# Generated python file of Graph GraphInputInLoop_2 +# Generated python file of Graph GraphInputInLoop_2_1 from SuperV import * -# Graph creation of GraphInputInLoop_2 -def DefGraphInputInLoop_2() : - GraphInputInLoop_2 = Graph( 'GraphInputInLoop_2' ) - GraphInputInLoop_2.SetName( 'GraphInputInLoop_2' ) - GraphInputInLoop_2.SetAuthor( '' ) - GraphInputInLoop_2.SetComment( '' ) - GraphInputInLoop_2.Coords( 0 , 0 ) +# Graph creation of GraphInputInLoop_2_1 +def DefGraphInputInLoop_2_1() : + GraphInputInLoop_2_1 = Graph( 'GraphInputInLoop_2_1' ) + GraphInputInLoop_2_1.SetName( 'GraphInputInLoop_2_1' ) + GraphInputInLoop_2_1.SetAuthor( '' ) + GraphInputInLoop_2_1.SetComment( '' ) + GraphInputInLoop_2_1.Coords( 0 , 0 ) # Creation of Factory Nodes @@ -20,11 +20,11 @@ def DefGraphInputInLoop_2() : PyIsOdd.append( ' print 'IsOdd',a,Even,Const ' ) PyIsOdd.append( ' sleep( 1 ) ' ) PyIsOdd.append( ' return a,Const ' ) - IsOdd = GraphInputInLoop_2.INode( 'IsOdd' , PyIsOdd ) + IsOdd = GraphInputInLoop_2_1.INode( 'IsOdd' , PyIsOdd ) IsOdd.SetName( 'IsOdd' ) IsOdd.SetAuthor( '' ) IsOdd.SetComment( 'Python function' ) - IsOdd.Coords( 397 , 1 ) + IsOdd.Coords( 397 , 5 ) IIsOdda = IsOdd.InPort( 'a' , 'long' ) IIsOddEven = IsOdd.InPort( 'Even' , 'boolean' ) IIsOddConst = IsOdd.InPort( 'Const' , 'string' ) @@ -39,11 +39,11 @@ def DefGraphInputInLoop_2() : PyMoreInitLoop.append( '' ) PyNextInitLoop = [] PyNextInitLoop.append( '' ) - InitLoop,EndOfInitLoop = GraphInputInLoop_2.LNode( '' , PyInitLoop , '' , PyMoreInitLoop , '' , PyNextInitLoop ) + InitLoop,EndOfInitLoop = GraphInputInLoop_2_1.LNode( '' , PyInitLoop , '' , PyMoreInitLoop , '' , PyNextInitLoop ) EndOfInitLoop.SetName( 'EndOfInitLoop' ) EndOfInitLoop.SetAuthor( '' ) EndOfInitLoop.SetComment( 'Compute Node' ) - EndOfInitLoop.Coords( 767 , 105 ) + EndOfInitLoop.Coords( 770 , 147 ) PyEndOfInitLoop = [] PyEndOfInitLoop.append( 'def EndOfInitLoop( DoLoop , Index , Min , Max ) :' ) PyEndOfInitLoop.append( ' Index = Index + 1 ' ) @@ -84,11 +84,11 @@ def DefGraphInputInLoop_2() : PySwitch.append( ' if ( a & 1 ) == 0 : ' ) PySwitch.append( ' sleep(1) ' ) PySwitch.append( ' return a & 1,1-(a&1),a ' ) - Switch,EndSwitch = GraphInputInLoop_2.SNode( 'Switch' , PySwitch ) + Switch,EndSwitch = GraphInputInLoop_2_1.SNode( 'Switch' , PySwitch ) EndSwitch.SetName( 'EndSwitch' ) EndSwitch.SetAuthor( '' ) EndSwitch.SetComment( 'Compute Node' ) - EndSwitch.Coords( 587 , 105 ) + EndSwitch.Coords( 588 , 147 ) PyEndSwitch = [] PyEndSwitch.append( 'def EndSwitch(a) : ' ) PyEndSwitch.append( ' if ( a & 1 ) == 0 : ' ) @@ -111,42 +111,40 @@ def DefGraphInputInLoop_2() : OSwitchDefault = Switch.GetOutPort( 'Default' ) # Creation of Links - LIsOddaEndSwitcha = GraphInputInLoop_2.Link( OIsOdda , IEndSwitcha ) - LIsOddaEndSwitcha.AddCoord( 1 , 576 , 136 ) - LIsOddaEndSwitcha.AddCoord( 2 , 576 , 73 ) + LIsOddaEndSwitcha = GraphInputInLoop_2_1.Link( OIsOdda , IEndSwitcha ) + LIsOddaEndSwitcha.AddCoord( 1 , 573 , 178 ) + LIsOddaEndSwitcha.AddCoord( 2 , 573 , 76 ) - LInitLoopIndexSwitcha = GraphInputInLoop_2.Link( OInitLoopIndex , ISwitcha ) + LInitLoopIndexSwitcha = GraphInputInLoop_2_1.Link( OInitLoopIndex , ISwitcha ) - LInitLoopMinEndOfInitLoopMin = GraphInputInLoop_2.Link( OInitLoopMin , IEndOfInitLoopMin ) + LInitLoopMinEndOfInitLoopMin = GraphInputInLoop_2_1.Link( OInitLoopMin , IEndOfInitLoopMin ) - LInitLoopMaxEndOfInitLoopMax = GraphInputInLoop_2.Link( OInitLoopMax , IEndOfInitLoopMax ) + LInitLoopMaxEndOfInitLoopMax = GraphInputInLoop_2_1.Link( OInitLoopMax , IEndOfInitLoopMax ) - LSwitchOddIsOddGate = GraphInputInLoop_2.Link( OSwitchOdd , IIsOddGate ) + LSwitchOddIsOddGate = GraphInputInLoop_2_1.Link( OSwitchOdd , IIsOddGate ) - LSwitchEvenEndSwitchDefault = GraphInputInLoop_2.Link( OSwitchEven , IEndSwitchDefault ) + LSwitchEvenIsOddEven = GraphInputInLoop_2_1.Link( OSwitchEven , IIsOddEven ) - LSwitchEvenIsOddEven = GraphInputInLoop_2.Link( OSwitchEven , IIsOddEven ) - LSwitchEvenIsOddEven.AddCoord( 1 , 375 , 92 ) - LSwitchEvenIsOddEven.AddCoord( 2 , 375 , 159 ) - - LSwitchaIsOdda = GraphInputInLoop_2.Link( OSwitcha , IIsOdda ) + LSwitchaIsOdda = GraphInputInLoop_2_1.Link( OSwitcha , IIsOdda ) LSwitchaIsOdda.AddCoord( 1 , 366 , 71 ) LSwitchaIsOdda.AddCoord( 2 , 366 , 182 ) - LEndSwitchaEndOfInitLoopIndex = GraphInputInLoop_2.Link( OEndSwitcha , IEndOfInitLoopIndex ) + LSwitchDefaultEndSwitchDefault = GraphInputInLoop_2_1.Link( OSwitchDefault , IEndSwitchDefault ) + + LEndSwitchaEndOfInitLoopIndex = GraphInputInLoop_2_1.Link( OEndSwitcha , IEndOfInitLoopIndex ) # Input datas IIsOddConst.Input( 'Const Input Value' ) IInitLoopIndex.Input( 0 ) IInitLoopMin.Input( 0 ) - IInitLoopMax.Input( 100 ) + IInitLoopMax.Input( 23 ) # Output Ports of the graph #OIsOddConst = IsOdd.GetOutPort( 'Const' ) #OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) #OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) #OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) - return GraphInputInLoop_2 + return GraphInputInLoop_2_1 -GraphInputInLoop_2 = DefGraphInputInLoop_2() +GraphInputInLoop_2_1 = DefGraphInputInLoop_2_1() diff --git a/examples/GraphInputInLoop.xml b/examples/GraphInputInLoop.xml index b15d875..dc605bf 100644 --- a/examples/GraphInputInLoop.xml +++ b/examples/GraphInputInLoop.xml @@ -5,11 +5,11 @@ ? ? - GraphInputInLoop_2 + GraphInputInLoop_2_1 1 ? -GraphInputInLoop_2 +GraphInputInLoop_2_1 string @@ -39,7 +39,7 @@ 22/10/2003 - 10:36:39 - 7/1/2005 - 16:47:59 + 8/3/2005 - 15:2:42 1.05 ? ? @@ -81,14 +81,14 @@ - 7/1/2005 - 16:47:59 - 7/1/2005 - 16:47:59 + 8/3/2005 - 15:2:42 + 8/3/2005 - 15:2:42 1.05 ? ? Python function 397 - 1 + 5 ? ? @@ -128,8 +128,8 @@ ? - 7/1/2005 - 16:47:59 - 7/1/2005 - 16:47:59 + 8/3/2005 - 15:2:42 + 8/3/2005 - 15:2:42 1.05 ? ? @@ -175,14 +175,14 @@ - 7/1/2005 - 16:47:59 - 7/1/2005 - 16:47:59 + 8/3/2005 - 15:2:42 + 8/3/2005 - 15:2:42 1.05 ? ? Compute Node - 767 - 105 + 770 + 147 ? ? @@ -214,8 +214,8 @@ - 7/1/2005 - 16:47:59 - 7/1/2005 - 16:47:59 + 8/3/2005 - 15:2:42 + 8/3/2005 - 15:2:42 1.05 ? ? @@ -246,14 +246,14 @@ - 7/1/2005 - 16:47:59 - 7/1/2005 - 16:47:59 + 8/3/2005 - 15:2:42 + 8/3/2005 - 15:2:42 1.05 ? ? Compute Node - 587 - 105 + 588 + 147 IsOdd @@ -262,11 +262,11 @@ a -576 - 136 +573 + 178 -576 - 73 +573 + 76 InitLoop DoLoop @@ -304,23 +304,11 @@ Gate -Switch - Even - EndSwitch - Default - - Switch Even IsOdd Even - - -375 - 92 - -375 - 159 + Switch a @@ -334,6 +322,12 @@ 366 182 +Switch + Default + EndSwitch + Default + + EndSwitch a EndOfInitLoop @@ -341,7 +335,7 @@ -GraphInputInLoop_2 +GraphInputInLoop_2_1 IsOdd__Const IsOdd Const @@ -350,7 +344,7 @@ Const Input Value -GraphInputInLoop_2 +GraphInputInLoop_2_1 InitLoop__Index InitLoop Index @@ -359,7 +353,7 @@ 0 -GraphInputInLoop_2 +GraphInputInLoop_2_1 InitLoop__Min InitLoop Min @@ -368,11 +362,11 @@ 0 -GraphInputInLoop_2 +GraphInputInLoop_2_1 InitLoop__Max InitLoop Max 3 - 100 + 23 diff --git a/examples/GraphLoop1.py b/examples/GraphLoop1.py index 91b1d72..870d265 100644 --- a/examples/GraphLoop1.py +++ b/examples/GraphLoop1.py @@ -1,21 +1,21 @@ -# Generated python file of Graph GraphLoop_2 +# Generated python file of Graph GraphLoop1 from SuperV import * -# Graph creation of GraphLoop_2 -def DefGraphLoop_2() : - GraphLoop_2 = Graph( 'GraphLoop_2' ) - GraphLoop_2.SetName( 'GraphLoop_2' ) - GraphLoop_2.SetAuthor( '' ) - GraphLoop_2.SetComment( '' ) - GraphLoop_2.Coords( 0 , 0 ) +# Graph creation of GraphLoop1 +def DefGraphLoop1() : + GraphLoop1 = Graph( 'GraphLoop1' ) + GraphLoop1.SetName( 'GraphLoop1' ) + GraphLoop1.SetAuthor( '' ) + GraphLoop1.SetComment( '' ) + GraphLoop1.Coords( 0 , 0 ) # Creation of Factory Nodes # Creation of InLine Nodes PyNodeIndex = [] - NodeIndex = GraphLoop_2.INode( '' , PyNodeIndex ) + NodeIndex = GraphLoop1.INode( '' , PyNodeIndex ) NodeIndex.SetName( 'NodeIndex' ) NodeIndex.SetAuthor( '' ) NodeIndex.SetComment( 'Compute Node' ) @@ -26,7 +26,7 @@ def DefGraphLoop_2() : ONodeIndexGate = NodeIndex.GetOutPort( 'Gate' ) PyNodeIncr = [] - NodeIncr = GraphLoop_2.INode( '' , PyNodeIncr ) + NodeIncr = GraphLoop1.INode( '' , PyNodeIncr ) NodeIncr.SetName( 'NodeIncr' ) NodeIncr.SetAuthor( '' ) NodeIncr.SetComment( 'Compute Node' ) @@ -57,7 +57,7 @@ def DefGraphLoop_2() : PyNextInit.append( 'def Next(Index,Min,Max,Incr) : ' ) PyNextInit.append( ' Index = Index + Incr ' ) PyNextInit.append( ' return Index,Min,Max,Incr ' ) - Init,EndInit = GraphLoop_2.LNode( 'Init' , PyInit , 'More' , PyMoreInit , 'Next' , PyNextInit ) + Init,EndInit = GraphLoop1.LNode( 'Init' , PyInit , 'More' , PyMoreInit , 'Next' , PyNextInit ) EndInit.SetName( 'EndInit' ) EndInit.SetAuthor( '' ) EndInit.SetComment( 'Compute Node' ) @@ -93,17 +93,17 @@ def DefGraphLoop_2() : Init.Coords( 17 , 257 ) # Creation of Links - LInitIndexNodeIndexIndex = GraphLoop_2.Link( OInitIndex , INodeIndexIndex ) + LInitIndexNodeIndexIndex = GraphLoop1.Link( OInitIndex , INodeIndexIndex ) - LInitMinEndInitMin = GraphLoop_2.Link( OInitMin , IEndInitMin ) + LInitMinEndInitMin = GraphLoop1.Link( OInitMin , IEndInitMin ) - LInitMaxEndInitMax = GraphLoop_2.Link( OInitMax , IEndInitMax ) + LInitMaxEndInitMax = GraphLoop1.Link( OInitMax , IEndInitMax ) - LInitIncrNodeIncrIncr = GraphLoop_2.Link( OInitIncr , INodeIncrIncr ) + LInitIncrNodeIncrIncr = GraphLoop1.Link( OInitIncr , INodeIncrIncr ) - LNodeIndexIndexEndInitIndex = GraphLoop_2.Link( ONodeIndexIndex , IEndInitIndex ) + LNodeIndexIndexEndInitIndex = GraphLoop1.Link( ONodeIndexIndex , IEndInitIndex ) - LNodeIncrIncrEndInitIncr = GraphLoop_2.Link( ONodeIncrIncr , IEndInitIncr ) + LNodeIncrIncrEndInitIncr = GraphLoop1.Link( ONodeIncrIncr , IEndInitIncr ) # Input datas IInitIndex.Input( 0 ) @@ -116,7 +116,7 @@ def DefGraphLoop_2() : #OEndInitMin = EndInit.GetOutPort( 'Min' ) #OEndInitMax = EndInit.GetOutPort( 'Max' ) #OEndInitIncr = EndInit.GetOutPort( 'Incr' ) - return GraphLoop_2 + return GraphLoop1 -GraphLoop_2 = DefGraphLoop_2() +GraphLoop1 = DefGraphLoop1() diff --git a/examples/GraphLoop1.xml b/examples/GraphLoop1.xml index 19a8a72..f5ad503 100644 --- a/examples/GraphLoop1.xml +++ b/examples/GraphLoop1.xml @@ -5,7 +5,7 @@ ? ? - GraphLoop_2 + GraphLoop1 1 ? @@ -39,7 +39,7 @@ 24/3/2003 - 14:44:35 - 26/5/2005 - 10:10:48 + 6/6/2005 - 15:13:52 1.04 ? ? @@ -106,8 +106,8 @@ - 26/5/2005 - 10:10:48 - 26/5/2005 - 10:10:48 + 6/6/2005 - 15:13:52 + 6/6/2005 - 15:13:52 1.04 ? ? @@ -153,8 +153,8 @@ ? - 26/5/2005 - 10:10:48 - 26/5/2005 - 10:10:48 + 6/6/2005 - 15:13:52 + 6/6/2005 - 15:13:52 1.04 ? ? @@ -182,8 +182,8 @@ ? - 26/5/2005 - 10:10:48 - 26/5/2005 - 10:10:48 + 6/6/2005 - 15:13:52 + 6/6/2005 - 15:13:52 2.0 ? ? @@ -211,8 +211,8 @@ ? - 26/5/2005 - 10:10:48 - 26/5/2005 - 10:10:48 + 6/6/2005 - 15:13:52 + 6/6/2005 - 15:13:52 2.0 ? ? @@ -270,7 +270,7 @@ -GraphLoop_2 +GraphLoop1 Init__Index Init Index @@ -279,7 +279,7 @@ 0 -GraphLoop_2 +GraphLoop1 Init__Min Init Min @@ -288,7 +288,7 @@ 5 -GraphLoop_2 +GraphLoop1 Init__Max Init Max @@ -297,7 +297,7 @@ 10 -GraphLoop_2 +GraphLoop1 Init__Incr Init Incr diff --git a/examples/GraphLoop2.py b/examples/GraphLoop2.py new file mode 100644 index 0000000..a9e33ec --- /dev/null +++ b/examples/GraphLoop2.py @@ -0,0 +1,126 @@ + +# Generated python file of Graph GraphLoop2 + +from SuperV import * + +# Graph creation of GraphLoop2 +def DefGraphLoop2() : + GraphLoop2 = Graph( 'GraphLoop2' ) + GraphLoop2.SetName( 'GraphLoop2' ) + GraphLoop2.SetAuthor( '' ) + GraphLoop2.SetComment( '' ) + GraphLoop2.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyNodeIndex = [] + NodeIndex = GraphLoop2.INode( '' , PyNodeIndex ) + NodeIndex.SetName( 'NodeIndex' ) + NodeIndex.SetAuthor( '' ) + NodeIndex.SetComment( 'Compute Node' ) + NodeIndex.Coords( 281 , 215 ) + INodeIndexIndex = NodeIndex.InPort( 'Index' , 'long' ) + INodeIndexGate = NodeIndex.GetInPort( 'Gate' ) + ONodeIndexIndex = NodeIndex.OutPort( 'Index' , 'long' ) + ONodeIndexGate = NodeIndex.GetOutPort( 'Gate' ) + + PyNodeIncr = [] + NodeIncr = GraphLoop2.INode( '' , PyNodeIncr ) + NodeIncr.SetName( 'NodeIncr' ) + NodeIncr.SetAuthor( '' ) + NodeIncr.SetComment( 'Compute Node' ) + NodeIncr.Coords( 278 , 372 ) + INodeIncrIncr = NodeIncr.InPort( 'Incr' , 'long' ) + INodeIncraString = NodeIncr.InPort( 'aString' , 'string' ) + INodeIncrGate = NodeIncr.GetInPort( 'Gate' ) + ONodeIncrIncr = NodeIncr.OutPort( 'Incr' , 'long' ) + ONodeIncraString = NodeIncr.OutPort( 'aString' , 'string' ) + ONodeIncrGate = NodeIncr.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyInit = [] + 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( ' return Index,Min,Max,Incr ' ) + PyMoreInit = [] + PyMoreInit.append( 'import time ' ) + PyMoreInit.append( 'def More(Index,Min,Max,Incr) : ' ) + PyMoreInit.append( ' time.sleep(2) ' ) + PyMoreInit.append( ' if Index < Max : ' ) + PyMoreInit.append( ' DoLoop = 1 ' ) + PyMoreInit.append( ' else : ' ) + PyMoreInit.append( ' DoLoop = 0 ' ) + PyMoreInit.append( ' return DoLoop,Index,Min,Max,Incr ' ) + PyNextInit = [] + PyNextInit.append( 'def Next(Index,Min,Max,Incr) : ' ) + PyNextInit.append( ' Index = Index + Incr ' ) + PyNextInit.append( ' return Index,Min,Max,Incr ' ) + Init,EndInit = GraphLoop2.LNode( 'Init' , PyInit , 'More' , PyMoreInit , 'Next' , PyNextInit ) + EndInit.SetName( 'EndInit' ) + EndInit.SetAuthor( '' ) + EndInit.SetComment( 'Compute Node' ) + EndInit.Coords( 555 , 255 ) + PyEndInit = [] + EndInit.SetPyFunction( '' , PyEndInit ) + IInitDoLoop = Init.GetInPort( 'DoLoop' ) + IInitIndex = Init.InPort( 'Index' , 'long' ) + IInitMin = Init.InPort( 'Min' , 'long' ) + IInitMax = Init.InPort( 'Max' , 'long' ) + IInitIncr = Init.InPort( 'Incr' , 'long' ) + IInitGate = Init.GetInPort( 'Gate' ) + OInitDoLoop = Init.GetOutPort( 'DoLoop' ) + OInitIndex = Init.GetOutPort( 'Index' ) + OInitMin = Init.GetOutPort( 'Min' ) + OInitMax = Init.GetOutPort( 'Max' ) + OInitIncr = Init.GetOutPort( 'Incr' ) + IEndInitDoLoop = EndInit.GetInPort( 'DoLoop' ) + IEndInitIndex = EndInit.GetInPort( 'Index' ) + IEndInitMin = EndInit.GetInPort( 'Min' ) + IEndInitMax = EndInit.GetInPort( 'Max' ) + IEndInitIncr = EndInit.GetInPort( 'Incr' ) + IEndInitGate = EndInit.GetInPort( 'Gate' ) + OEndInitDoLoop = EndInit.GetOutPort( 'DoLoop' ) + OEndInitIndex = EndInit.GetOutPort( 'Index' ) + OEndInitMin = EndInit.GetOutPort( 'Min' ) + OEndInitMax = EndInit.GetOutPort( 'Max' ) + OEndInitIncr = EndInit.GetOutPort( 'Incr' ) + OEndInitGate = EndInit.GetOutPort( 'Gate' ) + Init.SetName( 'Init' ) + Init.SetAuthor( '' ) + Init.SetComment( 'Compute Node' ) + Init.Coords( 17 , 257 ) + + # Creation of Links + LInitIndexNodeIndexIndex = GraphLoop2.Link( OInitIndex , INodeIndexIndex ) + + LInitMinEndInitMin = GraphLoop2.Link( OInitMin , IEndInitMin ) + + LInitMaxEndInitMax = GraphLoop2.Link( OInitMax , IEndInitMax ) + + LInitIncrNodeIncrIncr = GraphLoop2.Link( OInitIncr , INodeIncrIncr ) + + LNodeIndexIndexEndInitIndex = GraphLoop2.Link( ONodeIndexIndex , IEndInitIndex ) + + LNodeIncrIncrEndInitIncr = GraphLoop2.Link( ONodeIncrIncr , IEndInitIncr ) + + # Input datas + IInitIndex.Input( 0 ) + IInitMin.Input( 5 ) + IInitMax.Input( 10 ) + IInitIncr.Input( 1 ) + INodeIncraString.Input( 'NodeToDelete' ) + + # Output Ports of the graph + #OEndInitIndex = EndInit.GetOutPort( 'Index' ) + #OEndInitMin = EndInit.GetOutPort( 'Min' ) + #OEndInitMax = EndInit.GetOutPort( 'Max' ) + #OEndInitIncr = EndInit.GetOutPort( 'Incr' ) + #ONodeIncraString = NodeIncr.GetOutPort( 'aString' ) + return GraphLoop2 + + +GraphLoop2 = DefGraphLoop2() diff --git a/examples/GraphLoop2.xml b/examples/GraphLoop2.xml new file mode 100644 index 0000000..b0831b5 --- /dev/null +++ b/examples/GraphLoop2.xml @@ -0,0 +1,328 @@ + + + + + +? + ? + GraphLoop2 + 1 + ? + +GraphLoop1_1 + + +long + Init__Index + +long + Init__Min + +long + Init__Max + +long + Init__Incr + +string + NodeIncr__aString + + +long + EndInit__Index + +long + EndInit__Min + +long + EndInit__Max + +long + EndInit__Incr + +string + NodeIncr__aString + + + 24/3/2003 - 14:44:35 + 6/6/2005 - 16:24:36 + 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 + + + + 6/6/2005 - 16:24:36 + 6/6/2005 - 16:24:36 + 1.04 + ? + ? + Compute Node + 17 + 257 + +? + ? + EndInit + 5 + Init + +EndInit + + +long + Index + +long + Min + +long + Max + +long + Incr + + +long + Index + +long + Min + +long + Max + +long + Incr + + + +? + + 6/6/2005 - 16:24:36 + 6/6/2005 - 16:24:36 + 1.04 + ? + ? + Compute Node + 555 + 255 + +? + ? + NodeIndex + 3 + ? + +NodeIndex + + +long + Index + + +long + Index + + + +? + + 6/6/2005 - 16:24:36 + 6/6/2005 - 16:24:36 + 2.0 + ? + ? + Compute Node + 281 + 215 + +? + ? + NodeIncr + 3 + ? + +NodeIncr + + +long + Incr + +string + aString + + +long + Incr + +string + aString + + + +? + + 6/6/2005 - 16:24:36 + 6/6/2005 - 16:24:36 + 2.0 + ? + ? + Compute Node + 278 + 372 + + +Init + DoLoop + EndInit + DoLoop + + +Init + Index + NodeIndex + Index + + +Init + Min + EndInit + Min + + +Init + Max + EndInit + Max + + +Init + Incr + NodeIncr + Incr + + +EndInit + DoLoop + Init + DoLoop + + +NodeIndex + Index + EndInit + Index + + +NodeIncr + Incr + EndInit + Incr + + + +GraphLoop2 + Init__Index + Init + Index + +3 + 0 + + +GraphLoop2 + Init__Min + Init + Min + +3 + 5 + + +GraphLoop2 + Init__Max + Init + Max + +3 + 10 + + +GraphLoop2 + Init__Incr + Init + Incr + +3 + 1 + + +GraphLoop2 + NodeIncr__aString + NodeIncr + aString + +18 + NodeToDelete + diff --git a/examples/GraphLoopAddMemory.py b/examples/GraphLoopAddMemory.py new file mode 100644 index 0000000..396d58c --- /dev/null +++ b/examples/GraphLoopAddMemory.py @@ -0,0 +1,114 @@ + +# Generated python file of Graph GraphLoopAddMemory + +from SuperV import * + +# Graph creation of GraphLoopAddMemory +def DefGraphLoopAddMemory() : + GraphLoopAddMemory = Graph( 'GraphLoopAddMemory' ) + GraphLoopAddMemory.SetName( 'GraphLoopAddMemory' ) + GraphLoopAddMemory.SetAuthor( 'JR' ) + GraphLoopAddMemory.SetComment( 'For solving of memory leaks' ) + GraphLoopAddMemory.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + AddWithoutSleep = GraphLoopAddMemory.FNode( 'AddComponent' , 'AddComponent' , 'AddWithoutSleep' ) + AddWithoutSleep.SetName( 'AddWithoutSleep' ) + AddWithoutSleep.SetAuthor( '' ) + AddWithoutSleep.SetContainer( 'localhost/FactoryServer' ) + AddWithoutSleep.SetComment( 'AddWithoutSleep from AddComponent' ) + AddWithoutSleep.Coords( 246 , 262 ) + IAddWithoutSleepx = AddWithoutSleep.GetInPort( 'x' ) + IAddWithoutSleepy = AddWithoutSleep.GetInPort( 'y' ) + IAddWithoutSleepGate = AddWithoutSleep.GetInPort( 'Gate' ) + OAddWithoutSleepFuncValue = AddWithoutSleep.GetOutPort( 'FuncValue' ) + OAddWithoutSleepz = AddWithoutSleep.GetOutPort( 'z' ) + OAddWithoutSleepGate = AddWithoutSleep.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyInit = [] + 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( ' return Index,Min,Max,Incr ' ) + PyMoreInit = [] + 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( ' return DoLoop,Index,Min,Max,Incr ' ) + PyNextInit = [] + PyNextInit.append( 'def Next(Index,Min,Max,Incr) : ' ) + PyNextInit.append( ' Index = Index + Incr ' ) + PyNextInit.append( ' return Index,Min,Max,Incr ' ) + Init,EndInit = GraphLoopAddMemory.LNode( 'Init' , PyInit , 'More' , PyMoreInit , 'Next' , PyNextInit ) + EndInit.SetName( 'EndInit' ) + EndInit.SetAuthor( '' ) + EndInit.SetComment( 'Compute Node' ) + EndInit.Coords( 495 , 262 ) + PyEndInit = [] + EndInit.SetPyFunction( '' , PyEndInit ) + IInitDoLoop = Init.GetInPort( 'DoLoop' ) + IInitIndex = Init.InPort( 'Index' , 'long' ) + IInitMin = Init.InPort( 'Min' , 'long' ) + IInitMax = Init.InPort( 'Max' , 'long' ) + IInitIncr = Init.InPort( 'Incr' , 'long' ) + IInitGate = Init.GetInPort( 'Gate' ) + OInitDoLoop = Init.GetOutPort( 'DoLoop' ) + OInitIndex = Init.GetOutPort( 'Index' ) + OInitMin = Init.GetOutPort( 'Min' ) + OInitMax = Init.GetOutPort( 'Max' ) + OInitIncr = Init.GetOutPort( 'Incr' ) + IEndInitDoLoop = EndInit.GetInPort( 'DoLoop' ) + IEndInitIndex = EndInit.GetInPort( 'Index' ) + IEndInitMin = EndInit.GetInPort( 'Min' ) + IEndInitMax = EndInit.GetInPort( 'Max' ) + IEndInitIncr = EndInit.GetInPort( 'Incr' ) + IEndInitGate = EndInit.GetInPort( 'Gate' ) + OEndInitDoLoop = EndInit.GetOutPort( 'DoLoop' ) + OEndInitIndex = EndInit.GetOutPort( 'Index' ) + OEndInitMin = EndInit.GetOutPort( 'Min' ) + OEndInitMax = EndInit.GetOutPort( 'Max' ) + OEndInitIncr = EndInit.GetOutPort( 'Incr' ) + OEndInitGate = EndInit.GetOutPort( 'Gate' ) + Init.SetName( 'Init' ) + Init.SetAuthor( '' ) + Init.SetComment( 'Compute Node' ) + Init.Coords( 17 , 257 ) + + # Creation of Links + LInitIndexEndInitIndex = GraphLoopAddMemory.Link( OInitIndex , IEndInitIndex ) + + LInitIndexAddWithoutSleepx = GraphLoopAddMemory.Link( OInitIndex , IAddWithoutSleepx ) + + LInitMinEndInitMin = GraphLoopAddMemory.Link( OInitMin , IEndInitMin ) + + LInitMaxEndInitMax = GraphLoopAddMemory.Link( OInitMax , IEndInitMax ) + + LInitMaxAddWithoutSleepy = GraphLoopAddMemory.Link( OInitMax , IAddWithoutSleepy ) + + LInitIncrEndInitIncr = GraphLoopAddMemory.Link( OInitIncr , IEndInitIncr ) + + LAddWithoutSleepGateEndInitGate = GraphLoopAddMemory.Link( OAddWithoutSleepGate , IEndInitGate ) + + # Input datas + IInitIndex.Input( 0 ) + IInitMin.Input( 5 ) + IInitMax.Input( 100000 ) + IInitIncr.Input( 1 ) + + # Output Ports of the graph + #OEndInitIndex = EndInit.GetOutPort( 'Index' ) + #OEndInitMin = EndInit.GetOutPort( 'Min' ) + #OEndInitMax = EndInit.GetOutPort( 'Max' ) + #OEndInitIncr = EndInit.GetOutPort( 'Incr' ) + #OAddWithoutSleepFuncValue = AddWithoutSleep.GetOutPort( 'FuncValue' ) + #OAddWithoutSleepz = AddWithoutSleep.GetOutPort( 'z' ) + return GraphLoopAddMemory + + +GraphLoopAddMemory = DefGraphLoopAddMemory() diff --git a/examples/GraphLoopAddMemory.xml b/examples/GraphLoopAddMemory.xml new file mode 100644 index 0000000..4c2512d --- /dev/null +++ b/examples/GraphLoopAddMemory.xml @@ -0,0 +1,291 @@ + + + + + +? + ? + GraphLoopAddMemory + 1 + ? + +GraphLoopMemory_1 + + +long + Init__Index + +long + Init__Min + +long + Init__Max + +long + Init__Incr + + +long + EndInit__Index + +long + EndInit__Min + +long + EndInit__Max + +long + EndInit__Incr + +double + AddWithoutSleep__FuncValue + +double + AddWithoutSleep__z + + + 24/3/2003 - 14:44:35 + 14/4/2005 - 16:44:51 + 1.04 + JR + ? + For solving of memory leaks + 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 + + + + 14/4/2005 - 16:43:41 + 14/4/2005 - 16:43:41 + 1.04 + ? + ? + Compute Node + 17 + 257 + +? + ? + EndInit + 5 + Init + +EndInit + + +long + Index + +long + Min + +long + Max + +long + Incr + + +long + Index + +long + Min + +long + Max + +long + Incr + + + +? + + 14/4/2005 - 16:43:41 + 14/4/2005 - 16:43:41 + 1.04 + ? + ? + Compute Node + 495 + 262 + +AddComponent + AddComponent + AddWithoutSleep + 0 + ? + +AddWithoutSleep + + +double + x + +double + y + + +double + FuncValue + +double + z + + + 14/4/2005 - 16:44:22 + 14/4/2005 - 16:44:22 + 2.0 + ? + localhost/FactoryServer + AddWithoutSleep from AddComponent + 246 + 262 + + +Init + DoLoop + EndInit + DoLoop + + +Init + Index + EndInit + Index + + +Init + Index + AddWithoutSleep + x + + +Init + Min + EndInit + Min + + +Init + Max + EndInit + Max + + +Init + Max + AddWithoutSleep + y + + +Init + Incr + EndInit + Incr + + +EndInit + DoLoop + Init + DoLoop + + +AddWithoutSleep + Gate + EndInit + Gate + + + +GraphLoopAddMemory + Init__Index + Init + Index + +3 + 0 + + +GraphLoopAddMemory + Init__Min + Init + Min + +3 + 5 + + +GraphLoopAddMemory + Init__Max + Init + Max + +3 + 100000 + + +GraphLoopAddMemory + Init__Incr + Init + Incr + +3 + 1 + diff --git a/examples/GraphLoopGates.py b/examples/GraphLoopGates.py index 0126d3b..d334a9c 100644 --- a/examples/GraphLoopGates.py +++ b/examples/GraphLoopGates.py @@ -102,7 +102,7 @@ def DefGraphLoopGates() : EndInit.SetName( 'EndInit' ) EndInit.SetAuthor( '' ) EndInit.SetComment( 'Compute Node' ) - EndInit.Coords( 840 , 204 ) + EndInit.Coords( 847 , 247 ) PyEndInit = [] EndInit.SetPyFunction( 'EndInit' , PyEndInit ) IInitDoLoop = Init.GetInPort( 'DoLoop' ) @@ -120,35 +120,37 @@ def DefGraphLoopGates() : IEndInitMax = EndInit.GetInPort( 'Max' ) IEndInitGate = EndInit.GetInPort( 'Gate' ) OEndInitDoLoop = EndInit.GetOutPort( 'DoLoop' ) - OEndInitGate = EndInit.GetOutPort( 'Gate' ) OEndInitIndex = EndInit.GetOutPort( 'Index' ) OEndInitMin = EndInit.GetOutPort( 'Min' ) OEndInitMax = EndInit.GetOutPort( 'Max' ) + OEndInitGate = EndInit.GetOutPort( 'Gate' ) Init.SetName( 'Init' ) Init.SetAuthor( '' ) Init.SetComment( 'Compute Node' ) Init.Coords( 10 , 181 ) # Creation of Links - LInitGateAdd_1Gate = GraphLoopGates.Link( OInitGate , IAdd_1Gate ) - - LInitGateAddGate = GraphLoopGates.Link( OInitGate , IAddGate ) - LInitIndexEndInitIndex = GraphLoopGates.Link( OInitIndex , IEndInitIndex ) LInitMinEndInitMin = GraphLoopGates.Link( OInitMin , IEndInitMin ) LInitMaxEndInitMax = GraphLoopGates.Link( OInitMax , IEndInitMax ) + LInitGateAdd_1Gate = GraphLoopGates.Link( OInitGate , IAdd_1Gate ) + + LInitGateAddGate = GraphLoopGates.Link( OInitGate , IAddGate ) + LAddGateSubGate = GraphLoopGates.Link( OAddGate , ISubGate ) LAdd_1GateSub_1Gate = GraphLoopGates.Link( OAdd_1Gate , ISub_1Gate ) LSubGateGateG1 = GraphLoopGates.Link( OSubGate , IGateG1 ) - LSub_1GateGateG2 = GraphLoopGates.Link( OSub_1Gate , IGateG2 ) + LSub_1zGateG2 = GraphLoopGates.Link( OSub_1z , IGateG2 ) + + LSub_1GateGateGate = GraphLoopGates.Link( OSub_1Gate , IGateGate ) - LGateGEndInitGate = GraphLoopGates.Link( OGateG , IEndInitGate ) + LGateGateEndInitGate = GraphLoopGates.Link( OGateGate , IEndInitGate ) # Input datas IInitIndex.Input( 0 ) @@ -172,7 +174,7 @@ def DefGraphLoopGates() : #OAdd_1FuncValue = Add_1.GetOutPort( 'FuncValue' ) #OAdd_1z = Add_1.GetOutPort( 'z' ) #OSubz = Sub.GetOutPort( 'z' ) - #OSub_1z = Sub_1.GetOutPort( 'z' ) + #OGateG = Gate.GetOutPort( 'G' ) return GraphLoopGates diff --git a/examples/GraphLoopGates.xml b/examples/GraphLoopGates.xml index f495d5a..64f1e2e 100644 --- a/examples/GraphLoopGates.xml +++ b/examples/GraphLoopGates.xml @@ -9,7 +9,7 @@ 1 ? -GraphLoopsGates +GraphLoopGates1_1 long @@ -70,12 +70,12 @@ double Sub__z -double - Sub_1__z +long + Gate__G 7/1/2005 - 16:57:1 - 7/1/2005 - 17:8:8 + 4/7/2005 - 10:26:6 2.0 JR ? @@ -133,8 +133,8 @@ - 7/1/2005 - 16:59:3 - 7/1/2005 - 16:59:3 + 4/7/2005 - 10:26:6 + 4/7/2005 - 10:26:6 2.0 ? ? @@ -174,14 +174,14 @@ EndInit - 7/1/2005 - 16:59:3 - 7/1/2005 - 16:59:3 + 4/7/2005 - 10:26:6 + 4/7/2005 - 10:26:6 2.0 ? ? Compute Node - 840 - 204 + 847 + 247 AddComponent AddComponent @@ -206,8 +206,8 @@ z - 7/1/2005 - 17:3:59 - 7/1/2005 - 17:3:59 + 4/7/2005 - 10:26:6 + 4/7/2005 - 10:26:6 2.0 ? localhost/FactoryServer @@ -238,8 +238,8 @@ z - 7/1/2005 - 17:4:5 - 7/1/2005 - 17:4:5 + 4/7/2005 - 10:26:6 + 4/7/2005 - 10:26:6 2.0 ? localhost/FactoryServer @@ -267,8 +267,8 @@ z - 7/1/2005 - 17:4:31 - 7/1/2005 - 17:4:31 + 4/7/2005 - 10:26:6 + 4/7/2005 - 10:26:6 2.0 ? localhost/FactoryServer @@ -296,8 +296,8 @@ z - 7/1/2005 - 17:4:32 - 7/1/2005 - 17:4:32 + 4/7/2005 - 10:26:6 + 4/7/2005 - 10:26:6 2.0 ? localhost/FactoryServer @@ -331,8 +331,8 @@ - 7/1/2005 - 17:7:9 - 7/1/2005 - 17:7:9 + 4/7/2005 - 10:26:6 + 4/7/2005 - 10:26:6 2.0 ? ? @@ -347,18 +347,6 @@ DoLoop -Init - Gate - Add_1 - Gate - - -Init - Gate - Add - Gate - - Init Index EndInit @@ -377,6 +365,18 @@ Max +Init + Gate + Add_1 + Gate + + +Init + Gate + Add + Gate + + EndInit DoLoop Init @@ -402,13 +402,19 @@ Sub_1 - Gate + z Gate G2 +Sub_1 + Gate + Gate + Gate + + Gate - G + Gate EndInit Gate diff --git a/examples/GraphLoopGatesNOTValid.py b/examples/GraphLoopGatesNOTValid.py new file mode 100644 index 0000000..877331e --- /dev/null +++ b/examples/GraphLoopGatesNOTValid.py @@ -0,0 +1,179 @@ + +# Generated python file of Graph GraphLoopGatesNOTValid + +from SuperV import * + +# Graph creation of GraphLoopGatesNOTValid +def DefGraphLoopGatesNOTValid() : + GraphLoopGatesNOTValid = Graph( 'GraphLoopGatesNOTValid' ) + GraphLoopGatesNOTValid.SetName( 'GraphLoopGatesNOTValid' ) + GraphLoopGatesNOTValid.SetAuthor( 'JR' ) + GraphLoopGatesNOTValid.SetComment( '' ) + GraphLoopGatesNOTValid.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + Add = GraphLoopGatesNOTValid.FNode( 'AddComponent' , 'AddComponent' , 'Add' ) + Add.SetName( 'Add' ) + Add.SetAuthor( '' ) + Add.SetContainer( 'localhost/FactoryServer' ) + Add.SetComment( 'Add from AddComponent' ) + Add.Coords( 248 , 70 ) + IAddx = Add.GetInPort( 'x' ) + IAddy = Add.GetInPort( 'y' ) + IAddGate = Add.GetInPort( 'Gate' ) + OAddFuncValue = Add.GetOutPort( 'FuncValue' ) + OAddz = Add.GetOutPort( 'z' ) + OAddGate = Add.GetOutPort( 'Gate' ) + + Add_1 = GraphLoopGatesNOTValid.FNode( 'AddComponent' , 'AddComponent' , 'Add' ) + Add_1.SetName( 'Add_1' ) + Add_1.SetAuthor( '' ) + Add_1.SetContainer( 'localhost/FactoryServer' ) + Add_1.SetComment( 'Add from AddComponent' ) + Add_1.Coords( 249 , 305 ) + IAdd_1x = Add_1.GetInPort( 'x' ) + IAdd_1y = Add_1.GetInPort( 'y' ) + IAdd_1Gate = Add_1.GetInPort( 'Gate' ) + OAdd_1FuncValue = Add_1.GetOutPort( 'FuncValue' ) + OAdd_1z = Add_1.GetOutPort( 'z' ) + OAdd_1Gate = Add_1.GetOutPort( 'Gate' ) + + Sub = GraphLoopGatesNOTValid.FNode( 'SubComponent' , 'SubComponent' , 'Sub' ) + Sub.SetName( 'Sub' ) + Sub.SetAuthor( '' ) + Sub.SetContainer( 'localhost/FactoryServer' ) + Sub.SetComment( 'Sub from SubComponent' ) + Sub.Coords( 453 , 72 ) + ISubx = Sub.GetInPort( 'x' ) + ISuby = Sub.GetInPort( 'y' ) + ISubGate = Sub.GetInPort( 'Gate' ) + OSubz = Sub.GetOutPort( 'z' ) + OSubGate = Sub.GetOutPort( 'Gate' ) + + Sub_1 = GraphLoopGatesNOTValid.FNode( 'SubComponent' , 'SubComponent' , 'Sub' ) + Sub_1.SetName( 'Sub_1' ) + Sub_1.SetAuthor( '' ) + Sub_1.SetContainer( 'localhost/FactoryServer' ) + Sub_1.SetComment( 'Sub from SubComponent' ) + Sub_1.Coords( 455 , 304 ) + ISub_1x = Sub_1.GetInPort( 'x' ) + ISub_1y = Sub_1.GetInPort( 'y' ) + ISub_1Gate = Sub_1.GetInPort( 'Gate' ) + OSub_1z = Sub_1.GetOutPort( 'z' ) + OSub_1Gate = Sub_1.GetOutPort( 'Gate' ) + + # Creation of InLine Nodes + PyGate = [] + PyGate.append( 'from time import * ' ) + PyGate.append( 'def Gate(G1,G2) : ' ) + PyGate.append( ' sleep(1) ' ) + PyGate.append( ' return G1&G2 ' ) + Gate = GraphLoopGatesNOTValid.INode( 'Gate' , PyGate ) + Gate.SetName( 'Gate' ) + Gate.SetAuthor( '' ) + Gate.SetComment( 'Compute Node' ) + Gate.Coords( 650 , 227 ) + IGateG1 = Gate.InPort( 'G1' , 'long' ) + IGateG2 = Gate.InPort( 'G2' , 'long' ) + IGateGate = Gate.GetInPort( 'Gate' ) + OGateG = Gate.OutPort( 'G' , 'long' ) + OGateGate = Gate.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyInit = [] + PyInit.append( 'from time import * ' ) + PyInit.append( 'def Init(Index,Min,Max) : ' ) + PyInit.append( ' Index = Min ' ) + PyInit.append( ' sleep(1) ' ) + PyInit.append( ' return Index,Min,Max ' ) + PyMoreInit = [] + PyMoreInit.append( 'def More(Index,Min,Max) : ' ) + PyMoreInit.append( ' if Index < Max : ' ) + PyMoreInit.append( ' DoLoop = 1 ' ) + PyMoreInit.append( ' else : ' ) + PyMoreInit.append( ' DoLoop = 0 ' ) + PyMoreInit.append( ' return DoLoop,Index,Min,Max ' ) + PyNextInit = [] + PyNextInit.append( 'def Next(Index,Min,Max) : ' ) + PyNextInit.append( ' Index = Index + 1 ' ) + PyNextInit.append( ' return Index,Min,Max ' ) + Init,EndInit = GraphLoopGatesNOTValid.LNode( 'Init' , PyInit , 'More' , PyMoreInit , 'Next' , PyNextInit ) + EndInit.SetName( 'EndInit' ) + EndInit.SetAuthor( '' ) + EndInit.SetComment( 'Compute Node' ) + EndInit.Coords( 840 , 204 ) + PyEndInit = [] + EndInit.SetPyFunction( 'EndInit' , PyEndInit ) + IInitDoLoop = Init.GetInPort( 'DoLoop' ) + IInitIndex = Init.InPort( 'Index' , 'long' ) + IInitMin = Init.InPort( 'Min' , 'long' ) + IInitMax = Init.InPort( 'Max' , 'long' ) + IInitGate = Init.GetInPort( 'Gate' ) + OInitDoLoop = Init.GetOutPort( 'DoLoop' ) + OInitIndex = Init.GetOutPort( 'Index' ) + OInitMin = Init.GetOutPort( 'Min' ) + OInitMax = Init.GetOutPort( 'Max' ) + IEndInitDoLoop = EndInit.GetInPort( 'DoLoop' ) + IEndInitIndex = EndInit.GetInPort( 'Index' ) + IEndInitMin = EndInit.GetInPort( 'Min' ) + IEndInitMax = EndInit.GetInPort( 'Max' ) + IEndInitGate = EndInit.GetInPort( 'Gate' ) + OEndInitDoLoop = EndInit.GetOutPort( 'DoLoop' ) + OEndInitGate = EndInit.GetOutPort( 'Gate' ) + OEndInitIndex = EndInit.GetOutPort( 'Index' ) + OEndInitMin = EndInit.GetOutPort( 'Min' ) + OEndInitMax = EndInit.GetOutPort( 'Max' ) + Init.SetName( 'Init' ) + Init.SetAuthor( '' ) + Init.SetComment( 'Compute Node' ) + Init.Coords( 10 , 181 ) + + # Creation of Links + LInitGateAdd_1Gate = GraphLoopGatesNOTValid.Link( OInitGate , IAdd_1Gate ) + + LInitGateAddGate = GraphLoopGatesNOTValid.Link( OInitGate , IAddGate ) + + LInitIndexEndInitIndex = GraphLoopGatesNOTValid.Link( OInitIndex , IEndInitIndex ) + + LInitMinEndInitMin = GraphLoopGatesNOTValid.Link( OInitMin , IEndInitMin ) + + LInitMaxEndInitMax = GraphLoopGatesNOTValid.Link( OInitMax , IEndInitMax ) + + LAddGateSubGate = GraphLoopGatesNOTValid.Link( OAddGate , ISubGate ) + + LAdd_1GateSub_1Gate = GraphLoopGatesNOTValid.Link( OAdd_1Gate , ISub_1Gate ) + + LSubGateGateG1 = GraphLoopGatesNOTValid.Link( OSubGate , IGateG1 ) + + LSub_1GateGateG2 = GraphLoopGatesNOTValid.Link( OSub_1Gate , IGateG2 ) + + LGateGEndInitGate = GraphLoopGatesNOTValid.Link( OGateG , IEndInitGate ) + + # Input datas + IInitIndex.Input( 0 ) + IInitMin.Input( 5 ) + IInitMax.Input( 13 ) + IAddx.Input( 1 ) + IAddy.Input( 2 ) + IAdd_1x.Input( 3 ) + IAdd_1y.Input( 4 ) + ISubx.Input( 5 ) + ISuby.Input( 6 ) + ISub_1x.Input( 7 ) + ISub_1y.Input( 8 ) + + # Output Ports of the graph + #OEndInitIndex = EndInit.GetOutPort( 'Index' ) + #OEndInitMin = EndInit.GetOutPort( 'Min' ) + #OEndInitMax = EndInit.GetOutPort( 'Max' ) + #OAddFuncValue = Add.GetOutPort( 'FuncValue' ) + #OAddz = Add.GetOutPort( 'z' ) + #OAdd_1FuncValue = Add_1.GetOutPort( 'FuncValue' ) + #OAdd_1z = Add_1.GetOutPort( 'z' ) + #OSubz = Sub.GetOutPort( 'z' ) + #OSub_1z = Sub_1.GetOutPort( 'z' ) + return GraphLoopGatesNOTValid + + +GraphLoopGatesNOTValid = DefGraphLoopGatesNOTValid() diff --git a/examples/GraphLoopGatesNOTValid.xml b/examples/GraphLoopGatesNOTValid.xml new file mode 100644 index 0000000..8fd11c6 --- /dev/null +++ b/examples/GraphLoopGatesNOTValid.xml @@ -0,0 +1,514 @@ + + + + + +? + ? + GraphLoopGatesNOTValid + 1 + ? + +GraphLoopsGates + + +long + Init__Index + +long + Init__Min + +long + Init__Max + +double + Add__x + +double + Add__y + +double + Add_1__x + +double + Add_1__y + +double + Sub__x + +double + Sub__y + +double + Sub_1__x + +double + Sub_1__y + + +long + EndInit__Index + +long + EndInit__Min + +long + EndInit__Max + +double + Add__FuncValue + +double + Add__z + +double + Add_1__FuncValue + +double + Add_1__z + +double + Sub__z + +double + Sub_1__z + + + 7/1/2005 - 16:57:1 + 7/1/2005 - 17:8:8 + 2.0 + JR + ? + ? + 0 + 0 + + +? + ? + Init + 4 + EndInit + +Init + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +Init + + + + + + +More + + + + + + + +Next + + + + 7/1/2005 - 16:59:3 + 7/1/2005 - 16:59:3 + 2.0 + ? + ? + Compute Node + 10 + 181 + +? + ? + EndInit + 5 + Init + +EndInit + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +EndInit + + 7/1/2005 - 16:59:3 + 7/1/2005 - 16:59:3 + 2.0 + ? + ? + Compute Node + 840 + 204 + +AddComponent + AddComponent + Add + 0 + ? + +Add + + +double + x + +double + y + + +double + FuncValue + +double + z + + + 7/1/2005 - 17:3:59 + 7/1/2005 - 17:3:59 + 2.0 + ? + localhost/FactoryServer + Add from AddComponent + 248 + 70 + +AddComponent + AddComponent + Add_1 + 0 + ? + +Add + + +double + x + +double + y + + +double + FuncValue + +double + z + + + 7/1/2005 - 17:4:5 + 7/1/2005 - 17:4:5 + 2.0 + ? + localhost/FactoryServer + Add from AddComponent + 249 + 305 + +SubComponent + SubComponent + Sub + 0 + ? + +Sub + + +double + x + +double + y + + +double + z + + + 7/1/2005 - 17:4:31 + 7/1/2005 - 17:4:31 + 2.0 + ? + localhost/FactoryServer + Sub from SubComponent + 453 + 72 + +SubComponent + SubComponent + Sub_1 + 0 + ? + +Sub + + +double + x + +double + y + + +double + z + + + 7/1/2005 - 17:4:32 + 7/1/2005 - 17:4:32 + 2.0 + ? + localhost/FactoryServer + Sub from SubComponent + 455 + 304 + +? + ? + Gate + 3 + ? + +Gate + + +long + G1 + +long + G2 + + +long + G + + + +Gate + + + + + 7/1/2005 - 17:7:9 + 7/1/2005 - 17:7:9 + 2.0 + ? + ? + Compute Node + 650 + 227 + + +Init + DoLoop + EndInit + DoLoop + + +Init + Gate + Add_1 + Gate + + +Init + Gate + Add + Gate + + +Init + Index + EndInit + Index + + +Init + Min + EndInit + Min + + +Init + Max + EndInit + Max + + +EndInit + DoLoop + Init + DoLoop + + +Add + Gate + Sub + Gate + + +Add_1 + Gate + Sub_1 + Gate + + +Sub + Gate + Gate + G1 + + +Sub_1 + Gate + Gate + G2 + + +Gate + G + EndInit + Gate + + + +GraphLoopGatesNOTValid + Init__Index + Init + Index + +3 + 0 + + +GraphLoopGatesNOTValid + Init__Min + Init + Min + +3 + 5 + + +GraphLoopGatesNOTValid + Init__Max + Init + Max + +3 + 13 + + +GraphLoopGatesNOTValid + Add__x + Add + x + +7 + 1 + + +GraphLoopGatesNOTValid + Add__y + Add + y + +7 + 2 + + +GraphLoopGatesNOTValid + Add_1__x + Add_1 + x + +7 + 3 + + +GraphLoopGatesNOTValid + Add_1__y + Add_1 + y + +7 + 4 + + +GraphLoopGatesNOTValid + Sub__x + Sub + x + +7 + 5 + + +GraphLoopGatesNOTValid + Sub__y + Sub + y + +7 + 6 + + +GraphLoopGatesNOTValid + Sub_1__x + Sub_1 + x + +7 + 7 + + +GraphLoopGatesNOTValid + Sub_1__y + Sub_1 + y + +7 + 8 + diff --git a/examples/GraphLoopMemory.py b/examples/GraphLoopMemory.py new file mode 100644 index 0000000..ac87929 --- /dev/null +++ b/examples/GraphLoopMemory.py @@ -0,0 +1,93 @@ + +# Generated python file of Graph GraphLoopMemory_1 + +from SuperV import * + +# Graph creation of GraphLoopMemory_1 +def DefGraphLoopMemory_1() : + GraphLoopMemory_1 = Graph( 'GraphLoopMemory_1' ) + GraphLoopMemory_1.SetName( 'GraphLoopMemory_1' ) + GraphLoopMemory_1.SetAuthor( 'JR' ) + GraphLoopMemory_1.SetComment( 'For solving of memory leaks' ) + GraphLoopMemory_1.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of Loop Nodes + PyInit = [] + 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( ' return Index,Min,Max,Incr ' ) + PyMoreInit = [] + 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( ' return DoLoop,Index,Min,Max,Incr ' ) + PyNextInit = [] + PyNextInit.append( 'def Next(Index,Min,Max,Incr) : ' ) + PyNextInit.append( ' Index = Index + Incr ' ) + PyNextInit.append( ' return Index,Min,Max,Incr ' ) + Init,EndInit = GraphLoopMemory_1.LNode( 'Init' , PyInit , 'More' , PyMoreInit , 'Next' , PyNextInit ) + EndInit.SetName( 'EndInit' ) + EndInit.SetAuthor( '' ) + EndInit.SetComment( 'Compute Node' ) + EndInit.Coords( 366 , 262 ) + PyEndInit = [] + EndInit.SetPyFunction( '' , PyEndInit ) + IInitDoLoop = Init.GetInPort( 'DoLoop' ) + IInitIndex = Init.InPort( 'Index' , 'long' ) + IInitMin = Init.InPort( 'Min' , 'long' ) + IInitMax = Init.InPort( 'Max' , 'long' ) + IInitIncr = Init.InPort( 'Incr' , 'long' ) + IInitGate = Init.GetInPort( 'Gate' ) + OInitDoLoop = Init.GetOutPort( 'DoLoop' ) + OInitIndex = Init.GetOutPort( 'Index' ) + OInitMin = Init.GetOutPort( 'Min' ) + OInitMax = Init.GetOutPort( 'Max' ) + OInitIncr = Init.GetOutPort( 'Incr' ) + IEndInitDoLoop = EndInit.GetInPort( 'DoLoop' ) + IEndInitIndex = EndInit.GetInPort( 'Index' ) + IEndInitMin = EndInit.GetInPort( 'Min' ) + IEndInitMax = EndInit.GetInPort( 'Max' ) + IEndInitIncr = EndInit.GetInPort( 'Incr' ) + IEndInitGate = EndInit.GetInPort( 'Gate' ) + OEndInitDoLoop = EndInit.GetOutPort( 'DoLoop' ) + OEndInitIndex = EndInit.GetOutPort( 'Index' ) + OEndInitMin = EndInit.GetOutPort( 'Min' ) + OEndInitMax = EndInit.GetOutPort( 'Max' ) + OEndInitIncr = EndInit.GetOutPort( 'Incr' ) + OEndInitGate = EndInit.GetOutPort( 'Gate' ) + Init.SetName( 'Init' ) + Init.SetAuthor( '' ) + Init.SetComment( 'Compute Node' ) + Init.Coords( 17 , 257 ) + + # Creation of Links + LInitIndexEndInitIndex = GraphLoopMemory_1.Link( OInitIndex , IEndInitIndex ) + + LInitMinEndInitMin = GraphLoopMemory_1.Link( OInitMin , IEndInitMin ) + + LInitMaxEndInitMax = GraphLoopMemory_1.Link( OInitMax , IEndInitMax ) + + LInitIncrEndInitIncr = GraphLoopMemory_1.Link( OInitIncr , IEndInitIncr ) + + # Input datas + IInitIndex.Input( 0 ) + IInitMin.Input( 5 ) + IInitMax.Input( 100000 ) + IInitIncr.Input( 1 ) + + # Output Ports of the graph + #OEndInitIndex = EndInit.GetOutPort( 'Index' ) + #OEndInitMin = EndInit.GetOutPort( 'Min' ) + #OEndInitMax = EndInit.GetOutPort( 'Max' ) + #OEndInitIncr = EndInit.GetOutPort( 'Incr' ) + return GraphLoopMemory_1 + + +GraphLoopMemory_1 = DefGraphLoopMemory_1() diff --git a/examples/GraphLoopMemory.xml b/examples/GraphLoopMemory.xml new file mode 100644 index 0000000..713b4e5 --- /dev/null +++ b/examples/GraphLoopMemory.xml @@ -0,0 +1,235 @@ + + + + + +? + ? + GraphLoopMemory_1 + 1 + ? + +GraphLoopMemory_1 + + +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 + 21/2/2005 - 11:43:50 + 1.04 + JR + ? + For solving of memory leaks + 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 + + + + 21/2/2005 - 11:43:50 + 21/2/2005 - 11:43:50 + 1.04 + ? + ? + Compute Node + 17 + 257 + +? + ? + EndInit + 5 + Init + +EndInit + + +long + Index + +long + Min + +long + Max + +long + Incr + + +long + Index + +long + Min + +long + Max + +long + Incr + + + +? + + 21/2/2005 - 11:43:50 + 21/2/2005 - 11:43:50 + 1.04 + ? + ? + Compute Node + 366 + 262 + + +Init + DoLoop + EndInit + DoLoop + + +Init + Index + EndInit + Index + + +Init + Min + EndInit + Min + + +Init + Max + EndInit + Max + + +Init + Incr + EndInit + Incr + + +EndInit + DoLoop + Init + DoLoop + + + +GraphLoopMemory_1 + Init__Index + Init + Index + +3 + 0 + + +GraphLoopMemory_1 + Init__Min + Init + Min + +3 + 5 + + +GraphLoopMemory_1 + Init__Max + Init + Max + +3 + 100000 + + +GraphLoopMemory_1 + Init__Incr + Init + Incr + +3 + 1 + diff --git a/examples/GraphLoopPyAddAddMemory.py b/examples/GraphLoopPyAddAddMemory.py new file mode 100644 index 0000000..d1e9a82 --- /dev/null +++ b/examples/GraphLoopPyAddAddMemory.py @@ -0,0 +1,135 @@ + +# Generated python file of Graph GraphLoopPyAddAddMemory + +from SuperV import * + +# Graph creation of GraphLoopPyAddAddMemory +def DefGraphLoopPyAddAddMemory() : + GraphLoopPyAddAddMemory = Graph( 'GraphLoopPyAddAddMemory' ) + GraphLoopPyAddAddMemory.SetName( 'GraphLoopPyAddAddMemory' ) + GraphLoopPyAddAddMemory.SetAuthor( 'JR' ) + GraphLoopPyAddAddMemory.SetComment( 'For solving of memory leaks' ) + GraphLoopPyAddAddMemory.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + AddWithoutSleep = GraphLoopPyAddAddMemory.FNode( 'AddComponent' , 'AddComponent' , 'AddWithoutSleep' ) + AddWithoutSleep.SetName( 'AddWithoutSleep' ) + AddWithoutSleep.SetAuthor( '' ) + AddWithoutSleep.SetContainer( 'localhost/FactoryServer' ) + AddWithoutSleep.SetComment( 'AddWithoutSleep from AddComponent' ) + AddWithoutSleep.Coords( 255 , 352 ) + IAddWithoutSleepx = AddWithoutSleep.GetInPort( 'x' ) + IAddWithoutSleepy = AddWithoutSleep.GetInPort( 'y' ) + IAddWithoutSleepGate = AddWithoutSleep.GetInPort( 'Gate' ) + OAddWithoutSleepFuncValue = AddWithoutSleep.GetOutPort( 'FuncValue' ) + OAddWithoutSleepz = AddWithoutSleep.GetOutPort( 'z' ) + OAddWithoutSleepGate = AddWithoutSleep.GetOutPort( 'Gate' ) + + # Creation of InLine Nodes + PyPyAdd = [] + PyPyAdd.append( 'def PyAdd(a,b) : ' ) + PyPyAdd.append( ' return a,a+b ' ) + PyAdd = GraphLoopPyAddAddMemory.INode( 'PyAdd' , PyPyAdd ) + PyAdd.SetName( 'PyAdd' ) + PyAdd.SetAuthor( '' ) + PyAdd.SetComment( 'Compute Node' ) + PyAdd.Coords( 266 , 188 ) + IPyAdda = PyAdd.InPort( 'a' , 'long' ) + IPyAddb = PyAdd.InPort( 'b' , 'long' ) + IPyAddGate = PyAdd.GetInPort( 'Gate' ) + OPyAdda = PyAdd.OutPort( 'a' , 'long' ) + OPyAddc = PyAdd.OutPort( 'c' , 'long' ) + OPyAddGate = PyAdd.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyInit = [] + 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( ' return Index,Min,Max,Incr ' ) + PyMoreInit = [] + 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( ' return DoLoop,Index,Min,Max,Incr ' ) + PyNextInit = [] + PyNextInit.append( 'def Next(Index,Min,Max,Incr) : ' ) + PyNextInit.append( ' Index = Index + Incr ' ) + PyNextInit.append( ' return Index,Min,Max,Incr ' ) + Init,EndInit = GraphLoopPyAddAddMemory.LNode( 'Init' , PyInit , 'More' , PyMoreInit , 'Next' , PyNextInit ) + EndInit.SetName( 'EndInit' ) + EndInit.SetAuthor( '' ) + EndInit.SetComment( 'Compute Node' ) + EndInit.Coords( 495 , 262 ) + PyEndInit = [] + EndInit.SetPyFunction( '' , PyEndInit ) + IInitDoLoop = Init.GetInPort( 'DoLoop' ) + IInitIndex = Init.InPort( 'Index' , 'long' ) + IInitMin = Init.InPort( 'Min' , 'long' ) + IInitMax = Init.InPort( 'Max' , 'long' ) + IInitIncr = Init.InPort( 'Incr' , 'long' ) + IInitGate = Init.GetInPort( 'Gate' ) + OInitDoLoop = Init.GetOutPort( 'DoLoop' ) + OInitIndex = Init.GetOutPort( 'Index' ) + OInitMin = Init.GetOutPort( 'Min' ) + OInitMax = Init.GetOutPort( 'Max' ) + OInitIncr = Init.GetOutPort( 'Incr' ) + IEndInitDoLoop = EndInit.GetInPort( 'DoLoop' ) + IEndInitIndex = EndInit.GetInPort( 'Index' ) + IEndInitMin = EndInit.GetInPort( 'Min' ) + IEndInitMax = EndInit.GetInPort( 'Max' ) + IEndInitIncr = EndInit.GetInPort( 'Incr' ) + IEndInitGate = EndInit.GetInPort( 'Gate' ) + OEndInitDoLoop = EndInit.GetOutPort( 'DoLoop' ) + OEndInitIndex = EndInit.GetOutPort( 'Index' ) + OEndInitMin = EndInit.GetOutPort( 'Min' ) + OEndInitMax = EndInit.GetOutPort( 'Max' ) + OEndInitIncr = EndInit.GetOutPort( 'Incr' ) + OEndInitGate = EndInit.GetOutPort( 'Gate' ) + Init.SetName( 'Init' ) + Init.SetAuthor( '' ) + Init.SetComment( 'Compute Node' ) + Init.Coords( 17 , 257 ) + + # Creation of Links + LInitIndexAddWithoutSleepx = GraphLoopPyAddAddMemory.Link( OInitIndex , IAddWithoutSleepx ) + + LInitIndexPyAdda = GraphLoopPyAddAddMemory.Link( OInitIndex , IPyAdda ) + + LInitMinEndInitMin = GraphLoopPyAddAddMemory.Link( OInitMin , IEndInitMin ) + + LInitMaxEndInitMax = GraphLoopPyAddAddMemory.Link( OInitMax , IEndInitMax ) + + LInitMaxAddWithoutSleepy = GraphLoopPyAddAddMemory.Link( OInitMax , IAddWithoutSleepy ) + + LInitMaxPyAddb = GraphLoopPyAddAddMemory.Link( OInitMax , IPyAddb ) + + LInitIncrEndInitIncr = GraphLoopPyAddAddMemory.Link( OInitIncr , IEndInitIncr ) + + LAddWithoutSleepGateEndInitGate = GraphLoopPyAddAddMemory.Link( OAddWithoutSleepGate , IEndInitGate ) + + LPyAddaEndInitIndex = GraphLoopPyAddAddMemory.Link( OPyAdda , IEndInitIndex ) + + # Input datas + IInitIndex.Input( 0 ) + IInitMin.Input( 5 ) + IInitMax.Input( 100000 ) + IInitIncr.Input( 1 ) + + # Output Ports of the graph + #OEndInitIndex = EndInit.GetOutPort( 'Index' ) + #OEndInitMin = EndInit.GetOutPort( 'Min' ) + #OEndInitMax = EndInit.GetOutPort( 'Max' ) + #OEndInitIncr = EndInit.GetOutPort( 'Incr' ) + #OAddWithoutSleepFuncValue = AddWithoutSleep.GetOutPort( 'FuncValue' ) + #OAddWithoutSleepz = AddWithoutSleep.GetOutPort( 'z' ) + #OPyAddc = PyAdd.GetOutPort( 'c' ) + return GraphLoopPyAddAddMemory + + +GraphLoopPyAddAddMemory = DefGraphLoopPyAddAddMemory() diff --git a/examples/GraphLoopPyAddAddMemory.xml b/examples/GraphLoopPyAddAddMemory.xml new file mode 100644 index 0000000..8f27281 --- /dev/null +++ b/examples/GraphLoopPyAddAddMemory.xml @@ -0,0 +1,342 @@ + + + + + +? + ? + GraphLoopPyAddAddMemory + 1 + ? + +GraphLoopPyAddAddMemory + + +long + Init__Index + +long + Init__Min + +long + Init__Max + +long + Init__Incr + + +long + EndInit__Index + +long + EndInit__Min + +long + EndInit__Max + +long + EndInit__Incr + +double + AddWithoutSleep__FuncValue + +double + AddWithoutSleep__z + +long + PyAdd__c + + + 24/3/2003 - 14:44:35 + 14/4/2005 - 16:55:59 + 1.04 + JR + ? + For solving of memory leaks + 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 + + + + 14/4/2005 - 16:43:41 + 14/4/2005 - 16:43:41 + 1.04 + ? + ? + Compute Node + 17 + 257 + +? + ? + EndInit + 5 + Init + +EndInit + + +long + Index + +long + Min + +long + Max + +long + Incr + + +long + Index + +long + Min + +long + Max + +long + Incr + + + +? + + 14/4/2005 - 16:43:41 + 14/4/2005 - 16:43:41 + 1.04 + ? + ? + Compute Node + 495 + 262 + +AddComponent + AddComponent + AddWithoutSleep + 0 + ? + +AddWithoutSleep + + +double + x + +double + y + + +double + FuncValue + +double + z + + + 14/4/2005 - 16:44:22 + 14/4/2005 - 16:44:22 + 2.0 + ? + localhost/FactoryServer + AddWithoutSleep from AddComponent + 255 + 352 + +? + ? + PyAdd + 3 + ? + +PyAdd + + +long + a + +long + b + + +long + a + +long + c + + + +PyAdd + + + 14/4/2005 - 16:54:44 + 14/4/2005 - 16:54:44 + 2.0 + ? + ? + Compute Node + 266 + 188 + + +Init + DoLoop + EndInit + DoLoop + + +Init + Index + AddWithoutSleep + x + + +Init + Index + PyAdd + a + + +Init + Min + EndInit + Min + + +Init + Max + EndInit + Max + + +Init + Max + AddWithoutSleep + y + + +Init + Max + PyAdd + b + + +Init + Incr + EndInit + Incr + + +EndInit + DoLoop + Init + DoLoop + + +AddWithoutSleep + Gate + EndInit + Gate + + +PyAdd + a + EndInit + Index + + + +GraphLoopPyAddAddMemory + Init__Index + Init + Index + +3 + 0 + + +GraphLoopPyAddAddMemory + Init__Min + Init + Min + +3 + 5 + + +GraphLoopPyAddAddMemory + Init__Max + Init + Max + +3 + 100000 + + +GraphLoopPyAddAddMemory + Init__Incr + Init + Incr + +3 + 1 + diff --git a/examples/GraphLoopSwitch.py b/examples/GraphLoopSwitch.py index f9998e6..8e947c9 100755 --- a/examples/GraphLoopSwitch.py +++ b/examples/GraphLoopSwitch.py @@ -1,47 +1,62 @@ -# Generated python file of Graph GraphLoopSwitch_1 +# Generated python file of Graph GraphLoopSwitch from SuperV import * -# Graph creation of GraphLoopSwitch_1 -def DefGraphLoopSwitch_1() : - GraphLoopSwitch_1 = Graph( 'GraphLoopSwitch_1' ) - GraphLoopSwitch_1.SetName( 'GraphLoopSwitch_1' ) - GraphLoopSwitch_1.SetAuthor( '' ) - GraphLoopSwitch_1.SetComment( '' ) - GraphLoopSwitch_1.Coords( 0 , 0 ) +# Graph creation of GraphLoopSwitch +def DefGraphLoopSwitch() : + GraphLoopSwitch = Graph( 'GraphLoopSwitch' ) + GraphLoopSwitch.SetName( 'GraphLoopSwitch' ) + GraphLoopSwitch.SetAuthor( 'JR' ) + GraphLoopSwitch.SetComment( '' ) + GraphLoopSwitch.Coords( 0 , 0 ) # Creation of Factory Nodes # Creation of InLine Nodes PyIsOdd = [] - PyIsOdd.append( 'from time import * ' ) - PyIsOdd.append( 'def IsOdd(a,Even) : ' ) - PyIsOdd.append( ' print a,"IsOdd (GraphLoopSwitch1)" ' ) - PyIsOdd.append( ' sleep( 1 ) ' ) - PyIsOdd.append( ' return a ' ) - IsOdd = GraphLoopSwitch_1.INode( 'IsOdd' , PyIsOdd ) + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd(a) : ' ) + PyIsOdd.append( ' print a,"IsOdd (GraphLoopSwitch1)" ' ) + PyIsOdd.append( ' sleep( 1 ) ' ) + PyIsOdd.append( ' return a ' ) + IsOdd = GraphLoopSwitch.INode( 'IsOdd' , PyIsOdd ) IsOdd.SetName( 'IsOdd' ) IsOdd.SetAuthor( '' ) IsOdd.SetComment( 'Python function' ) IsOdd.Coords( 397 , 1 ) IIsOdda = IsOdd.InPort( 'a' , 'long' ) - IIsOddEven = IsOdd.InPort( 'Even' , 'boolean' ) IIsOddGate = IsOdd.GetInPort( 'Gate' ) OIsOdda = IsOdd.OutPort( 'a' , 'long' ) OIsOddGate = IsOdd.GetOutPort( 'Gate' ) + PyValEven = [] + PyValEven.append( 'from time import * ' ) + PyValEven.append( 'def ValEven(Even) : ' ) + PyValEven.append( ' sleep(1) ' ) + PyValEven.append( ' return Even ' ) + PyValEven.append( '' ) + ValEven = GraphLoopSwitch.INode( 'ValEven' , PyValEven ) + ValEven.SetName( 'ValEven' ) + ValEven.SetAuthor( '' ) + ValEven.SetComment( 'Compute Node' ) + ValEven.Coords( 396 , 222 ) + IValEvenEven = ValEven.InPort( 'Even' , 'long' ) + IValEvenGate = ValEven.GetInPort( 'Gate' ) + OValEvenEven = ValEven.OutPort( 'Even' , 'long' ) + OValEvenGate = ValEven.GetOutPort( 'Gate' ) + # Creation of Loop Nodes PyInitLoop = [] PyInitLoop.append( 'def InitLoop(Index,Min,Max) : ' ) PyInitLoop.append( ' Index = Min ' ) PyInitLoop.append( ' return Index,Min,Max ' ) - PyInitLoop.append( ' ' ) + PyInitLoop.append( '' ) PyMoreInitLoop = [] - PyMoreInitLoop.append( ' ' ) + PyMoreInitLoop.append( '' ) PyNextInitLoop = [] - PyNextInitLoop.append( ' ' ) - InitLoop,EndOfInitLoop = GraphLoopSwitch_1.LNode( 'InitLoop' , PyInitLoop , '' , PyMoreInitLoop , '' , PyNextInitLoop ) + PyNextInitLoop.append( '' ) + InitLoop,EndOfInitLoop = GraphLoopSwitch.LNode( 'InitLoop' , PyInitLoop , '' , PyMoreInitLoop , '' , PyNextInitLoop ) EndOfInitLoop.SetName( 'EndOfInitLoop' ) EndOfInitLoop.SetAuthor( '' ) EndOfInitLoop.SetComment( 'Compute Node' ) @@ -73,6 +88,7 @@ def DefGraphLoopSwitch_1() : OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) + OEndOfInitLoopGate = EndOfInitLoop.GetOutPort( 'Gate' ) InitLoop.SetName( 'InitLoop' ) InitLoop.SetAuthor( '' ) InitLoop.SetComment( 'Compute Node' ) @@ -85,18 +101,18 @@ def DefGraphLoopSwitch_1() : PySwitch.append( ' if ( a & 1 ) == 0 : ' ) PySwitch.append( ' sleep(1) ' ) PySwitch.append( ' return a & 1,1-(a&1),a ' ) - Switch,EndSwitch = GraphLoopSwitch_1.SNode( 'Switch' , PySwitch ) + Switch,EndSwitch = GraphLoopSwitch.SNode( 'Switch' , PySwitch ) EndSwitch.SetName( 'EndSwitch' ) EndSwitch.SetAuthor( '' ) EndSwitch.SetComment( 'Compute Node' ) EndSwitch.Coords( 587 , 103 ) PyEndSwitch = [] - PyEndSwitch.append( 'def EndSwitch(a) : ' ) - PyEndSwitch.append( ' if ( a & 1 ) == 0 : ' ) - PyEndSwitch.append( ' sleep(1) ' ) - PyEndSwitch.append( ' return a ' ) + PyEndSwitch.append( 'def EndSwitch(a,Even) : ' ) + PyEndSwitch.append( ' sleep(1) ' ) + PyEndSwitch.append( ' return a ' ) EndSwitch.SetPyFunction( 'EndSwitch' , PyEndSwitch ) IEndSwitcha = EndSwitch.InPort( 'a' , 'long' ) + IEndSwitchEven = EndSwitch.InPort( 'Even' , 'long' ) IEndSwitchDefault = EndSwitch.GetInPort( 'Default' ) OEndSwitcha = EndSwitch.OutPort( 'a' , 'long' ) OEndSwitchGate = EndSwitch.GetOutPort( 'Gate' ) @@ -112,40 +128,36 @@ def DefGraphLoopSwitch_1() : OSwitchDefault = Switch.GetOutPort( 'Default' ) # Creation of Links - LIsOddaEndSwitcha = GraphLoopSwitch_1.Link( OIsOdda , IEndSwitcha ) - LIsOddaEndSwitcha.AddCoord( 1 , 576 , 136 ) - LIsOddaEndSwitcha.AddCoord( 2 , 575 , 81 ) + LIsOddaEndSwitcha = GraphLoopSwitch.Link( OIsOdda , IEndSwitcha ) + + LInitLoopIndexSwitcha = GraphLoopSwitch.Link( OInitLoopIndex , ISwitcha ) - LInitLoopIndexSwitcha = GraphLoopSwitch_1.Link( OInitLoopIndex , ISwitcha ) + LInitLoopMinEndOfInitLoopMin = GraphLoopSwitch.Link( OInitLoopMin , IEndOfInitLoopMin ) - LInitLoopMinEndOfInitLoopMin = GraphLoopSwitch_1.Link( OInitLoopMin , IEndOfInitLoopMin ) + LInitLoopMaxEndOfInitLoopMax = GraphLoopSwitch.Link( OInitLoopMax , IEndOfInitLoopMax ) - LInitLoopMaxEndOfInitLoopMax = GraphLoopSwitch_1.Link( OInitLoopMax , IEndOfInitLoopMax ) + LSwitchOddIsOddGate = GraphLoopSwitch.Link( OSwitchOdd , IIsOddGate ) - LSwitchOddIsOddGate = GraphLoopSwitch_1.Link( OSwitchOdd , IIsOddGate ) + LSwitchEvenValEvenEven = GraphLoopSwitch.Link( OSwitchEven , IValEvenEven ) - LSwitchEvenEndSwitchDefault = GraphLoopSwitch_1.Link( OSwitchEven , IEndSwitchDefault ) + LSwitchaIsOdda = GraphLoopSwitch.Link( OSwitcha , IIsOdda ) - LSwitchEvenIsOddEven = GraphLoopSwitch_1.Link( OSwitchEven , IIsOddEven ) - LSwitchEvenIsOddEven.AddCoord( 1 , 375 , 111 ) - LSwitchEvenIsOddEven.AddCoord( 2 , 375 , 172 ) + LSwitchDefaultEndSwitchDefault = GraphLoopSwitch.Link( OSwitchDefault , IEndSwitchDefault ) - LSwitchaIsOdda = GraphLoopSwitch_1.Link( OSwitcha , IIsOdda ) - LSwitchaIsOdda.AddCoord( 1 , 362 , 82 ) - LSwitchaIsOdda.AddCoord( 2 , 360 , 201 ) + LEndSwitchaEndOfInitLoopIndex = GraphLoopSwitch.Link( OEndSwitcha , IEndOfInitLoopIndex ) - LEndSwitchaEndOfInitLoopIndex = GraphLoopSwitch_1.Link( OEndSwitcha , IEndOfInitLoopIndex ) + LValEvenEvenEndSwitchEven = GraphLoopSwitch.Link( OValEvenEven , IEndSwitchEven ) # Input datas IInitLoopIndex.Input( 0 ) IInitLoopMin.Input( 5 ) - IInitLoopMax.Input( 100 ) + IInitLoopMax.Input( 23 ) # Output Ports of the graph #OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) #OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) #OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) - return GraphLoopSwitch_1 + return GraphLoopSwitch -GraphLoopSwitch_1 = DefGraphLoopSwitch_1() +GraphLoopSwitch = DefGraphLoopSwitch() diff --git a/examples/GraphLoopSwitch.xml b/examples/GraphLoopSwitch.xml index d52d92f..b66b224 100755 --- a/examples/GraphLoopSwitch.xml +++ b/examples/GraphLoopSwitch.xml @@ -5,11 +5,11 @@ ? ? - GraphLoopSwitch_1 + GraphLoopSwitch 1 ? -GraphLoopSwitch_1 +GraphLoopSwitch long @@ -33,9 +33,9 @@ 22/10/2003 - 10:36:39 - 16/12/2004 - 16:45:0 + 8/3/2005 - 15:8:55 1.05 - ? + JR ? ? 0 @@ -52,10 +52,7 @@ long - a - -boolean - Even + a long @@ -64,13 +61,13 @@ IsOdd - - - - - - 16/12/2004 - 16:45:0 - 16/12/2004 - 16:45:0 + + + + + + 8/3/2005 - 15:8:55 + 8/3/2005 - 15:8:55 1.05 ? ? @@ -119,8 +116,8 @@ ? - 16/12/2004 - 16:45:0 - 16/12/2004 - 16:45:0 + 8/3/2005 - 15:8:55 + 8/3/2005 - 15:8:55 1.05 ? ? @@ -166,8 +163,8 @@ - 16/12/2004 - 16:45:0 - 16/12/2004 - 16:45:0 + 8/3/2005 - 15:8:55 + 8/3/2005 - 15:8:55 1.05 ? ? @@ -205,8 +202,8 @@ - 16/12/2004 - 16:45:0 - 16/12/2004 - 16:45:0 + 8/3/2005 - 15:8:55 + 8/3/2005 - 15:8:55 1.05 ? ? @@ -224,7 +221,10 @@ long - a + a + +long + Even long @@ -233,31 +233,57 @@ EndSwitch - - - - - 16/12/2004 - 16:45:0 - 16/12/2004 - 16:45:0 + + + + 8/3/2005 - 15:8:55 + 8/3/2005 - 15:8:55 1.05 ? ? Compute Node 587 - 103 + 103 + +? + ? + ValEven + 3 + ? + +ValEven + + +long + Even + + +long + Even + + + +ValEven + + + + + + 8/3/2005 - 15:8:55 + 8/3/2005 - 15:8:55 + 2.0 + ? + ? + Compute Node + 396 + 222 IsOdd a EndSwitch a - - -576 - 136 - -575 - 81 + InitLoop DoLoop @@ -297,42 +323,36 @@ Switch Even - EndSwitch - Default - - -Switch - Even - IsOdd + ValEven Even - - -375 - 111 - -375 - 172 + Switch a IsOdd a - - -362 - 82 - -360 - 201 + + +Switch + Default + EndSwitch + Default + EndSwitch a EndOfInitLoop Index + + +ValEven + Even + EndSwitch + Even -GraphLoopSwitch_1 +GraphLoopSwitch InitLoop__Index InitLoop Index @@ -341,7 +361,7 @@ 0 -GraphLoopSwitch_1 +GraphLoopSwitch InitLoop__Min InitLoop Min @@ -350,11 +370,11 @@ 5 -GraphLoopSwitch_1 +GraphLoopSwitch InitLoop__Max InitLoop Max 3 - 100 + 23 diff --git a/examples/GraphLoopSwitchDefault.py b/examples/GraphLoopSwitchDefault.py new file mode 100644 index 0000000..3118178 --- /dev/null +++ b/examples/GraphLoopSwitchDefault.py @@ -0,0 +1,144 @@ + +# Generated python file of Graph GraphLoopSwitchDefault + +from SuperV import * + +# Graph creation of GraphLoopSwitchDefault +def DefGraphLoopSwitchDefault() : + GraphLoopSwitchDefault = Graph( 'GraphLoopSwitchDefault' ) + GraphLoopSwitchDefault.SetName( 'GraphLoopSwitchDefault' ) + GraphLoopSwitchDefault.SetAuthor( 'JR' ) + GraphLoopSwitchDefault.SetComment( '' ) + GraphLoopSwitchDefault.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsOdd = [] + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd(a) : ' ) + PyIsOdd.append( ' print a,"IsOdd (GraphLoopSwitch1)" ' ) + PyIsOdd.append( ' sleep( 1 ) ' ) + PyIsOdd.append( ' return a ' ) + IsOdd = GraphLoopSwitchDefault.INode( 'IsOdd' , PyIsOdd ) + IsOdd.SetName( 'IsOdd' ) + IsOdd.SetAuthor( '' ) + IsOdd.SetComment( 'Python function' ) + IsOdd.Coords( 397 , 1 ) + IIsOdda = IsOdd.InPort( 'a' , 'long' ) + IIsOddGate = IsOdd.GetInPort( 'Gate' ) + OIsOdda = IsOdd.OutPort( 'a' , 'long' ) + OIsOddGate = IsOdd.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyInitLoop = [] + PyInitLoop.append( 'def InitLoop(Index,Min,Max) : ' ) + PyInitLoop.append( ' Index = Min ' ) + PyInitLoop.append( ' return Index,Min,Max ' ) + PyInitLoop.append( '' ) + PyMoreInitLoop = [] + PyMoreInitLoop.append( '' ) + PyNextInitLoop = [] + PyNextInitLoop.append( '' ) + InitLoop,EndOfInitLoop = GraphLoopSwitchDefault.LNode( 'InitLoop' , PyInitLoop , '' , PyMoreInitLoop , '' , PyNextInitLoop ) + EndOfInitLoop.SetName( 'EndOfInitLoop' ) + EndOfInitLoop.SetAuthor( '' ) + EndOfInitLoop.SetComment( 'Compute Node' ) + EndOfInitLoop.Coords( 767 , 102 ) + PyEndOfInitLoop = [] + PyEndOfInitLoop.append( 'def EndOfInitLoop( DoLoop , Index , Min , Max ) :' ) + PyEndOfInitLoop.append( ' Index = Index + 1 ' ) + PyEndOfInitLoop.append( ' if Index <= Max : ' ) + PyEndOfInitLoop.append( ' DoLoop = 1 ' ) + PyEndOfInitLoop.append( ' else : ' ) + PyEndOfInitLoop.append( ' DoLoop = 0 ' ) + PyEndOfInitLoop.append( ' return DoLoop,Index,Min,Max ' ) + EndOfInitLoop.SetPyFunction( 'EndOfInitLoop' , PyEndOfInitLoop ) + IInitLoopDoLoop = InitLoop.GetInPort( 'DoLoop' ) + IInitLoopIndex = InitLoop.InPort( 'Index' , 'long' ) + IInitLoopMin = InitLoop.InPort( 'Min' , 'long' ) + IInitLoopMax = InitLoop.InPort( 'Max' , 'long' ) + IInitLoopGate = InitLoop.GetInPort( 'Gate' ) + OInitLoopDoLoop = InitLoop.GetOutPort( 'DoLoop' ) + OInitLoopIndex = InitLoop.GetOutPort( 'Index' ) + OInitLoopMin = InitLoop.GetOutPort( 'Min' ) + OInitLoopMax = InitLoop.GetOutPort( 'Max' ) + IEndOfInitLoopDoLoop = EndOfInitLoop.GetInPort( 'DoLoop' ) + IEndOfInitLoopIndex = EndOfInitLoop.GetInPort( 'Index' ) + IEndOfInitLoopMin = EndOfInitLoop.GetInPort( 'Min' ) + IEndOfInitLoopMax = EndOfInitLoop.GetInPort( 'Max' ) + IEndOfInitLoopGate = EndOfInitLoop.GetInPort( 'Gate' ) + OEndOfInitLoopDoLoop = EndOfInitLoop.GetOutPort( 'DoLoop' ) + OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) + OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) + OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) + OEndOfInitLoopGate = EndOfInitLoop.GetOutPort( 'Gate' ) + InitLoop.SetName( 'InitLoop' ) + InitLoop.SetAuthor( '' ) + InitLoop.SetComment( 'Compute Node' ) + InitLoop.Coords( 10 , 108 ) + + # Creation of Switch Nodes + PySwitch = [] + PySwitch.append( 'from time import * ' ) + PySwitch.append( 'def Switch(a) : ' ) + PySwitch.append( ' if ( a & 1 ) == 0 : ' ) + PySwitch.append( ' sleep(1) ' ) + PySwitch.append( ' return a & 1,1-(a&1),a ' ) + Switch,EndSwitch = GraphLoopSwitchDefault.SNode( 'Switch' , PySwitch ) + EndSwitch.SetName( 'EndSwitch' ) + EndSwitch.SetAuthor( '' ) + EndSwitch.SetComment( 'Compute Node' ) + EndSwitch.Coords( 587 , 103 ) + PyEndSwitch = [] + PyEndSwitch.append( 'def EndSwitch(a) : ' ) + PyEndSwitch.append( ' if ( a & 1 ) == 0 : ' ) + PyEndSwitch.append( ' sleep(1) ' ) + PyEndSwitch.append( ' return a ' ) + EndSwitch.SetPyFunction( 'EndSwitch' , PyEndSwitch ) + IEndSwitcha = EndSwitch.InPort( 'a' , 'long' ) + IEndSwitchDefault = EndSwitch.GetInPort( 'Default' ) + OEndSwitcha = EndSwitch.OutPort( 'a' , 'long' ) + OEndSwitchGate = EndSwitch.GetOutPort( 'Gate' ) + Switch.SetName( 'Switch' ) + Switch.SetAuthor( '' ) + Switch.SetComment( 'Compute Node' ) + Switch.Coords( 194 , 109 ) + ISwitcha = Switch.InPort( 'a' , 'long' ) + ISwitchGate = Switch.GetInPort( 'Gate' ) + OSwitchOdd = Switch.OutPort( 'Odd' , 'long' ) + OSwitchEven = Switch.OutPort( 'Even' , 'int' ) + OSwitcha = Switch.OutPort( 'a' , 'int' ) + OSwitchDefault = Switch.GetOutPort( 'Default' ) + + # Creation of Links + LIsOddaEndSwitcha = GraphLoopSwitchDefault.Link( OIsOdda , IEndSwitcha ) + + LInitLoopIndexSwitcha = GraphLoopSwitchDefault.Link( OInitLoopIndex , ISwitcha ) + + LInitLoopMinEndOfInitLoopMin = GraphLoopSwitchDefault.Link( OInitLoopMin , IEndOfInitLoopMin ) + + LInitLoopMaxEndOfInitLoopMax = GraphLoopSwitchDefault.Link( OInitLoopMax , IEndOfInitLoopMax ) + + LSwitchOddIsOddGate = GraphLoopSwitchDefault.Link( OSwitchOdd , IIsOddGate ) + + LSwitchaIsOdda = GraphLoopSwitchDefault.Link( OSwitcha , IIsOdda ) + + LSwitchDefaultEndSwitchDefault = GraphLoopSwitchDefault.Link( OSwitchDefault , IEndSwitchDefault ) + + LEndSwitchaEndOfInitLoopIndex = GraphLoopSwitchDefault.Link( OEndSwitcha , IEndOfInitLoopIndex ) + + # Input datas + IInitLoopIndex.Input( 0 ) + IInitLoopMin.Input( 5 ) + IInitLoopMax.Input( 23 ) + + # Output Ports of the graph + #OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) + #OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) + #OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) + #OSwitchEven = Switch.GetOutPort( 'Even' ) + return GraphLoopSwitchDefault + + +GraphLoopSwitchDefault = DefGraphLoopSwitchDefault() diff --git a/examples/GraphLoopSwitchDefault.xml b/examples/GraphLoopSwitchDefault.xml new file mode 100644 index 0000000..9cc9dea --- /dev/null +++ b/examples/GraphLoopSwitchDefault.xml @@ -0,0 +1,336 @@ + + + + + +? + ? + GraphLoopSwitchDefault + 1 + ? + +GraphLoopSwitch_1_1 + + +long + InitLoop__Index + +long + InitLoop__Min + +long + InitLoop__Max + + +long + EndOfInitLoop__Index + +long + EndOfInitLoop__Min + +long + EndOfInitLoop__Max + +int + Switch__Even + + + 22/10/2003 - 10:36:39 + 9/2/2005 - 10:29:19 + 1.05 + JR + ? + ? + 0 + 0 + + +? + ? + IsOdd + 3 + ? + +IsOdd + + +long + a + + +long + a + + + +IsOdd + + + + + + 9/2/2005 - 10:29:19 + 9/2/2005 - 10:29:19 + 1.05 + ? + ? + Python function + 397 + 1 + +? + ? + InitLoop + 4 + EndOfInitLoop + +InitLoop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +InitLoop + + + + + +? + + +? + + 9/2/2005 - 10:29:19 + 9/2/2005 - 10:29:19 + 1.05 + ? + ? + Compute Node + 10 + 108 + +? + ? + EndOfInitLoop + 5 + InitLoop + +EndOfInitLoop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +EndOfInitLoop + + + + + + + + 9/2/2005 - 10:29:19 + 9/2/2005 - 10:29:19 + 1.05 + ? + ? + Compute Node + 767 + 102 + +? + ? + Switch + 6 + EndSwitch + +Switch + + +long + a + + +long + Odd + +int + Even + +int + a + + + +Switch + + + + + + 9/2/2005 - 10:29:19 + 9/2/2005 - 10:29:19 + 1.05 + ? + ? + Compute Node + 194 + 109 + +? + ? + EndSwitch + 7 + Switch + +EndSwitch + + +long + a + + +long + a + + + +EndSwitch + + + + + 9/2/2005 - 10:29:19 + 9/2/2005 - 10:29:19 + 1.05 + ? + ? + Compute Node + 587 + 103 + + +IsOdd + a + EndSwitch + a + + +InitLoop + DoLoop + EndOfInitLoop + DoLoop + + +InitLoop + Index + Switch + a + + +InitLoop + Min + EndOfInitLoop + Min + + +InitLoop + Max + EndOfInitLoop + Max + + +EndOfInitLoop + DoLoop + InitLoop + DoLoop + + +Switch + Odd + IsOdd + Gate + + +Switch + a + IsOdd + a + + +Switch + Default + EndSwitch + Default + + +EndSwitch + a + EndOfInitLoop + Index + + + +GraphLoopSwitchDefault + InitLoop__Index + InitLoop + Index + +3 + 0 + + +GraphLoopSwitchDefault + InitLoop__Min + InitLoop + Min + +3 + 5 + + +GraphLoopSwitchDefault + InitLoop__Max + InitLoop + Max + +3 + 23 + diff --git a/examples/GraphLoopSwitchDefaultAborted.py b/examples/GraphLoopSwitchDefaultAborted.py new file mode 100644 index 0000000..8ede72b --- /dev/null +++ b/examples/GraphLoopSwitchDefaultAborted.py @@ -0,0 +1,161 @@ + +# Generated python file of Graph GraphLoopSwitchDefaultAborted + +from SuperV import * + +# Graph creation of GraphLoopSwitchDefaultAborted +def DefGraphLoopSwitchDefaultAborted() : + GraphLoopSwitchDefaultAborted = Graph( 'GraphLoopSwitchDefaultAborted' ) + GraphLoopSwitchDefaultAborted.SetName( 'GraphLoopSwitchDefaultAborted' ) + GraphLoopSwitchDefaultAborted.SetAuthor( 'JR' ) + GraphLoopSwitchDefaultAborted.SetComment( 'Default Ports are not connected and the Executor will detect a Default condition ==> ABORT' ) + GraphLoopSwitchDefaultAborted.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsOdd = [] + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd(a) : ' ) + PyIsOdd.append( ' print a,"IsOdd (GraphLoopSwitch1)" ' ) + PyIsOdd.append( ' sleep( 1 ) ' ) + PyIsOdd.append( ' return a ' ) + IsOdd = GraphLoopSwitchDefaultAborted.INode( 'IsOdd' , PyIsOdd ) + IsOdd.SetName( 'IsOdd' ) + IsOdd.SetAuthor( '' ) + IsOdd.SetComment( 'Python function' ) + IsOdd.Coords( 397 , 1 ) + IIsOdda = IsOdd.InPort( 'a' , 'long' ) + IIsOddGate = IsOdd.GetInPort( 'Gate' ) + OIsOdda = IsOdd.OutPort( 'a' , 'long' ) + OIsOddGate = IsOdd.GetOutPort( 'Gate' ) + + PyVala = [] + PyVala.append( 'from time import * ' ) + PyVala.append( 'def ValEven(Even) : ' ) + PyVala.append( ' sleep(1) ' ) + PyVala.append( ' return Even ' ) + PyVala.append( '' ) + Vala = GraphLoopSwitchDefaultAborted.INode( 'ValEven' , PyVala ) + Vala.SetName( 'Vala' ) + Vala.SetAuthor( '' ) + Vala.SetComment( 'Compute Node' ) + Vala.Coords( 394 , 137 ) + IValaEven = Vala.InPort( 'Even' , 'long' ) + IValaGate = Vala.GetInPort( 'Gate' ) + OValaEven = Vala.OutPort( 'Even' , 'long' ) + OValaGate = Vala.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyInitLoop = [] + PyInitLoop.append( 'def InitLoop(Index,Min,Max) : ' ) + PyInitLoop.append( ' Index = Min ' ) + PyInitLoop.append( ' return Index,Min,Max ' ) + PyInitLoop.append( '' ) + PyMoreInitLoop = [] + PyMoreInitLoop.append( '' ) + PyNextInitLoop = [] + PyNextInitLoop.append( '' ) + InitLoop,EndOfInitLoop = GraphLoopSwitchDefaultAborted.LNode( 'InitLoop' , PyInitLoop , '' , PyMoreInitLoop , '' , PyNextInitLoop ) + EndOfInitLoop.SetName( 'EndOfInitLoop' ) + EndOfInitLoop.SetAuthor( '' ) + EndOfInitLoop.SetComment( 'Compute Node' ) + EndOfInitLoop.Coords( 767 , 102 ) + PyEndOfInitLoop = [] + PyEndOfInitLoop.append( 'def EndOfInitLoop( DoLoop , Index , Min , Max ) :' ) + PyEndOfInitLoop.append( ' Index = Index + 1 ' ) + PyEndOfInitLoop.append( ' if Index <= Max : ' ) + PyEndOfInitLoop.append( ' DoLoop = 1 ' ) + PyEndOfInitLoop.append( ' else : ' ) + PyEndOfInitLoop.append( ' DoLoop = 0 ' ) + PyEndOfInitLoop.append( ' return DoLoop,Index,Min,Max ' ) + EndOfInitLoop.SetPyFunction( 'EndOfInitLoop' , PyEndOfInitLoop ) + IInitLoopDoLoop = InitLoop.GetInPort( 'DoLoop' ) + IInitLoopIndex = InitLoop.InPort( 'Index' , 'long' ) + IInitLoopMin = InitLoop.InPort( 'Min' , 'long' ) + IInitLoopMax = InitLoop.InPort( 'Max' , 'long' ) + IInitLoopGate = InitLoop.GetInPort( 'Gate' ) + OInitLoopDoLoop = InitLoop.GetOutPort( 'DoLoop' ) + OInitLoopIndex = InitLoop.GetOutPort( 'Index' ) + OInitLoopMin = InitLoop.GetOutPort( 'Min' ) + OInitLoopMax = InitLoop.GetOutPort( 'Max' ) + IEndOfInitLoopDoLoop = EndOfInitLoop.GetInPort( 'DoLoop' ) + IEndOfInitLoopIndex = EndOfInitLoop.GetInPort( 'Index' ) + IEndOfInitLoopMin = EndOfInitLoop.GetInPort( 'Min' ) + IEndOfInitLoopMax = EndOfInitLoop.GetInPort( 'Max' ) + IEndOfInitLoopGate = EndOfInitLoop.GetInPort( 'Gate' ) + OEndOfInitLoopDoLoop = EndOfInitLoop.GetOutPort( 'DoLoop' ) + OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) + OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) + OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) + OEndOfInitLoopGate = EndOfInitLoop.GetOutPort( 'Gate' ) + InitLoop.SetName( 'InitLoop' ) + InitLoop.SetAuthor( '' ) + InitLoop.SetComment( 'Compute Node' ) + InitLoop.Coords( 10 , 108 ) + + # Creation of Switch Nodes + PySwitch = [] + PySwitch.append( 'from time import * ' ) + PySwitch.append( 'def Switch(a) : ' ) + PySwitch.append( ' if ( a & 1 ) == 0 : ' ) + PySwitch.append( ' sleep(1) ' ) + PySwitch.append( ' return a & 1,1-(a&1),a ' ) + Switch,EndSwitch = GraphLoopSwitchDefaultAborted.SNode( 'Switch' , PySwitch ) + EndSwitch.SetName( 'EndSwitch' ) + EndSwitch.SetAuthor( '' ) + EndSwitch.SetComment( 'Compute Node' ) + EndSwitch.Coords( 587 , 103 ) + PyEndSwitch = [] + PyEndSwitch.append( 'def EndSwitch(a,Even) : ' ) + PyEndSwitch.append( ' sleep(1) ' ) + PyEndSwitch.append( ' return a ' ) + EndSwitch.SetPyFunction( 'EndSwitch' , PyEndSwitch ) + IEndSwitcha = EndSwitch.InPort( 'a' , 'long' ) + IEndSwitchEven = EndSwitch.InPort( 'Even' , 'long' ) + IEndSwitchDefault = EndSwitch.GetInPort( 'Default' ) + OEndSwitcha = EndSwitch.OutPort( 'a' , 'long' ) + OEndSwitchGate = EndSwitch.GetOutPort( 'Gate' ) + Switch.SetName( 'Switch' ) + Switch.SetAuthor( '' ) + Switch.SetComment( 'Compute Node' ) + Switch.Coords( 194 , 109 ) + ISwitcha = Switch.InPort( 'a' , 'long' ) + ISwitchGate = Switch.GetInPort( 'Gate' ) + OSwitchOdd = Switch.OutPort( 'Odd' , 'long' ) + OSwitchEven = Switch.OutPort( 'Even' , 'int' ) + OSwitcha = Switch.OutPort( 'a' , 'int' ) + OSwitchDefault = Switch.GetOutPort( 'Default' ) + + # Creation of Links + LIsOddaEndSwitcha = GraphLoopSwitchDefaultAborted.Link( OIsOdda , IEndSwitcha ) + + LInitLoopIndexSwitcha = GraphLoopSwitchDefaultAborted.Link( OInitLoopIndex , ISwitcha ) + + LInitLoopMinEndOfInitLoopMin = GraphLoopSwitchDefaultAborted.Link( OInitLoopMin , IEndOfInitLoopMin ) + + LInitLoopMaxEndOfInitLoopMax = GraphLoopSwitchDefaultAborted.Link( OInitLoopMax , IEndOfInitLoopMax ) + + LSwitchOddIsOddGate = GraphLoopSwitchDefaultAborted.Link( OSwitchOdd , IIsOddGate ) + + LSwitchEvenValaEven = GraphLoopSwitchDefaultAborted.Link( OSwitchEven , IValaEven ) + + LSwitchaIsOdda = GraphLoopSwitchDefaultAborted.Link( OSwitcha , IIsOdda ) + + LEndSwitchaEndOfInitLoopIndex = GraphLoopSwitchDefaultAborted.Link( OEndSwitcha , IEndOfInitLoopIndex ) + + LValaEvenEndSwitchEven = GraphLoopSwitchDefaultAborted.Link( OValaEven , IEndSwitchEven ) + + # Input datas + IInitLoopIndex.Input( 0 ) + IInitLoopMin.Input( 5 ) + IInitLoopMax.Input( 23 ) + + # Output Ports of the graph + #OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) + #OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) + #OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) + return GraphLoopSwitchDefaultAborted + + +GraphLoopSwitchDefaultAborted = DefGraphLoopSwitchDefaultAborted() diff --git a/examples/GraphLoopSwitchDefaultAborted.xml b/examples/GraphLoopSwitchDefaultAborted.xml new file mode 100644 index 0000000..6fdf946 --- /dev/null +++ b/examples/GraphLoopSwitchDefaultAborted.xml @@ -0,0 +1,374 @@ + + + + + +? + ? + GraphLoopSwitchDefaultAborted + 1 + ? + +GraphLoopSwitch_1 + + +long + InitLoop__Index + +long + InitLoop__Min + +long + InitLoop__Max + + +long + EndOfInitLoop__Index + +long + EndOfInitLoop__Min + +long + EndOfInitLoop__Max + + + 22/10/2003 - 10:36:39 + 11/2/2005 - 11:46:10 + 1.05 + JR + ? + Default Ports are not connected and the Executor will detect a Default condition ==> ABORT + 0 + 0 + + +? + ? + IsOdd + 3 + ? + +IsOdd + + +long + a + + +long + a + + + +IsOdd + + + + + + 11/2/2005 - 11:46:10 + 11/2/2005 - 11:46:10 + 1.05 + ? + ? + Python function + 397 + 1 + +? + ? + InitLoop + 4 + EndOfInitLoop + +InitLoop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +InitLoop + + + + + +? + + +? + + 11/2/2005 - 11:46:10 + 11/2/2005 - 11:46:10 + 1.05 + ? + ? + Compute Node + 10 + 108 + +? + ? + EndOfInitLoop + 5 + InitLoop + +EndOfInitLoop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +EndOfInitLoop + + + + + + + + 11/2/2005 - 11:46:10 + 11/2/2005 - 11:46:10 + 1.05 + ? + ? + Compute Node + 767 + 102 + +? + ? + Switch + 6 + EndSwitch + +Switch + + +long + a + + +long + Odd + +int + Even + +int + a + + + +Switch + + + + + + 11/2/2005 - 11:46:10 + 11/2/2005 - 11:46:10 + 1.05 + ? + ? + Compute Node + 194 + 109 + +? + ? + EndSwitch + 7 + Switch + +EndSwitch + + +long + a + +long + Even + + +long + a + + + +EndSwitch + + + + 11/2/2005 - 11:46:10 + 11/2/2005 - 11:46:10 + 1.05 + ? + ? + Compute Node + 587 + 103 + +? + ? + Vala + 3 + ? + +Vala + + +long + Even + + +long + Even + + + +ValEven + + + + + + 11/2/2005 - 11:46:10 + 11/2/2005 - 11:46:10 + 2.0 + ? + ? + Compute Node + 394 + 137 + + +IsOdd + a + EndSwitch + a + + +InitLoop + DoLoop + EndOfInitLoop + DoLoop + + +InitLoop + Index + Switch + a + + +InitLoop + Min + EndOfInitLoop + Min + + +InitLoop + Max + EndOfInitLoop + Max + + +EndOfInitLoop + DoLoop + InitLoop + DoLoop + + +Switch + Odd + IsOdd + Gate + + +Switch + Even + Vala + Even + + +Switch + a + IsOdd + a + + +EndSwitch + a + EndOfInitLoop + Index + + +Vala + Even + EndSwitch + Even + + + +GraphLoopSwitchDefaultAborted + InitLoop__Index + InitLoop + Index + +3 + 0 + + +GraphLoopSwitchDefaultAborted + InitLoop__Min + InitLoop + Min + +3 + 5 + + +GraphLoopSwitchDefaultAborted + InitLoop__Max + InitLoop + Max + +3 + 23 + diff --git a/examples/GraphLoopSwitchGateDefault.py b/examples/GraphLoopSwitchGateDefault.py new file mode 100644 index 0000000..c2be5ff --- /dev/null +++ b/examples/GraphLoopSwitchGateDefault.py @@ -0,0 +1,165 @@ + +# Generated python file of Graph GraphLoopSwitchGateDefault + +from SuperV import * + +# Graph creation of GraphLoopSwitchGateDefault +def DefGraphLoopSwitchGateDefault() : + GraphLoopSwitchGateDefault = Graph( 'GraphLoopSwitchGateDefault' ) + GraphLoopSwitchGateDefault.SetName( 'GraphLoopSwitchGateDefault' ) + GraphLoopSwitchGateDefault.SetAuthor( 'JR' ) + GraphLoopSwitchGateDefault.SetComment( '' ) + GraphLoopSwitchGateDefault.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsOdd = [] + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd(a) : ' ) + PyIsOdd.append( ' print a,"IsOdd (GraphLoopSwitch1)" ' ) + PyIsOdd.append( ' sleep( 1 ) ' ) + PyIsOdd.append( ' return a ' ) + IsOdd = GraphLoopSwitchGateDefault.INode( 'IsOdd' , PyIsOdd ) + IsOdd.SetName( 'IsOdd' ) + IsOdd.SetAuthor( '' ) + IsOdd.SetComment( 'Python function' ) + IsOdd.Coords( 397 , 1 ) + IIsOdda = IsOdd.InPort( 'a' , 'long' ) + IIsOddGate = IsOdd.GetInPort( 'Gate' ) + OIsOdda = IsOdd.OutPort( 'a' , 'long' ) + OIsOddGate = IsOdd.GetOutPort( 'Gate' ) + + PyValEven = [] + PyValEven.append( 'from time import * ' ) + PyValEven.append( 'def ValEven(Even) : ' ) + PyValEven.append( ' sleep(1) ' ) + PyValEven.append( ' return Even ' ) + PyValEven.append( '' ) + ValEven = GraphLoopSwitchGateDefault.INode( 'ValEven' , PyValEven ) + ValEven.SetName( 'ValEven' ) + ValEven.SetAuthor( '' ) + ValEven.SetComment( 'Compute Node' ) + ValEven.Coords( 396 , 222 ) + IValEvenEven = ValEven.InPort( 'Even' , 'long' ) + IValEvenGate = ValEven.GetInPort( 'Gate' ) + OValEvenEven = ValEven.OutPort( 'Even' , 'long' ) + OValEvenGate = ValEven.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyInitLoop = [] + PyInitLoop.append( 'def InitLoop(Index,Min,Max) : ' ) + PyInitLoop.append( ' Index = Min ' ) + PyInitLoop.append( ' return Index,Min,Max ' ) + PyInitLoop.append( '' ) + PyMoreInitLoop = [] + PyMoreInitLoop.append( '' ) + PyNextInitLoop = [] + PyNextInitLoop.append( '' ) + InitLoop,EndOfInitLoop = GraphLoopSwitchGateDefault.LNode( 'InitLoop' , PyInitLoop , '' , PyMoreInitLoop , '' , PyNextInitLoop ) + EndOfInitLoop.SetName( 'EndOfInitLoop' ) + EndOfInitLoop.SetAuthor( '' ) + EndOfInitLoop.SetComment( 'Compute Node' ) + EndOfInitLoop.Coords( 767 , 102 ) + PyEndOfInitLoop = [] + PyEndOfInitLoop.append( 'def EndOfInitLoop( DoLoop , Index , Min , Max ) :' ) + PyEndOfInitLoop.append( ' Index = Index + 1 ' ) + PyEndOfInitLoop.append( ' if Index <= Max : ' ) + PyEndOfInitLoop.append( ' DoLoop = 1 ' ) + PyEndOfInitLoop.append( ' else : ' ) + PyEndOfInitLoop.append( ' DoLoop = 0 ' ) + PyEndOfInitLoop.append( ' return DoLoop,Index,Min,Max ' ) + EndOfInitLoop.SetPyFunction( 'EndOfInitLoop' , PyEndOfInitLoop ) + IInitLoopDoLoop = InitLoop.GetInPort( 'DoLoop' ) + IInitLoopIndex = InitLoop.InPort( 'Index' , 'long' ) + IInitLoopMin = InitLoop.InPort( 'Min' , 'long' ) + IInitLoopMax = InitLoop.InPort( 'Max' , 'long' ) + IInitLoopGate = InitLoop.GetInPort( 'Gate' ) + OInitLoopDoLoop = InitLoop.GetOutPort( 'DoLoop' ) + OInitLoopIndex = InitLoop.GetOutPort( 'Index' ) + OInitLoopMin = InitLoop.GetOutPort( 'Min' ) + OInitLoopMax = InitLoop.GetOutPort( 'Max' ) + IEndOfInitLoopDoLoop = EndOfInitLoop.GetInPort( 'DoLoop' ) + IEndOfInitLoopIndex = EndOfInitLoop.GetInPort( 'Index' ) + IEndOfInitLoopMin = EndOfInitLoop.GetInPort( 'Min' ) + IEndOfInitLoopMax = EndOfInitLoop.GetInPort( 'Max' ) + IEndOfInitLoopGate = EndOfInitLoop.GetInPort( 'Gate' ) + OEndOfInitLoopDoLoop = EndOfInitLoop.GetOutPort( 'DoLoop' ) + OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) + OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) + OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) + OEndOfInitLoopGate = EndOfInitLoop.GetOutPort( 'Gate' ) + InitLoop.SetName( 'InitLoop' ) + InitLoop.SetAuthor( '' ) + InitLoop.SetComment( 'Compute Node' ) + InitLoop.Coords( 10 , 108 ) + + # Creation of Switch Nodes + PySwitch = [] + PySwitch.append( 'from time import * ' ) + PySwitch.append( 'def Switch(a) : ' ) + PySwitch.append( ' if ( a & 1 ) == 0 : ' ) + PySwitch.append( ' sleep(1) ' ) + PySwitch.append( ' return a & 1,1-(a&1),a ' ) + Switch,EndSwitch = GraphLoopSwitchGateDefault.SNode( 'Switch' , PySwitch ) + EndSwitch.SetName( 'EndSwitch' ) + EndSwitch.SetAuthor( '' ) + EndSwitch.SetComment( 'Compute Node' ) + EndSwitch.Coords( 587 , 103 ) + PyEndSwitch = [] + PyEndSwitch.append( 'def EndSwitch(a,Even) : ' ) + PyEndSwitch.append( ' sleep(1) ' ) + PyEndSwitch.append( ' return a ' ) + EndSwitch.SetPyFunction( 'EndSwitch' , PyEndSwitch ) + IEndSwitcha = EndSwitch.InPort( 'a' , 'long' ) + IEndSwitchEven = EndSwitch.InPort( 'Even' , 'long' ) + IEndSwitchDefault = EndSwitch.GetInPort( 'Default' ) + OEndSwitcha = EndSwitch.OutPort( 'a' , 'long' ) + OEndSwitchGate = EndSwitch.GetOutPort( 'Gate' ) + Switch.SetName( 'Switch' ) + Switch.SetAuthor( '' ) + Switch.SetComment( 'Compute Node' ) + Switch.Coords( 194 , 109 ) + ISwitcha = Switch.InPort( 'a' , 'long' ) + ISwitchGate = Switch.GetInPort( 'Gate' ) + OSwitchOdd = Switch.OutPort( 'Odd' , 'long' ) + OSwitchEven = Switch.OutPort( 'Even' , 'int' ) + OSwitcha = Switch.OutPort( 'a' , 'int' ) + OSwitchDefault = Switch.GetOutPort( 'Default' ) + + # Creation of Links + LIsOddaEndSwitcha = GraphLoopSwitchGateDefault.Link( OIsOdda , IEndSwitcha ) + + LIsOddGateEndSwitchDefault = GraphLoopSwitchGateDefault.Link( OIsOddGate , IEndSwitchDefault ) + + LInitLoopIndexSwitcha = GraphLoopSwitchGateDefault.Link( OInitLoopIndex , ISwitcha ) + + LInitLoopMinEndOfInitLoopMin = GraphLoopSwitchGateDefault.Link( OInitLoopMin , IEndOfInitLoopMin ) + + LInitLoopMaxEndOfInitLoopMax = GraphLoopSwitchGateDefault.Link( OInitLoopMax , IEndOfInitLoopMax ) + + LSwitchOddIsOddGate = GraphLoopSwitchGateDefault.Link( OSwitchOdd , IIsOddGate ) + + LSwitchEvenValEvenEven = GraphLoopSwitchGateDefault.Link( OSwitchEven , IValEvenEven ) + + LSwitchaIsOdda = GraphLoopSwitchGateDefault.Link( OSwitcha , IIsOdda ) + + LSwitchDefaultEndSwitchDefault = GraphLoopSwitchGateDefault.Link( OSwitchDefault , IEndSwitchDefault ) + + LEndSwitchaEndOfInitLoopIndex = GraphLoopSwitchGateDefault.Link( OEndSwitcha , IEndOfInitLoopIndex ) + + LValEvenEvenEndSwitchEven = GraphLoopSwitchGateDefault.Link( OValEvenEven , IEndSwitchEven ) + + # Input datas + IInitLoopIndex.Input( 0 ) + IInitLoopMin.Input( 5 ) + IInitLoopMax.Input( 23 ) + + # Output Ports of the graph + #OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) + #OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) + #OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) + return GraphLoopSwitchGateDefault + + +GraphLoopSwitchGateDefault = DefGraphLoopSwitchGateDefault() diff --git a/examples/GraphLoopSwitchGateDefault.xml b/examples/GraphLoopSwitchGateDefault.xml new file mode 100644 index 0000000..814b2c9 --- /dev/null +++ b/examples/GraphLoopSwitchGateDefault.xml @@ -0,0 +1,386 @@ + + + + + +? + ? + GraphLoopSwitchGateDefault + 1 + ? + +GraphLoopSwitchGateDefault + + +long + InitLoop__Index + +long + InitLoop__Min + +long + InitLoop__Max + + +long + EndOfInitLoop__Index + +long + EndOfInitLoop__Min + +long + EndOfInitLoop__Max + + + 22/10/2003 - 10:36:39 + 6/7/2005 - 16:30:40 + 1.05 + JR + ? + ? + 0 + 0 + + +? + ? + IsOdd + 3 + ? + +IsOdd + + +long + a + + +long + a + + + +IsOdd + + + + + + 6/7/2005 - 16:27:18 + 6/7/2005 - 16:27:18 + 1.05 + ? + ? + Python function + 397 + 1 + +? + ? + InitLoop + 4 + EndOfInitLoop + +InitLoop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +InitLoop + + + + + +? + + +? + + 6/7/2005 - 16:27:18 + 6/7/2005 - 16:27:18 + 1.05 + ? + ? + Compute Node + 10 + 108 + +? + ? + EndOfInitLoop + 5 + InitLoop + +EndOfInitLoop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +EndOfInitLoop + + + + + + + + 6/7/2005 - 16:27:18 + 6/7/2005 - 16:27:18 + 1.05 + ? + ? + Compute Node + 767 + 102 + +? + ? + Switch + 6 + EndSwitch + +Switch + + +long + a + + +long + Odd + +int + Even + +int + a + + + +Switch + + + + + + 6/7/2005 - 16:27:18 + 6/7/2005 - 16:27:18 + 1.05 + ? + ? + Compute Node + 194 + 109 + +? + ? + EndSwitch + 7 + Switch + +EndSwitch + + +long + a + +long + Even + + +long + a + + + +EndSwitch + + + + 6/7/2005 - 16:27:18 + 6/7/2005 - 16:27:18 + 1.05 + ? + ? + Compute Node + 587 + 103 + +? + ? + ValEven + 3 + ? + +ValEven + + +long + Even + + +long + Even + + + +ValEven + + + + + + 6/7/2005 - 16:27:18 + 6/7/2005 - 16:27:18 + 2.0 + ? + ? + Compute Node + 396 + 222 + + +IsOdd + a + EndSwitch + a + + +IsOdd + Gate + EndSwitch + Default + + +InitLoop + DoLoop + EndOfInitLoop + DoLoop + + +InitLoop + Index + Switch + a + + +InitLoop + Min + EndOfInitLoop + Min + + +InitLoop + Max + EndOfInitLoop + Max + + +EndOfInitLoop + DoLoop + InitLoop + DoLoop + + +Switch + Odd + IsOdd + Gate + + +Switch + Even + ValEven + Even + + +Switch + a + IsOdd + a + + +Switch + Default + EndSwitch + Default + + +EndSwitch + a + EndOfInitLoop + Index + + +ValEven + Even + EndSwitch + Even + + + +GraphLoopSwitchGateDefault + InitLoop__Index + InitLoop + Index + +3 + 0 + + +GraphLoopSwitchGateDefault + InitLoop__Min + InitLoop + Min + +3 + 5 + + +GraphLoopSwitchGateDefault + InitLoop__Max + InitLoop + Max + +3 + 23 + diff --git a/examples/GraphLoopSwitchGatesDefaultNOTValid.py b/examples/GraphLoopSwitchGatesDefaultNOTValid.py new file mode 100644 index 0000000..1a3914e --- /dev/null +++ b/examples/GraphLoopSwitchGatesDefaultNOTValid.py @@ -0,0 +1,167 @@ + +# Generated python file of Graph GraphLoopSwitchGatesDefaultNOTValid + +from SuperV import * + +# Graph creation of GraphLoopSwitchGatesDefaultNOTValid +def DefGraphLoopSwitchGatesDefaultNOTValid() : + GraphLoopSwitchGatesDefaultNOTValid = Graph( 'GraphLoopSwitchGatesDefaultNOTValid' ) + GraphLoopSwitchGatesDefaultNOTValid.SetName( 'GraphLoopSwitchGatesDefaultNOTValid' ) + GraphLoopSwitchGatesDefaultNOTValid.SetAuthor( 'JR' ) + GraphLoopSwitchGatesDefaultNOTValid.SetComment( '' ) + GraphLoopSwitchGatesDefaultNOTValid.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsOdd = [] + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd(a) : ' ) + PyIsOdd.append( ' print a,"IsOdd (GraphLoopSwitch1)" ' ) + PyIsOdd.append( ' sleep( 1 ) ' ) + PyIsOdd.append( ' return a ' ) + IsOdd = GraphLoopSwitchGatesDefaultNOTValid.INode( 'IsOdd' , PyIsOdd ) + IsOdd.SetName( 'IsOdd' ) + IsOdd.SetAuthor( '' ) + IsOdd.SetComment( 'Python function' ) + IsOdd.Coords( 397 , 1 ) + IIsOdda = IsOdd.InPort( 'a' , 'long' ) + IIsOddGate = IsOdd.GetInPort( 'Gate' ) + OIsOdda = IsOdd.OutPort( 'a' , 'long' ) + OIsOddGate = IsOdd.GetOutPort( 'Gate' ) + + PyValEven = [] + PyValEven.append( 'from time import * ' ) + PyValEven.append( 'def ValEven(Even) : ' ) + PyValEven.append( ' sleep(1) ' ) + PyValEven.append( ' return Even ' ) + PyValEven.append( '' ) + ValEven = GraphLoopSwitchGatesDefaultNOTValid.INode( 'ValEven' , PyValEven ) + ValEven.SetName( 'ValEven' ) + ValEven.SetAuthor( '' ) + ValEven.SetComment( 'Compute Node' ) + ValEven.Coords( 396 , 222 ) + IValEvenEven = ValEven.InPort( 'Even' , 'long' ) + IValEvenGate = ValEven.GetInPort( 'Gate' ) + OValEvenEven = ValEven.OutPort( 'Even' , 'long' ) + OValEvenGate = ValEven.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyInitLoop = [] + PyInitLoop.append( 'def InitLoop(Index,Min,Max) : ' ) + PyInitLoop.append( ' Index = Min ' ) + PyInitLoop.append( ' return Index,Min,Max ' ) + PyInitLoop.append( '' ) + PyMoreInitLoop = [] + PyMoreInitLoop.append( '' ) + PyNextInitLoop = [] + PyNextInitLoop.append( '' ) + InitLoop,EndOfInitLoop = GraphLoopSwitchGatesDefaultNOTValid.LNode( 'InitLoop' , PyInitLoop , '' , PyMoreInitLoop , '' , PyNextInitLoop ) + EndOfInitLoop.SetName( 'EndOfInitLoop' ) + EndOfInitLoop.SetAuthor( '' ) + EndOfInitLoop.SetComment( 'Compute Node' ) + EndOfInitLoop.Coords( 767 , 102 ) + PyEndOfInitLoop = [] + PyEndOfInitLoop.append( 'def EndOfInitLoop( DoLoop , Index , Min , Max ) :' ) + PyEndOfInitLoop.append( ' Index = Index + 1 ' ) + PyEndOfInitLoop.append( ' if Index <= Max : ' ) + PyEndOfInitLoop.append( ' DoLoop = 1 ' ) + PyEndOfInitLoop.append( ' else : ' ) + PyEndOfInitLoop.append( ' DoLoop = 0 ' ) + PyEndOfInitLoop.append( ' return DoLoop,Index,Min,Max ' ) + EndOfInitLoop.SetPyFunction( 'EndOfInitLoop' , PyEndOfInitLoop ) + IInitLoopDoLoop = InitLoop.GetInPort( 'DoLoop' ) + IInitLoopIndex = InitLoop.InPort( 'Index' , 'long' ) + IInitLoopMin = InitLoop.InPort( 'Min' , 'long' ) + IInitLoopMax = InitLoop.InPort( 'Max' , 'long' ) + IInitLoopGate = InitLoop.GetInPort( 'Gate' ) + OInitLoopDoLoop = InitLoop.GetOutPort( 'DoLoop' ) + OInitLoopIndex = InitLoop.GetOutPort( 'Index' ) + OInitLoopMin = InitLoop.GetOutPort( 'Min' ) + OInitLoopMax = InitLoop.GetOutPort( 'Max' ) + IEndOfInitLoopDoLoop = EndOfInitLoop.GetInPort( 'DoLoop' ) + IEndOfInitLoopIndex = EndOfInitLoop.GetInPort( 'Index' ) + IEndOfInitLoopMin = EndOfInitLoop.GetInPort( 'Min' ) + IEndOfInitLoopMax = EndOfInitLoop.GetInPort( 'Max' ) + IEndOfInitLoopGate = EndOfInitLoop.GetInPort( 'Gate' ) + OEndOfInitLoopDoLoop = EndOfInitLoop.GetOutPort( 'DoLoop' ) + OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) + OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) + OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) + OEndOfInitLoopGate = EndOfInitLoop.GetOutPort( 'Gate' ) + InitLoop.SetName( 'InitLoop' ) + InitLoop.SetAuthor( '' ) + InitLoop.SetComment( 'Compute Node' ) + InitLoop.Coords( 10 , 108 ) + + # Creation of Switch Nodes + PySwitch = [] + PySwitch.append( 'from time import * ' ) + PySwitch.append( 'def Switch(a) : ' ) + PySwitch.append( ' if ( a & 1 ) == 0 : ' ) + PySwitch.append( ' sleep(1) ' ) + PySwitch.append( ' return a & 1,1-(a&1),a ' ) + Switch,EndSwitch = GraphLoopSwitchGatesDefaultNOTValid.SNode( 'Switch' , PySwitch ) + EndSwitch.SetName( 'EndSwitch' ) + EndSwitch.SetAuthor( '' ) + EndSwitch.SetComment( 'Compute Node' ) + EndSwitch.Coords( 587 , 103 ) + PyEndSwitch = [] + PyEndSwitch.append( 'def EndSwitch(a,Even) : ' ) + PyEndSwitch.append( ' sleep(1) ' ) + PyEndSwitch.append( ' return a ' ) + EndSwitch.SetPyFunction( 'EndSwitch' , PyEndSwitch ) + IEndSwitcha = EndSwitch.InPort( 'a' , 'long' ) + IEndSwitchEven = EndSwitch.InPort( 'Even' , 'long' ) + IEndSwitchDefault = EndSwitch.GetInPort( 'Default' ) + OEndSwitcha = EndSwitch.OutPort( 'a' , 'long' ) + OEndSwitchGate = EndSwitch.GetOutPort( 'Gate' ) + Switch.SetName( 'Switch' ) + Switch.SetAuthor( '' ) + Switch.SetComment( 'Compute Node' ) + Switch.Coords( 194 , 109 ) + ISwitcha = Switch.InPort( 'a' , 'long' ) + ISwitchGate = Switch.GetInPort( 'Gate' ) + OSwitchOdd = Switch.OutPort( 'Odd' , 'long' ) + OSwitchEven = Switch.OutPort( 'Even' , 'int' ) + OSwitcha = Switch.OutPort( 'a' , 'int' ) + OSwitchDefault = Switch.GetOutPort( 'Default' ) + + # Creation of Links + LIsOddaEndSwitcha = GraphLoopSwitchGatesDefaultNOTValid.Link( OIsOdda , IEndSwitcha ) + + LIsOddGateEndSwitchDefault = GraphLoopSwitchGatesDefaultNOTValid.Link( OIsOddGate , IEndSwitchDefault ) + + LInitLoopIndexSwitcha = GraphLoopSwitchGatesDefaultNOTValid.Link( OInitLoopIndex , ISwitcha ) + + LInitLoopMinEndOfInitLoopMin = GraphLoopSwitchGatesDefaultNOTValid.Link( OInitLoopMin , IEndOfInitLoopMin ) + + LInitLoopMaxEndOfInitLoopMax = GraphLoopSwitchGatesDefaultNOTValid.Link( OInitLoopMax , IEndOfInitLoopMax ) + + LSwitchOddIsOddGate = GraphLoopSwitchGatesDefaultNOTValid.Link( OSwitchOdd , IIsOddGate ) + + LSwitchEvenValEvenEven = GraphLoopSwitchGatesDefaultNOTValid.Link( OSwitchEven , IValEvenEven ) + + LSwitchaIsOdda = GraphLoopSwitchGatesDefaultNOTValid.Link( OSwitcha , IIsOdda ) + + LSwitchDefaultEndSwitchDefault = GraphLoopSwitchGatesDefaultNOTValid.Link( OSwitchDefault , IEndSwitchDefault ) + + LEndSwitchaEndOfInitLoopIndex = GraphLoopSwitchGatesDefaultNOTValid.Link( OEndSwitcha , IEndOfInitLoopIndex ) + + LValEvenEvenEndSwitchEven = GraphLoopSwitchGatesDefaultNOTValid.Link( OValEvenEven , IEndSwitchEven ) + + LValEvenGateEndSwitchDefault = GraphLoopSwitchGatesDefaultNOTValid.Link( OValEvenGate , IEndSwitchDefault ) + + # Input datas + IInitLoopIndex.Input( 0 ) + IInitLoopMin.Input( 5 ) + IInitLoopMax.Input( 23 ) + + # Output Ports of the graph + #OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) + #OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) + #OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) + return GraphLoopSwitchGatesDefaultNOTValid + + +GraphLoopSwitchGatesDefaultNOTValid = DefGraphLoopSwitchGatesDefaultNOTValid() diff --git a/examples/GraphLoopSwitchGatesDefaultNOTValid.xml b/examples/GraphLoopSwitchGatesDefaultNOTValid.xml new file mode 100644 index 0000000..40c9d70 --- /dev/null +++ b/examples/GraphLoopSwitchGatesDefaultNOTValid.xml @@ -0,0 +1,392 @@ + + + + + +? + ? + GraphLoopSwitchGatesDefaultNOTValid + 1 + ? + +GraphLoopSwitchGatesDefault_1 + + +long + InitLoop__Index + +long + InitLoop__Min + +long + InitLoop__Max + + +long + EndOfInitLoop__Index + +long + EndOfInitLoop__Min + +long + EndOfInitLoop__Max + + + 22/10/2003 - 10:36:39 + 8/7/2005 - 10:51:30 + 1.05 + JR + ? + ? + 0 + 0 + + +? + ? + IsOdd + 3 + ? + +IsOdd + + +long + a + + +long + a + + + +IsOdd + + + + + + 8/7/2005 - 10:51:30 + 8/7/2005 - 10:51:30 + 1.05 + ? + ? + Python function + 397 + 1 + +? + ? + InitLoop + 4 + EndOfInitLoop + +InitLoop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +InitLoop + + + + + +? + + +? + + 8/7/2005 - 10:51:30 + 8/7/2005 - 10:51:30 + 1.05 + ? + ? + Compute Node + 10 + 108 + +? + ? + EndOfInitLoop + 5 + InitLoop + +EndOfInitLoop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +EndOfInitLoop + + + + + + + + 8/7/2005 - 10:51:30 + 8/7/2005 - 10:51:30 + 1.05 + ? + ? + Compute Node + 767 + 102 + +? + ? + Switch + 6 + EndSwitch + +Switch + + +long + a + + +long + Odd + +int + Even + +int + a + + + +Switch + + + + + + 8/7/2005 - 10:51:30 + 8/7/2005 - 10:51:30 + 1.05 + ? + ? + Compute Node + 194 + 109 + +? + ? + EndSwitch + 7 + Switch + +EndSwitch + + +long + a + +long + Even + + +long + a + + + +EndSwitch + + + + 8/7/2005 - 10:51:30 + 8/7/2005 - 10:51:30 + 1.05 + ? + ? + Compute Node + 587 + 103 + +? + ? + ValEven + 3 + ? + +ValEven + + +long + Even + + +long + Even + + + +ValEven + + + + + + 8/7/2005 - 10:51:30 + 8/7/2005 - 10:51:30 + 2.0 + ? + ? + Compute Node + 396 + 222 + + +IsOdd + a + EndSwitch + a + + +IsOdd + Gate + EndSwitch + Default + + +InitLoop + DoLoop + EndOfInitLoop + DoLoop + + +InitLoop + Index + Switch + a + + +InitLoop + Min + EndOfInitLoop + Min + + +InitLoop + Max + EndOfInitLoop + Max + + +EndOfInitLoop + DoLoop + InitLoop + DoLoop + + +Switch + Odd + IsOdd + Gate + + +Switch + Even + ValEven + Even + + +Switch + a + IsOdd + a + + +Switch + Default + EndSwitch + Default + + +EndSwitch + a + EndOfInitLoop + Index + + +ValEven + Even + EndSwitch + Even + + +ValEven + Gate + EndSwitch + Default + + + +GraphLoopSwitchGatesDefaultNOTValid + InitLoop__Index + InitLoop + Index + +3 + 0 + + +GraphLoopSwitchGatesDefaultNOTValid + InitLoop__Min + InitLoop + Min + +3 + 5 + + +GraphLoopSwitchGatesDefaultNOTValid + InitLoop__Max + InitLoop + Max + +3 + 23 + diff --git a/examples/GraphLoopSwitchOddEven.py b/examples/GraphLoopSwitchOddEven.py new file mode 100644 index 0000000..645890a --- /dev/null +++ b/examples/GraphLoopSwitchOddEven.py @@ -0,0 +1,162 @@ + +# Generated python file of Graph GraphLoopSwitchOddEven + +from SuperV import * + +# Graph creation of GraphLoopSwitchOddEven +def DefGraphLoopSwitchOddEven() : + GraphLoopSwitchOddEven = Graph( 'GraphLoopSwitchOddEven' ) + GraphLoopSwitchOddEven.SetName( 'GraphLoopSwitchOddEven' ) + GraphLoopSwitchOddEven.SetAuthor( 'JR' ) + GraphLoopSwitchOddEven.SetComment( '' ) + GraphLoopSwitchOddEven.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsOdd = [] + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd(a) : ' ) + PyIsOdd.append( ' print a,"IsOdd (GraphLoopSwitch1)" ' ) + PyIsOdd.append( ' sleep( 1 ) ' ) + PyIsOdd.append( ' return a ' ) + IsOdd = GraphLoopSwitchOddEven.INode( 'IsOdd' , PyIsOdd ) + IsOdd.SetName( 'IsOdd' ) + IsOdd.SetAuthor( '' ) + IsOdd.SetComment( 'Python function' ) + IsOdd.Coords( 397 , 1 ) + IIsOdda = IsOdd.InPort( 'a' , 'long' ) + IIsOddGate = IsOdd.GetInPort( 'Gate' ) + OIsOdda = IsOdd.OutPort( 'a' , 'long' ) + OIsOddGate = IsOdd.GetOutPort( 'Gate' ) + + PyIsEven = [] + PyIsEven.append( 'from time import * ' ) + PyIsEven.append( 'def IsEven(a) : ' ) + PyIsEven.append( ' sleep(1) ' ) + PyIsEven.append( ' return a ' ) + PyIsEven.append( ' ' ) + IsEven = GraphLoopSwitchOddEven.INode( 'IsEven' , PyIsEven ) + IsEven.SetName( 'IsEven' ) + IsEven.SetAuthor( '' ) + IsEven.SetComment( 'Compute Node' ) + IsEven.Coords( 400 , 160 ) + IIsEvena = IsEven.InPort( 'a' , 'long' ) + IIsEvenGate = IsEven.GetInPort( 'Gate' ) + OIsEvena = IsEven.OutPort( 'a' , 'long' ) + OIsEvenGate = IsEven.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyInitLoop = [] + PyInitLoop.append( 'def InitLoop(Index,Min,Max) : ' ) + PyInitLoop.append( ' Index = Min ' ) + PyInitLoop.append( ' return Index,Min,Max ' ) + PyInitLoop.append( '' ) + PyMoreInitLoop = [] + PyMoreInitLoop.append( '' ) + PyNextInitLoop = [] + PyNextInitLoop.append( '' ) + InitLoop,EndOfInitLoop = GraphLoopSwitchOddEven.LNode( 'InitLoop' , PyInitLoop , '' , PyMoreInitLoop , '' , PyNextInitLoop ) + EndOfInitLoop.SetName( 'EndOfInitLoop' ) + EndOfInitLoop.SetAuthor( '' ) + EndOfInitLoop.SetComment( 'Compute Node' ) + EndOfInitLoop.Coords( 767 , 102 ) + PyEndOfInitLoop = [] + PyEndOfInitLoop.append( 'def EndOfInitLoop( DoLoop , Index , Min , Max ) :' ) + PyEndOfInitLoop.append( ' Index = Index + 1 ' ) + PyEndOfInitLoop.append( ' if Index <= Max : ' ) + PyEndOfInitLoop.append( ' DoLoop = 1 ' ) + PyEndOfInitLoop.append( ' else : ' ) + PyEndOfInitLoop.append( ' DoLoop = 0 ' ) + PyEndOfInitLoop.append( ' return DoLoop,Index,Min,Max ' ) + EndOfInitLoop.SetPyFunction( 'EndOfInitLoop' , PyEndOfInitLoop ) + IInitLoopDoLoop = InitLoop.GetInPort( 'DoLoop' ) + IInitLoopIndex = InitLoop.InPort( 'Index' , 'long' ) + IInitLoopMin = InitLoop.InPort( 'Min' , 'long' ) + IInitLoopMax = InitLoop.InPort( 'Max' , 'long' ) + IInitLoopGate = InitLoop.GetInPort( 'Gate' ) + OInitLoopDoLoop = InitLoop.GetOutPort( 'DoLoop' ) + OInitLoopIndex = InitLoop.GetOutPort( 'Index' ) + OInitLoopMin = InitLoop.GetOutPort( 'Min' ) + OInitLoopMax = InitLoop.GetOutPort( 'Max' ) + IEndOfInitLoopDoLoop = EndOfInitLoop.GetInPort( 'DoLoop' ) + IEndOfInitLoopIndex = EndOfInitLoop.GetInPort( 'Index' ) + IEndOfInitLoopMin = EndOfInitLoop.GetInPort( 'Min' ) + IEndOfInitLoopMax = EndOfInitLoop.GetInPort( 'Max' ) + IEndOfInitLoopGate = EndOfInitLoop.GetInPort( 'Gate' ) + OEndOfInitLoopDoLoop = EndOfInitLoop.GetOutPort( 'DoLoop' ) + OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) + OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) + OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) + OEndOfInitLoopGate = EndOfInitLoop.GetOutPort( 'Gate' ) + InitLoop.SetName( 'InitLoop' ) + InitLoop.SetAuthor( '' ) + InitLoop.SetComment( 'Compute Node' ) + InitLoop.Coords( 10 , 108 ) + + # Creation of Switch Nodes + PySwitch = [] + PySwitch.append( 'from time import * ' ) + PySwitch.append( 'def Switch(a) : ' ) + PySwitch.append( ' if ( a & 1 ) == 0 : ' ) + PySwitch.append( ' sleep(1) ' ) + PySwitch.append( ' return a & 1,1-(a&1),a ' ) + Switch,EndSwitch = GraphLoopSwitchOddEven.SNode( 'Switch' , PySwitch ) + EndSwitch.SetName( 'EndSwitch' ) + EndSwitch.SetAuthor( '' ) + EndSwitch.SetComment( 'Compute Node' ) + EndSwitch.Coords( 587 , 103 ) + PyEndSwitch = [] + PyEndSwitch.append( 'def EndSwitch(a) : ' ) + PyEndSwitch.append( ' sleep(1) ' ) + PyEndSwitch.append( ' return a ' ) + EndSwitch.SetPyFunction( 'EndSwitch' , PyEndSwitch ) + IEndSwitcha = EndSwitch.InPort( 'a' , 'long' ) + IEndSwitchDefault = EndSwitch.GetInPort( 'Default' ) + OEndSwitcha = EndSwitch.OutPort( 'a' , 'long' ) + OEndSwitchGate = EndSwitch.GetOutPort( 'Gate' ) + Switch.SetName( 'Switch' ) + Switch.SetAuthor( '' ) + Switch.SetComment( 'Compute Node' ) + Switch.Coords( 194 , 109 ) + ISwitcha = Switch.InPort( 'a' , 'long' ) + ISwitchGate = Switch.GetInPort( 'Gate' ) + OSwitchOdd = Switch.OutPort( 'Odd' , 'long' ) + OSwitchEven = Switch.OutPort( 'Even' , 'int' ) + OSwitcha = Switch.OutPort( 'a' , 'int' ) + OSwitchDefault = Switch.GetOutPort( 'Default' ) + + # Creation of Links + LIsOddaEndSwitcha = GraphLoopSwitchOddEven.Link( OIsOdda , IEndSwitcha ) + + LInitLoopIndexSwitcha = GraphLoopSwitchOddEven.Link( OInitLoopIndex , ISwitcha ) + + LInitLoopMinEndOfInitLoopMin = GraphLoopSwitchOddEven.Link( OInitLoopMin , IEndOfInitLoopMin ) + + LInitLoopMaxEndOfInitLoopMax = GraphLoopSwitchOddEven.Link( OInitLoopMax , IEndOfInitLoopMax ) + + LSwitchOddIsOddGate = GraphLoopSwitchOddEven.Link( OSwitchOdd , IIsOddGate ) + + LSwitchEvenIsEvenGate = GraphLoopSwitchOddEven.Link( OSwitchEven , IIsEvenGate ) + + LSwitchaIsOdda = GraphLoopSwitchOddEven.Link( OSwitcha , IIsOdda ) + + LSwitchaIsEvena = GraphLoopSwitchOddEven.Link( OSwitcha , IIsEvena ) + + LEndSwitchaEndOfInitLoopIndex = GraphLoopSwitchOddEven.Link( OEndSwitcha , IEndOfInitLoopIndex ) + + LIsEvenaEndSwitcha = GraphLoopSwitchOddEven.Link( OIsEvena , IEndSwitcha ) + + # Input datas + IInitLoopIndex.Input( 0 ) + IInitLoopMin.Input( 5 ) + IInitLoopMax.Input( 23 ) + + # Output Ports of the graph + #OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) + #OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) + #OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) + return GraphLoopSwitchOddEven + + +GraphLoopSwitchOddEven = DefGraphLoopSwitchOddEven() diff --git a/examples/GraphLoopSwitchOddEven.xml b/examples/GraphLoopSwitchOddEven.xml new file mode 100644 index 0000000..219eeca --- /dev/null +++ b/examples/GraphLoopSwitchOddEven.xml @@ -0,0 +1,377 @@ + + + + + +? + ? + GraphLoopSwitchOddEven + 1 + ? + +GraphLoopSwitchOddEven + + +long + InitLoop__Index + +long + InitLoop__Min + +long + InitLoop__Max + + +long + EndOfInitLoop__Index + +long + EndOfInitLoop__Min + +long + EndOfInitLoop__Max + + + 22/10/2003 - 10:36:39 + 14/2/2005 - 16:43:55 + 1.05 + JR + ? + ? + 0 + 0 + + +? + ? + IsOdd + 3 + ? + +IsOdd + + +long + a + + +long + a + + + +IsOdd + + + + + + 14/2/2005 - 16:43:55 + 14/2/2005 - 16:43:55 + 1.05 + ? + ? + Python function + 397 + 1 + +? + ? + InitLoop + 4 + EndOfInitLoop + +InitLoop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +InitLoop + + + + + +? + + +? + + 14/2/2005 - 16:43:55 + 14/2/2005 - 16:43:55 + 1.05 + ? + ? + Compute Node + 10 + 108 + +? + ? + EndOfInitLoop + 5 + InitLoop + +EndOfInitLoop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +EndOfInitLoop + + + + + + + + 14/2/2005 - 16:43:55 + 14/2/2005 - 16:43:55 + 1.05 + ? + ? + Compute Node + 767 + 102 + +? + ? + Switch + 6 + EndSwitch + +Switch + + +long + a + + +long + Odd + +int + Even + +int + a + + + +Switch + + + + + + 14/2/2005 - 16:43:55 + 14/2/2005 - 16:43:55 + 1.05 + ? + ? + Compute Node + 194 + 109 + +? + ? + EndSwitch + 7 + Switch + +EndSwitch + + +long + a + + +long + a + + + +EndSwitch + + + + 14/2/2005 - 16:43:55 + 14/2/2005 - 16:43:55 + 1.05 + ? + ? + Compute Node + 587 + 103 + +? + ? + IsEven + 3 + ? + +IsEven + + +long + a + + +long + a + + + +IsEven + + + + + + 14/2/2005 - 16:43:55 + 14/2/2005 - 16:43:55 + 2.0 + ? + ? + Compute Node + 400 + 160 + + +IsOdd + a + EndSwitch + a + + +InitLoop + DoLoop + EndOfInitLoop + DoLoop + + +InitLoop + Index + Switch + a + + +InitLoop + Min + EndOfInitLoop + Min + + +InitLoop + Max + EndOfInitLoop + Max + + +EndOfInitLoop + DoLoop + InitLoop + DoLoop + + +Switch + Odd + IsOdd + Gate + + +Switch + Even + IsEven + Gate + + +Switch + a + IsOdd + a + + +Switch + a + IsEven + a + + +EndSwitch + a + EndOfInitLoop + Index + + +IsEven + a + EndSwitch + a + + + +GraphLoopSwitchOddEven + InitLoop__Index + InitLoop + Index + +3 + 0 + + +GraphLoopSwitchOddEven + InitLoop__Min + InitLoop + Min + +3 + 5 + + +GraphLoopSwitchOddEven + InitLoop__Max + InitLoop + Max + +3 + 23 + diff --git a/examples/GraphLoopSwitchOfSwitch.py b/examples/GraphLoopSwitchOfSwitch.py index 4e9975b..8ecc256 100644 --- a/examples/GraphLoopSwitchOfSwitch.py +++ b/examples/GraphLoopSwitchOfSwitch.py @@ -239,7 +239,7 @@ def DefGraphLoopSwitchOfSwitch() : # Input datas ILoopSwitchIndex.Input( 0 ) ILoopSwitchMin.Input( -5 ) - ILoopSwitchMax.Input( 65 ) + ILoopSwitchMax.Input( 17 ) # Output Ports of the graph #OEndOfLoopSwitchIndex = EndOfLoopSwitch.GetOutPort( 'Index' ) diff --git a/examples/GraphLoopSwitchOfSwitch.xml b/examples/GraphLoopSwitchOfSwitch.xml index 69a2420..4de95bb 100644 --- a/examples/GraphLoopSwitchOfSwitch.xml +++ b/examples/GraphLoopSwitchOfSwitch.xml @@ -33,7 +33,7 @@ 1/10/2003 - 17:23:54 - 20/1/2005 - 17:13:50 + 8/7/2005 - 10:53:29 1.05 JR ? @@ -89,8 +89,8 @@ - 20/1/2005 - 17:13:50 - 20/1/2005 - 17:13:50 + 8/7/2005 - 10:53:29 + 8/7/2005 - 10:53:29 1.05 ? ? @@ -130,8 +130,8 @@ ? - 20/1/2005 - 17:13:50 - 20/1/2005 - 17:13:50 + 8/7/2005 - 10:53:29 + 8/7/2005 - 10:53:29 1.05 ? ? @@ -163,8 +163,8 @@ - 20/1/2005 - 17:13:50 - 20/1/2005 - 17:13:50 + 8/7/2005 - 10:53:29 + 8/7/2005 - 10:53:29 2.0 ? ? @@ -203,8 +203,8 @@ - 20/1/2005 - 17:13:50 - 20/1/2005 - 17:13:50 + 8/7/2005 - 10:53:29 + 8/7/2005 - 10:53:29 2.0 ? ? @@ -232,8 +232,8 @@ EndSwitch_1 - 20/1/2005 - 17:13:50 - 20/1/2005 - 17:13:50 + 8/7/2005 - 10:53:29 + 8/7/2005 - 10:53:29 2.0 ? ? @@ -282,8 +282,8 @@ - 20/1/2005 - 17:13:50 - 20/1/2005 - 17:13:50 + 8/7/2005 - 10:53:29 + 8/7/2005 - 10:53:29 2.0 ? ? @@ -311,8 +311,8 @@ EndSwitch - 20/1/2005 - 17:13:50 - 20/1/2005 - 17:13:50 + 8/7/2005 - 10:53:29 + 8/7/2005 - 10:53:29 2.0 ? ? @@ -343,8 +343,8 @@ - 20/1/2005 - 17:13:50 - 20/1/2005 - 17:13:50 + 8/7/2005 - 10:53:29 + 8/7/2005 - 10:53:29 2.0 ? ? @@ -375,8 +375,8 @@ - 20/1/2005 - 17:13:50 - 20/1/2005 - 17:13:50 + 8/7/2005 - 10:53:29 + 8/7/2005 - 10:53:29 2.0 ? ? @@ -407,8 +407,8 @@ - 20/1/2005 - 17:13:50 - 20/1/2005 - 17:13:50 + 8/7/2005 - 10:53:29 + 8/7/2005 - 10:53:29 2.0 ? ? @@ -592,5 +592,5 @@ Max 3 - 65 + 17 diff --git a/examples/GraphLoopSwitchOfSwitch1.py b/examples/GraphLoopSwitchOfSwitch1.py new file mode 100644 index 0000000..cd2c734 --- /dev/null +++ b/examples/GraphLoopSwitchOfSwitch1.py @@ -0,0 +1,249 @@ + +# Generated python file of Graph GraphLoopSwitchOfSwitch1 + +from SuperV import * + +# Graph creation of GraphLoopSwitchOfSwitch1 +def DefGraphLoopSwitchOfSwitch1() : + GraphLoopSwitchOfSwitch1 = Graph( 'GraphLoopSwitchOfSwitch1' ) + GraphLoopSwitchOfSwitch1.SetName( 'GraphLoopSwitchOfSwitch1' ) + GraphLoopSwitchOfSwitch1.SetAuthor( 'JR' ) + GraphLoopSwitchOfSwitch1.SetComment( 'DefaultPorts of SwitchOdd and EndSwitchOdd are not connected but that link was not used' ) + GraphLoopSwitchOfSwitch1.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsEven = [] + PyIsEven.append( 'from time import * ' ) + PyIsEven.append( 'def IsEven(a) : ' ) + PyIsEven.append( ' print a,"IsEven (GraphSwitch)" ' ) + PyIsEven.append( ' sleep( 1 ) ' ) + PyIsEven.append( ' return a ' ) + IsEven = GraphLoopSwitchOfSwitch1.INode( 'IsEven' , PyIsEven ) + IsEven.SetName( 'IsEven' ) + IsEven.SetAuthor( '' ) + IsEven.SetComment( 'Compute Node' ) + IsEven.Coords( 437 , 520 ) + IIsEvena = IsEven.InPort( 'a' , 'long' ) + IIsEvenGate = IsEven.GetInPort( 'Gate' ) + OIsEvena = IsEven.OutPort( 'a' , 'long' ) + OIsEvenGate = IsEven.GetOutPort( 'Gate' ) + + PyPseudoPOne = [] + PyPseudoPOne.append( 'from time import * ' ) + PyPseudoPOne.append( 'def PseudoPOne(POne) : ' ) + PyPseudoPOne.append( ' sleep(1) ' ) + PyPseudoPOne.append( ' return 6*POne+1 ' ) + PseudoPOne = GraphLoopSwitchOfSwitch1.INode( 'PseudoPOne' , PyPseudoPOne ) + PseudoPOne.SetName( 'PseudoPOne' ) + PseudoPOne.SetAuthor( '' ) + PseudoPOne.SetComment( 'Compute Node' ) + PseudoPOne.Coords( 612 , 5 ) + IPseudoPOnePOne = PseudoPOne.InPort( 'POne' , 'long' ) + IPseudoPOneGate = PseudoPOne.GetInPort( 'Gate' ) + OPseudoPOnea = PseudoPOne.OutPort( 'a' , 'long' ) + OPseudoPOneGate = PseudoPOne.GetOutPort( 'Gate' ) + + PyPseudoPThree = [] + PyPseudoPThree.append( 'from time import * ' ) + PyPseudoPThree.append( 'def PseudoPThree_1(PThree) : ' ) + PyPseudoPThree.append( ' sleep(1) ' ) + PyPseudoPThree.append( ' return 6*PThree+3 ' ) + PseudoPThree = GraphLoopSwitchOfSwitch1.INode( 'PseudoPThree_1' , PyPseudoPThree ) + PseudoPThree.SetName( 'PseudoPThree' ) + PseudoPThree.SetAuthor( '' ) + PseudoPThree.SetComment( 'Compute Node' ) + PseudoPThree.Coords( 620 , 149 ) + IPseudoPThreePThree = PseudoPThree.InPort( 'PThree' , 'long' ) + IPseudoPThreeGate = PseudoPThree.GetInPort( 'Gate' ) + OPseudoPThreea = PseudoPThree.OutPort( 'a' , 'long' ) + OPseudoPThreeGate = PseudoPThree.GetOutPort( 'Gate' ) + + PyPseudoPFive = [] + PyPseudoPFive.append( 'from time import * ' ) + PyPseudoPFive.append( 'def PseudoPFive(PFive) : ' ) + PyPseudoPFive.append( ' sleep(1) ' ) + PyPseudoPFive.append( ' return 6*PFive+5 ' ) + PseudoPFive = GraphLoopSwitchOfSwitch1.INode( 'PseudoPFive' , PyPseudoPFive ) + PseudoPFive.SetName( 'PseudoPFive' ) + PseudoPFive.SetAuthor( '' ) + PseudoPFive.SetComment( 'Compute Node' ) + PseudoPFive.Coords( 625 , 343 ) + IPseudoPFivePFive = PseudoPFive.InPort( 'PFive' , 'long' ) + IPseudoPFiveGate = PseudoPFive.GetInPort( 'Gate' ) + OPseudoPFivea = PseudoPFive.OutPort( 'a' , 'long' ) + OPseudoPFiveGate = PseudoPFive.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyLoopSwitch = [] + PyLoopSwitch.append( 'def InitLoop(Index,Min,Max) : ' ) + PyLoopSwitch.append( ' Index = Max ' ) + PyLoopSwitch.append( ' return Index,Min,Max ' ) + PyMoreLoopSwitch = [] + PyMoreLoopSwitch.append( 'def MoreLoop(Index,Min,Max) : ' ) + PyMoreLoopSwitch.append( ' if Index >= Min : ' ) + PyMoreLoopSwitch.append( ' DoLoop = 1 ' ) + PyMoreLoopSwitch.append( ' else : ' ) + PyMoreLoopSwitch.append( ' DoLoop = 0 ' ) + PyMoreLoopSwitch.append( ' return DoLoop,Index,Min,Max ' ) + PyNextLoopSwitch = [] + PyNextLoopSwitch.append( 'def NextLoop(Index,Min,Max) : ' ) + PyNextLoopSwitch.append( ' Index = Index - 1 ' ) + PyNextLoopSwitch.append( ' return Index,Min,Max ' ) + LoopSwitch,EndOfLoopSwitch = GraphLoopSwitchOfSwitch1.LNode( 'InitLoop' , PyLoopSwitch , 'MoreLoop' , PyMoreLoopSwitch , 'NextLoop' , PyNextLoopSwitch ) + EndOfLoopSwitch.SetName( 'EndOfLoopSwitch' ) + EndOfLoopSwitch.SetAuthor( '' ) + EndOfLoopSwitch.SetComment( 'Compute Node' ) + EndOfLoopSwitch.Coords( 1268 , 210 ) + PyEndOfLoopSwitch = [] + EndOfLoopSwitch.SetPyFunction( '' , PyEndOfLoopSwitch ) + ILoopSwitchDoLoop = LoopSwitch.GetInPort( 'DoLoop' ) + ILoopSwitchIndex = LoopSwitch.InPort( 'Index' , 'long' ) + ILoopSwitchMin = LoopSwitch.InPort( 'Min' , 'long' ) + ILoopSwitchMax = LoopSwitch.InPort( 'Max' , 'long' ) + ILoopSwitchGate = LoopSwitch.GetInPort( 'Gate' ) + OLoopSwitchDoLoop = LoopSwitch.GetOutPort( 'DoLoop' ) + OLoopSwitchIndex = LoopSwitch.GetOutPort( 'Index' ) + OLoopSwitchMin = LoopSwitch.GetOutPort( 'Min' ) + OLoopSwitchMax = LoopSwitch.GetOutPort( 'Max' ) + IEndOfLoopSwitchDoLoop = EndOfLoopSwitch.GetInPort( 'DoLoop' ) + IEndOfLoopSwitchIndex = EndOfLoopSwitch.GetInPort( 'Index' ) + IEndOfLoopSwitchMin = EndOfLoopSwitch.GetInPort( 'Min' ) + IEndOfLoopSwitchMax = EndOfLoopSwitch.GetInPort( 'Max' ) + IEndOfLoopSwitchGate = EndOfLoopSwitch.GetInPort( 'Gate' ) + OEndOfLoopSwitchDoLoop = EndOfLoopSwitch.GetOutPort( 'DoLoop' ) + OEndOfLoopSwitchIndex = EndOfLoopSwitch.GetOutPort( 'Index' ) + OEndOfLoopSwitchMin = EndOfLoopSwitch.GetOutPort( 'Min' ) + OEndOfLoopSwitchMax = EndOfLoopSwitch.GetOutPort( 'Max' ) + OEndOfLoopSwitchGate = EndOfLoopSwitch.GetOutPort( 'Gate' ) + LoopSwitch.SetName( 'LoopSwitch' ) + LoopSwitch.SetAuthor( '' ) + LoopSwitch.SetComment( 'Compute Node' ) + LoopSwitch.Coords( 6 , 233 ) + + # Creation of Switch Nodes + PySwitch = [] + PySwitch.append( 'from time import * ' ) + PySwitch.append( 'def Switch(a) : ' ) + PySwitch.append( ' sleep(1) ' ) + PySwitch.append( ' if a <= 0 : ' ) + PySwitch.append( ' return 0,a,0 ' ) + PySwitch.append( ' return a & 1,a,1-(a&1) ' ) + Switch,EndOfSwitch = GraphLoopSwitchOfSwitch1.SNode( 'Switch' , PySwitch ) + EndOfSwitch.SetName( 'EndOfSwitch' ) + EndOfSwitch.SetAuthor( '' ) + EndOfSwitch.SetComment( 'Compute Node' ) + EndOfSwitch.Coords( 1075 , 210 ) + PyEndOfSwitch = [] + EndOfSwitch.SetPyFunction( 'EndSwitch_1' , PyEndOfSwitch ) + IEndOfSwitcha = EndOfSwitch.InPort( 'a' , 'long' ) + IEndOfSwitchDefault = EndOfSwitch.GetInPort( 'Default' ) + OEndOfSwitcha = EndOfSwitch.OutPort( 'a' , 'long' ) + OEndOfSwitchGate = EndOfSwitch.GetOutPort( 'Gate' ) + Switch.SetName( 'Switch' ) + Switch.SetAuthor( '' ) + Switch.SetComment( 'Compute Node' ) + Switch.Coords( 201 , 233 ) + ISwitcha = Switch.InPort( 'a' , 'long' ) + ISwitchGate = Switch.GetInPort( 'Gate' ) + OSwitchOdd = Switch.OutPort( 'Odd' , 'long' ) + OSwitcha = Switch.OutPort( 'a' , 'int' ) + OSwitchEven = Switch.OutPort( 'Even' , 'boolean' ) + OSwitchDefault = Switch.GetOutPort( 'Default' ) + + PySwitchOdd = [] + PySwitchOdd.append( 'def SwitchOdd(a) : ' ) + PySwitchOdd.append( ' n = a/6 ' ) + PySwitchOdd.append( ' r = a%6 ' ) + PySwitchOdd.append( ' POne = 0 ' ) + PySwitchOdd.append( ' PThree = 0 ' ) + PySwitchOdd.append( ' PFive = 0 ' ) + PySwitchOdd.append( ' if r == 1 : ' ) + PySwitchOdd.append( ' POne = 1 ' ) + PySwitchOdd.append( ' if r == 3 : ' ) + PySwitchOdd.append( ' PThree = 1 ' ) + PySwitchOdd.append( ' if r == 5 : ' ) + PySwitchOdd.append( ' PFive = 1 ' ) + PySwitchOdd.append( ' return POne,PThree,PFive,n ' ) + SwitchOdd,EndOfSwitchOdd = GraphLoopSwitchOfSwitch1.SNode( 'SwitchOdd' , PySwitchOdd ) + EndOfSwitchOdd.SetName( 'EndOfSwitchOdd' ) + EndOfSwitchOdd.SetAuthor( '' ) + EndOfSwitchOdd.SetComment( 'Compute Node' ) + EndOfSwitchOdd.Coords( 851 , 210 ) + PyEndOfSwitchOdd = [] + EndOfSwitchOdd.SetPyFunction( 'EndSwitch' , PyEndOfSwitchOdd ) + IEndOfSwitchOddn = EndOfSwitchOdd.InPort( 'n' , 'long' ) + IEndOfSwitchOddDefault = EndOfSwitchOdd.GetInPort( 'Default' ) + OEndOfSwitchOddn = EndOfSwitchOdd.OutPort( 'n' , 'long' ) + OEndOfSwitchOddGate = EndOfSwitchOdd.GetOutPort( 'Gate' ) + SwitchOdd.SetName( 'SwitchOdd' ) + SwitchOdd.SetAuthor( '' ) + SwitchOdd.SetComment( 'Compute Node' ) + SwitchOdd.Coords( 412 , 169 ) + ISwitchOdda = SwitchOdd.InPort( 'a' , 'long' ) + ISwitchOddGate = SwitchOdd.GetInPort( 'Gate' ) + OSwitchOddPOne = SwitchOdd.OutPort( 'POne' , 'boolean' ) + OSwitchOddPThree = SwitchOdd.OutPort( 'PThree' , 'boolean' ) + OSwitchOddPFive = SwitchOdd.OutPort( 'PFive' , 'boolean' ) + OSwitchOddn = SwitchOdd.OutPort( 'n' , 'long' ) + OSwitchOddDefault = SwitchOdd.GetOutPort( 'Default' ) + + # Creation of Links + LLoopSwitchIndexSwitcha = GraphLoopSwitchOfSwitch1.Link( OLoopSwitchIndex , ISwitcha ) + + LLoopSwitchMinEndOfLoopSwitchMin = GraphLoopSwitchOfSwitch1.Link( OLoopSwitchMin , IEndOfLoopSwitchMin ) + + LLoopSwitchMaxEndOfLoopSwitchMax = GraphLoopSwitchOfSwitch1.Link( OLoopSwitchMax , IEndOfLoopSwitchMax ) + + LIsEvenaEndOfSwitcha = GraphLoopSwitchOfSwitch1.Link( OIsEvena , IEndOfSwitcha ) + LIsEvenaEndOfSwitcha.AddCoord( 1 , 719 , 591 ) + + LSwitchOddSwitchOddGate = GraphLoopSwitchOfSwitch1.Link( OSwitchOdd , ISwitchOddGate ) + + LSwitchaIsEvena = GraphLoopSwitchOfSwitch1.Link( OSwitcha , IIsEvena ) + + LSwitchaSwitchOdda = GraphLoopSwitchOfSwitch1.Link( OSwitcha , ISwitchOdda ) + + LSwitchEvenIsEvenGate = GraphLoopSwitchOfSwitch1.Link( OSwitchEven , IIsEvenGate ) + + LSwitchDefaultEndOfSwitchDefault = GraphLoopSwitchOfSwitch1.Link( OSwitchDefault , IEndOfSwitchDefault ) + LSwitchDefaultEndOfSwitchDefault.AddCoord( 1 , 1057 , 267 ) + LSwitchDefaultEndOfSwitchDefault.AddCoord( 2 , 1079 , 669 ) + LSwitchDefaultEndOfSwitchDefault.AddCoord( 3 , 383 , 666 ) + + LEndOfSwitchaEndOfLoopSwitchIndex = GraphLoopSwitchOfSwitch1.Link( OEndOfSwitcha , IEndOfLoopSwitchIndex ) + + LSwitchOddPOnePseudoPOneGate = GraphLoopSwitchOfSwitch1.Link( OSwitchOddPOne , IPseudoPOneGate ) + + LSwitchOddPThreePseudoPThreeGate = GraphLoopSwitchOfSwitch1.Link( OSwitchOddPThree , IPseudoPThreeGate ) + + LSwitchOddPFivePseudoPFiveGate = GraphLoopSwitchOfSwitch1.Link( OSwitchOddPFive , IPseudoPFiveGate ) + + LSwitchOddnPseudoPOnePOne = GraphLoopSwitchOfSwitch1.Link( OSwitchOddn , IPseudoPOnePOne ) + + LSwitchOddnPseudoPThreePThree = GraphLoopSwitchOfSwitch1.Link( OSwitchOddn , IPseudoPThreePThree ) + + LSwitchOddnPseudoPFivePFive = GraphLoopSwitchOfSwitch1.Link( OSwitchOddn , IPseudoPFivePFive ) + + LEndOfSwitchOddnEndOfSwitcha = GraphLoopSwitchOfSwitch1.Link( OEndOfSwitchOddn , IEndOfSwitcha ) + + LPseudoPOneaEndOfSwitchOddn = GraphLoopSwitchOfSwitch1.Link( OPseudoPOnea , IEndOfSwitchOddn ) + + LPseudoPThreeaEndOfSwitchOddn = GraphLoopSwitchOfSwitch1.Link( OPseudoPThreea , IEndOfSwitchOddn ) + + LPseudoPFiveaEndOfSwitchOddn = GraphLoopSwitchOfSwitch1.Link( OPseudoPFivea , IEndOfSwitchOddn ) + + # Input datas + ILoopSwitchIndex.Input( 0 ) + ILoopSwitchMin.Input( -5 ) + ILoopSwitchMax.Input( 17 ) + + # Output Ports of the graph + #OEndOfLoopSwitchIndex = EndOfLoopSwitch.GetOutPort( 'Index' ) + #OEndOfLoopSwitchMin = EndOfLoopSwitch.GetOutPort( 'Min' ) + #OEndOfLoopSwitchMax = EndOfLoopSwitch.GetOutPort( 'Max' ) + return GraphLoopSwitchOfSwitch1 + + +GraphLoopSwitchOfSwitch1 = DefGraphLoopSwitchOfSwitch1() diff --git a/examples/GraphLoopSwitchOfSwitch1.xml b/examples/GraphLoopSwitchOfSwitch1.xml new file mode 100644 index 0000000..15f704e --- /dev/null +++ b/examples/GraphLoopSwitchOfSwitch1.xml @@ -0,0 +1,590 @@ + + + + + +? + ? + GraphLoopSwitchOfSwitch1 + 1 + ? + +GraphLoopSwitchOfSwitch1 + + +long + LoopSwitch__Index + +long + LoopSwitch__Min + +long + LoopSwitch__Max + + +long + EndOfLoopSwitch__Index + +long + EndOfLoopSwitch__Min + +long + EndOfLoopSwitch__Max + + + 1/10/2003 - 17:23:54 + 8/7/2005 - 10:56:45 + 1.05 + JR + ? + DefaultPorts of SwitchOdd and EndSwitchOdd are not connected but that link was not used + 0 + 0 + + +? + ? + LoopSwitch + 4 + EndOfLoopSwitch + +LoopSwitch + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +InitLoop + + + + +MoreLoop + + = Min : ]]> + + + + + +NextLoop + + + + 8/7/2005 - 10:56:45 + 8/7/2005 - 10:56:45 + 1.05 + ? + ? + Compute Node + 6 + 233 + +? + ? + EndOfLoopSwitch + 5 + LoopSwitch + +EndOfLoopSwitch + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +? + + 8/7/2005 - 10:56:45 + 8/7/2005 - 10:56:45 + 1.05 + ? + ? + Compute Node + 1268 + 210 + +? + ? + IsEven + 3 + ? + +IsEven + + +long + a + + +long + a + + + +IsEven + + + + + + 8/7/2005 - 10:56:45 + 8/7/2005 - 10:56:45 + 2.0 + ? + ? + Compute Node + 437 + 520 + +? + ? + Switch + 6 + EndOfSwitch + +Switch + + +long + a + + +long + Odd + +int + a + +boolean + Even + + + +Switch + + + + + + + 8/7/2005 - 10:56:45 + 8/7/2005 - 10:56:45 + 2.0 + ? + ? + Compute Node + 201 + 233 + +? + ? + EndOfSwitch + 7 + Switch + +EndOfSwitch + + +long + a + + +long + a + + + +EndSwitch_1 + + 8/7/2005 - 10:56:45 + 8/7/2005 - 10:56:45 + 2.0 + ? + ? + Compute Node + 1075 + 210 + +? + ? + SwitchOdd + 6 + EndOfSwitchOdd + +SwitchOdd + + +long + a + + +boolean + POne + +boolean + PThree + +boolean + PFive + +long + n + + + +SwitchOdd + + + + + + + + + + + + + + 8/7/2005 - 10:56:45 + 8/7/2005 - 10:56:45 + 2.0 + ? + ? + Compute Node + 412 + 169 + +? + ? + EndOfSwitchOdd + 7 + SwitchOdd + +EndOfSwitchOdd + + +long + n + + +long + n + + + +EndSwitch + + 8/7/2005 - 10:56:45 + 8/7/2005 - 10:56:45 + 2.0 + ? + ? + Compute Node + 851 + 210 + +? + ? + PseudoPOne + 3 + ? + +PseudoPOne + + +long + POne + + +long + a + + + +PseudoPOne + + + + + 8/7/2005 - 10:56:45 + 8/7/2005 - 10:56:45 + 2.0 + ? + ? + Compute Node + 612 + 5 + +? + ? + PseudoPThree + 3 + ? + +PseudoPThree + + +long + PThree + + +long + a + + + +PseudoPThree_1 + + + + + 8/7/2005 - 10:56:45 + 8/7/2005 - 10:56:45 + 2.0 + ? + ? + Compute Node + 620 + 149 + +? + ? + PseudoPFive + 3 + ? + +PseudoPFive + + +long + PFive + + +long + a + + + +PseudoPFive + + + + + 8/7/2005 - 10:56:45 + 8/7/2005 - 10:56:45 + 2.0 + ? + ? + Compute Node + 625 + 343 + + +LoopSwitch + DoLoop + EndOfLoopSwitch + DoLoop + + +LoopSwitch + Index + Switch + a + + +LoopSwitch + Min + EndOfLoopSwitch + Min + + +LoopSwitch + Max + EndOfLoopSwitch + Max + + +EndOfLoopSwitch + DoLoop + LoopSwitch + DoLoop + + +IsEven + a + EndOfSwitch + a + + +719 + 591 + +Switch + Odd + SwitchOdd + Gate + + +Switch + a + IsEven + a + + +Switch + a + SwitchOdd + a + + +Switch + Even + IsEven + Gate + + +Switch + Default + EndOfSwitch + Default + + +1057 + 267 + +1079 + 669 + +383 + 666 + +EndOfSwitch + a + EndOfLoopSwitch + Index + + +SwitchOdd + POne + PseudoPOne + Gate + + +SwitchOdd + PThree + PseudoPThree + Gate + + +SwitchOdd + PFive + PseudoPFive + Gate + + +SwitchOdd + n + PseudoPOne + POne + + +SwitchOdd + n + PseudoPThree + PThree + + +SwitchOdd + n + PseudoPFive + PFive + + +EndOfSwitchOdd + n + EndOfSwitch + a + + +PseudoPOne + a + EndOfSwitchOdd + n + + +PseudoPThree + a + EndOfSwitchOdd + n + + +PseudoPFive + a + EndOfSwitchOdd + n + + + +GraphLoopSwitchOfSwitch1 + LoopSwitch__Index + LoopSwitch + Index + +3 + 0 + + +GraphLoopSwitchOfSwitch1 + LoopSwitch__Min + LoopSwitch + Min + +3 + -5 + + +GraphLoopSwitchOfSwitch1 + LoopSwitch__Max + LoopSwitch + Max + +3 + 17 + diff --git a/examples/GraphLoopSwitchOfSwitchAborted.py b/examples/GraphLoopSwitchOfSwitchAborted.py new file mode 100644 index 0000000..7f17568 --- /dev/null +++ b/examples/GraphLoopSwitchOfSwitchAborted.py @@ -0,0 +1,244 @@ + +# Generated python file of Graph GraphLoopSwitchOfSwitchAborted + +from SuperV import * + +# Graph creation of GraphLoopSwitchOfSwitchAborted +def DefGraphLoopSwitchOfSwitchAborted() : + GraphLoopSwitchOfSwitchAborted = Graph( 'GraphLoopSwitchOfSwitchAborted' ) + GraphLoopSwitchOfSwitchAborted.SetName( 'GraphLoopSwitchOfSwitchAborted' ) + GraphLoopSwitchOfSwitchAborted.SetAuthor( 'JR' ) + GraphLoopSwitchOfSwitchAborted.SetComment( 'DefaultPorts of SwitchOdd and EndSwitchOdd are not connected but that link was not used. DefaultPorts of Switch and EndSwitch are not linked ==> ABORT' ) + GraphLoopSwitchOfSwitchAborted.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsEven = [] + PyIsEven.append( 'from time import * ' ) + PyIsEven.append( 'def IsEven(a) : ' ) + PyIsEven.append( ' print a,"IsEven (GraphSwitch)" ' ) + PyIsEven.append( ' sleep( 1 ) ' ) + PyIsEven.append( ' return a ' ) + IsEven = GraphLoopSwitchOfSwitchAborted.INode( 'IsEven' , PyIsEven ) + IsEven.SetName( 'IsEven' ) + IsEven.SetAuthor( '' ) + IsEven.SetComment( 'Compute Node' ) + IsEven.Coords( 437 , 520 ) + IIsEvena = IsEven.InPort( 'a' , 'long' ) + IIsEvenGate = IsEven.GetInPort( 'Gate' ) + OIsEvena = IsEven.OutPort( 'a' , 'long' ) + OIsEvenGate = IsEven.GetOutPort( 'Gate' ) + + PyPseudoPOne = [] + PyPseudoPOne.append( 'from time import * ' ) + PyPseudoPOne.append( 'def PseudoPOne(POne) : ' ) + PyPseudoPOne.append( ' sleep(1) ' ) + PyPseudoPOne.append( ' return 6*POne+1 ' ) + PseudoPOne = GraphLoopSwitchOfSwitchAborted.INode( 'PseudoPOne' , PyPseudoPOne ) + PseudoPOne.SetName( 'PseudoPOne' ) + PseudoPOne.SetAuthor( '' ) + PseudoPOne.SetComment( 'Compute Node' ) + PseudoPOne.Coords( 612 , 5 ) + IPseudoPOnePOne = PseudoPOne.InPort( 'POne' , 'long' ) + IPseudoPOneGate = PseudoPOne.GetInPort( 'Gate' ) + OPseudoPOnea = PseudoPOne.OutPort( 'a' , 'long' ) + OPseudoPOneGate = PseudoPOne.GetOutPort( 'Gate' ) + + PyPseudoPThree = [] + PyPseudoPThree.append( 'from time import * ' ) + PyPseudoPThree.append( 'def PseudoPThree_1(PThree) : ' ) + PyPseudoPThree.append( ' sleep(1) ' ) + PyPseudoPThree.append( ' return 6*PThree+3 ' ) + PseudoPThree = GraphLoopSwitchOfSwitchAborted.INode( 'PseudoPThree_1' , PyPseudoPThree ) + PseudoPThree.SetName( 'PseudoPThree' ) + PseudoPThree.SetAuthor( '' ) + PseudoPThree.SetComment( 'Compute Node' ) + PseudoPThree.Coords( 620 , 149 ) + IPseudoPThreePThree = PseudoPThree.InPort( 'PThree' , 'long' ) + IPseudoPThreeGate = PseudoPThree.GetInPort( 'Gate' ) + OPseudoPThreea = PseudoPThree.OutPort( 'a' , 'long' ) + OPseudoPThreeGate = PseudoPThree.GetOutPort( 'Gate' ) + + PyPseudoPFive = [] + PyPseudoPFive.append( 'from time import * ' ) + PyPseudoPFive.append( 'def PseudoPFive(PFive) : ' ) + PyPseudoPFive.append( ' sleep(1) ' ) + PyPseudoPFive.append( ' return 6*PFive+5 ' ) + PseudoPFive = GraphLoopSwitchOfSwitchAborted.INode( 'PseudoPFive' , PyPseudoPFive ) + PseudoPFive.SetName( 'PseudoPFive' ) + PseudoPFive.SetAuthor( '' ) + PseudoPFive.SetComment( 'Compute Node' ) + PseudoPFive.Coords( 625 , 343 ) + IPseudoPFivePFive = PseudoPFive.InPort( 'PFive' , 'long' ) + IPseudoPFiveGate = PseudoPFive.GetInPort( 'Gate' ) + OPseudoPFivea = PseudoPFive.OutPort( 'a' , 'long' ) + OPseudoPFiveGate = PseudoPFive.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyLoopSwitch = [] + PyLoopSwitch.append( 'def InitLoop(Index,Min,Max) : ' ) + PyLoopSwitch.append( ' Index = Max ' ) + PyLoopSwitch.append( ' return Index,Min,Max ' ) + PyMoreLoopSwitch = [] + PyMoreLoopSwitch.append( 'def MoreLoop(Index,Min,Max) : ' ) + PyMoreLoopSwitch.append( ' if Index >= Min : ' ) + PyMoreLoopSwitch.append( ' DoLoop = 1 ' ) + PyMoreLoopSwitch.append( ' else : ' ) + PyMoreLoopSwitch.append( ' DoLoop = 0 ' ) + PyMoreLoopSwitch.append( ' return DoLoop,Index,Min,Max ' ) + PyNextLoopSwitch = [] + PyNextLoopSwitch.append( 'def NextLoop(Index,Min,Max) : ' ) + PyNextLoopSwitch.append( ' Index = Index - 1 ' ) + PyNextLoopSwitch.append( ' return Index,Min,Max ' ) + LoopSwitch,EndOfLoopSwitch = GraphLoopSwitchOfSwitchAborted.LNode( 'InitLoop' , PyLoopSwitch , 'MoreLoop' , PyMoreLoopSwitch , 'NextLoop' , PyNextLoopSwitch ) + EndOfLoopSwitch.SetName( 'EndOfLoopSwitch' ) + EndOfLoopSwitch.SetAuthor( '' ) + EndOfLoopSwitch.SetComment( 'Compute Node' ) + EndOfLoopSwitch.Coords( 1268 , 210 ) + PyEndOfLoopSwitch = [] + EndOfLoopSwitch.SetPyFunction( '' , PyEndOfLoopSwitch ) + ILoopSwitchDoLoop = LoopSwitch.GetInPort( 'DoLoop' ) + ILoopSwitchIndex = LoopSwitch.InPort( 'Index' , 'long' ) + ILoopSwitchMin = LoopSwitch.InPort( 'Min' , 'long' ) + ILoopSwitchMax = LoopSwitch.InPort( 'Max' , 'long' ) + ILoopSwitchGate = LoopSwitch.GetInPort( 'Gate' ) + OLoopSwitchDoLoop = LoopSwitch.GetOutPort( 'DoLoop' ) + OLoopSwitchIndex = LoopSwitch.GetOutPort( 'Index' ) + OLoopSwitchMin = LoopSwitch.GetOutPort( 'Min' ) + OLoopSwitchMax = LoopSwitch.GetOutPort( 'Max' ) + IEndOfLoopSwitchDoLoop = EndOfLoopSwitch.GetInPort( 'DoLoop' ) + IEndOfLoopSwitchIndex = EndOfLoopSwitch.GetInPort( 'Index' ) + IEndOfLoopSwitchMin = EndOfLoopSwitch.GetInPort( 'Min' ) + IEndOfLoopSwitchMax = EndOfLoopSwitch.GetInPort( 'Max' ) + IEndOfLoopSwitchGate = EndOfLoopSwitch.GetInPort( 'Gate' ) + OEndOfLoopSwitchDoLoop = EndOfLoopSwitch.GetOutPort( 'DoLoop' ) + OEndOfLoopSwitchIndex = EndOfLoopSwitch.GetOutPort( 'Index' ) + OEndOfLoopSwitchMin = EndOfLoopSwitch.GetOutPort( 'Min' ) + OEndOfLoopSwitchMax = EndOfLoopSwitch.GetOutPort( 'Max' ) + OEndOfLoopSwitchGate = EndOfLoopSwitch.GetOutPort( 'Gate' ) + LoopSwitch.SetName( 'LoopSwitch' ) + LoopSwitch.SetAuthor( '' ) + LoopSwitch.SetComment( 'Compute Node' ) + LoopSwitch.Coords( 6 , 233 ) + + # Creation of Switch Nodes + PySwitch = [] + PySwitch.append( 'from time import * ' ) + PySwitch.append( 'def Switch(a) : ' ) + PySwitch.append( ' sleep(1) ' ) + PySwitch.append( ' if a <= 0 : ' ) + PySwitch.append( ' return 0,a,0 ' ) + PySwitch.append( ' return a & 1,a,1-(a&1) ' ) + Switch,EndOfSwitch = GraphLoopSwitchOfSwitchAborted.SNode( 'Switch' , PySwitch ) + EndOfSwitch.SetName( 'EndOfSwitch' ) + EndOfSwitch.SetAuthor( '' ) + EndOfSwitch.SetComment( 'Compute Node' ) + EndOfSwitch.Coords( 1075 , 210 ) + PyEndOfSwitch = [] + EndOfSwitch.SetPyFunction( 'EndSwitch_1' , PyEndOfSwitch ) + IEndOfSwitcha = EndOfSwitch.InPort( 'a' , 'long' ) + IEndOfSwitchDefault = EndOfSwitch.GetInPort( 'Default' ) + OEndOfSwitcha = EndOfSwitch.OutPort( 'a' , 'long' ) + OEndOfSwitchGate = EndOfSwitch.GetOutPort( 'Gate' ) + Switch.SetName( 'Switch' ) + Switch.SetAuthor( '' ) + Switch.SetComment( 'Compute Node' ) + Switch.Coords( 201 , 233 ) + ISwitcha = Switch.InPort( 'a' , 'long' ) + ISwitchGate = Switch.GetInPort( 'Gate' ) + OSwitchOdd = Switch.OutPort( 'Odd' , 'long' ) + OSwitcha = Switch.OutPort( 'a' , 'int' ) + OSwitchEven = Switch.OutPort( 'Even' , 'boolean' ) + OSwitchDefault = Switch.GetOutPort( 'Default' ) + + PySwitchOdd = [] + PySwitchOdd.append( 'def SwitchOdd(a) : ' ) + PySwitchOdd.append( ' n = a/6 ' ) + PySwitchOdd.append( ' r = a%6 ' ) + PySwitchOdd.append( ' POne = 0 ' ) + PySwitchOdd.append( ' PThree = 0 ' ) + PySwitchOdd.append( ' PFive = 0 ' ) + PySwitchOdd.append( ' if r == 1 : ' ) + PySwitchOdd.append( ' POne = 1 ' ) + PySwitchOdd.append( ' if r == 3 : ' ) + PySwitchOdd.append( ' PThree = 1 ' ) + PySwitchOdd.append( ' if r == 5 : ' ) + PySwitchOdd.append( ' PFive = 1 ' ) + PySwitchOdd.append( ' return POne,PThree,PFive,n ' ) + SwitchOdd,EndOfSwitchOdd = GraphLoopSwitchOfSwitchAborted.SNode( 'SwitchOdd' , PySwitchOdd ) + EndOfSwitchOdd.SetName( 'EndOfSwitchOdd' ) + EndOfSwitchOdd.SetAuthor( '' ) + EndOfSwitchOdd.SetComment( 'Compute Node' ) + EndOfSwitchOdd.Coords( 851 , 210 ) + PyEndOfSwitchOdd = [] + EndOfSwitchOdd.SetPyFunction( 'EndSwitch' , PyEndOfSwitchOdd ) + IEndOfSwitchOddn = EndOfSwitchOdd.InPort( 'n' , 'long' ) + IEndOfSwitchOddDefault = EndOfSwitchOdd.GetInPort( 'Default' ) + OEndOfSwitchOddn = EndOfSwitchOdd.OutPort( 'n' , 'long' ) + OEndOfSwitchOddGate = EndOfSwitchOdd.GetOutPort( 'Gate' ) + SwitchOdd.SetName( 'SwitchOdd' ) + SwitchOdd.SetAuthor( '' ) + SwitchOdd.SetComment( 'Compute Node' ) + SwitchOdd.Coords( 412 , 169 ) + ISwitchOdda = SwitchOdd.InPort( 'a' , 'long' ) + ISwitchOddGate = SwitchOdd.GetInPort( 'Gate' ) + OSwitchOddPOne = SwitchOdd.OutPort( 'POne' , 'boolean' ) + OSwitchOddPThree = SwitchOdd.OutPort( 'PThree' , 'boolean' ) + OSwitchOddPFive = SwitchOdd.OutPort( 'PFive' , 'boolean' ) + OSwitchOddn = SwitchOdd.OutPort( 'n' , 'long' ) + OSwitchOddDefault = SwitchOdd.GetOutPort( 'Default' ) + + # Creation of Links + LLoopSwitchIndexSwitcha = GraphLoopSwitchOfSwitchAborted.Link( OLoopSwitchIndex , ISwitcha ) + + LLoopSwitchMinEndOfLoopSwitchMin = GraphLoopSwitchOfSwitchAborted.Link( OLoopSwitchMin , IEndOfLoopSwitchMin ) + + LLoopSwitchMaxEndOfLoopSwitchMax = GraphLoopSwitchOfSwitchAborted.Link( OLoopSwitchMax , IEndOfLoopSwitchMax ) + + LIsEvenaEndOfSwitcha = GraphLoopSwitchOfSwitchAborted.Link( OIsEvena , IEndOfSwitcha ) + LIsEvenaEndOfSwitcha.AddCoord( 1 , 719 , 591 ) + + LSwitchOddSwitchOddGate = GraphLoopSwitchOfSwitchAborted.Link( OSwitchOdd , ISwitchOddGate ) + + LSwitchaIsEvena = GraphLoopSwitchOfSwitchAborted.Link( OSwitcha , IIsEvena ) + + LSwitchaSwitchOdda = GraphLoopSwitchOfSwitchAborted.Link( OSwitcha , ISwitchOdda ) + + LSwitchEvenIsEvenGate = GraphLoopSwitchOfSwitchAborted.Link( OSwitchEven , IIsEvenGate ) + + LEndOfSwitchaEndOfLoopSwitchIndex = GraphLoopSwitchOfSwitchAborted.Link( OEndOfSwitcha , IEndOfLoopSwitchIndex ) + + LSwitchOddPOnePseudoPOneGate = GraphLoopSwitchOfSwitchAborted.Link( OSwitchOddPOne , IPseudoPOneGate ) + + LSwitchOddPThreePseudoPThreeGate = GraphLoopSwitchOfSwitchAborted.Link( OSwitchOddPThree , IPseudoPThreeGate ) + + LSwitchOddPFivePseudoPFiveGate = GraphLoopSwitchOfSwitchAborted.Link( OSwitchOddPFive , IPseudoPFiveGate ) + + LSwitchOddnPseudoPOnePOne = GraphLoopSwitchOfSwitchAborted.Link( OSwitchOddn , IPseudoPOnePOne ) + + LSwitchOddnPseudoPThreePThree = GraphLoopSwitchOfSwitchAborted.Link( OSwitchOddn , IPseudoPThreePThree ) + + LSwitchOddnPseudoPFivePFive = GraphLoopSwitchOfSwitchAborted.Link( OSwitchOddn , IPseudoPFivePFive ) + + LEndOfSwitchOddnEndOfSwitcha = GraphLoopSwitchOfSwitchAborted.Link( OEndOfSwitchOddn , IEndOfSwitcha ) + + LPseudoPOneaEndOfSwitchOddn = GraphLoopSwitchOfSwitchAborted.Link( OPseudoPOnea , IEndOfSwitchOddn ) + + LPseudoPThreeaEndOfSwitchOddn = GraphLoopSwitchOfSwitchAborted.Link( OPseudoPThreea , IEndOfSwitchOddn ) + + LPseudoPFiveaEndOfSwitchOddn = GraphLoopSwitchOfSwitchAborted.Link( OPseudoPFivea , IEndOfSwitchOddn ) + + # Input datas + ILoopSwitchIndex.Input( 0 ) + ILoopSwitchMin.Input( -5 ) + ILoopSwitchMax.Input( 17 ) + + # Output Ports of the graph + #OEndOfLoopSwitchIndex = EndOfLoopSwitch.GetOutPort( 'Index' ) + #OEndOfLoopSwitchMin = EndOfLoopSwitch.GetOutPort( 'Min' ) + #OEndOfLoopSwitchMax = EndOfLoopSwitch.GetOutPort( 'Max' ) + return GraphLoopSwitchOfSwitchAborted + + +GraphLoopSwitchOfSwitchAborted = DefGraphLoopSwitchOfSwitchAborted() diff --git a/examples/GraphLoopSwitchOfSwitchAborted.xml b/examples/GraphLoopSwitchOfSwitchAborted.xml new file mode 100644 index 0000000..8d766b6 --- /dev/null +++ b/examples/GraphLoopSwitchOfSwitchAborted.xml @@ -0,0 +1,575 @@ + + + + + +? + ? + GraphLoopSwitchOfSwitchAborted + 1 + ? + +GraphLoopSwitchOfSwitchAborted + + +long + LoopSwitch__Index + +long + LoopSwitch__Min + +long + LoopSwitch__Max + + +long + EndOfLoopSwitch__Index + +long + EndOfLoopSwitch__Min + +long + EndOfLoopSwitch__Max + + + 1/10/2003 - 17:23:54 + 8/7/2005 - 10:58:36 + 1.05 + JR + ? + DefaultPorts of SwitchOdd and EndSwitchOdd are not connected but that link was not used. DefaultPorts of Switch and EndSwitch are not linked ==> ABORT + 0 + 0 + + +? + ? + LoopSwitch + 4 + EndOfLoopSwitch + +LoopSwitch + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +InitLoop + + + + +MoreLoop + + = Min : ]]> + + + + + +NextLoop + + + + 8/7/2005 - 10:58:36 + 8/7/2005 - 10:58:36 + 1.05 + ? + ? + Compute Node + 6 + 233 + +? + ? + EndOfLoopSwitch + 5 + LoopSwitch + +EndOfLoopSwitch + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +? + + 8/7/2005 - 10:58:36 + 8/7/2005 - 10:58:36 + 1.05 + ? + ? + Compute Node + 1268 + 210 + +? + ? + IsEven + 3 + ? + +IsEven + + +long + a + + +long + a + + + +IsEven + + + + + + 8/7/2005 - 10:58:36 + 8/7/2005 - 10:58:36 + 2.0 + ? + ? + Compute Node + 437 + 520 + +? + ? + Switch + 6 + EndOfSwitch + +Switch + + +long + a + + +long + Odd + +int + a + +boolean + Even + + + +Switch + + + + + + + 8/7/2005 - 10:58:36 + 8/7/2005 - 10:58:36 + 2.0 + ? + ? + Compute Node + 201 + 233 + +? + ? + EndOfSwitch + 7 + Switch + +EndOfSwitch + + +long + a + + +long + a + + + +EndSwitch_1 + + 8/7/2005 - 10:58:36 + 8/7/2005 - 10:58:36 + 2.0 + ? + ? + Compute Node + 1075 + 210 + +? + ? + SwitchOdd + 6 + EndOfSwitchOdd + +SwitchOdd + + +long + a + + +boolean + POne + +boolean + PThree + +boolean + PFive + +long + n + + + +SwitchOdd + + + + + + + + + + + + + + 8/7/2005 - 10:58:36 + 8/7/2005 - 10:58:36 + 2.0 + ? + ? + Compute Node + 412 + 169 + +? + ? + EndOfSwitchOdd + 7 + SwitchOdd + +EndOfSwitchOdd + + +long + n + + +long + n + + + +EndSwitch + + 8/7/2005 - 10:58:36 + 8/7/2005 - 10:58:36 + 2.0 + ? + ? + Compute Node + 851 + 210 + +? + ? + PseudoPOne + 3 + ? + +PseudoPOne + + +long + POne + + +long + a + + + +PseudoPOne + + + + + 8/7/2005 - 10:58:36 + 8/7/2005 - 10:58:36 + 2.0 + ? + ? + Compute Node + 612 + 5 + +? + ? + PseudoPThree + 3 + ? + +PseudoPThree + + +long + PThree + + +long + a + + + +PseudoPThree_1 + + + + + 8/7/2005 - 10:58:36 + 8/7/2005 - 10:58:36 + 2.0 + ? + ? + Compute Node + 620 + 149 + +? + ? + PseudoPFive + 3 + ? + +PseudoPFive + + +long + PFive + + +long + a + + + +PseudoPFive + + + + + 8/7/2005 - 10:58:36 + 8/7/2005 - 10:58:36 + 2.0 + ? + ? + Compute Node + 625 + 343 + + +LoopSwitch + DoLoop + EndOfLoopSwitch + DoLoop + + +LoopSwitch + Index + Switch + a + + +LoopSwitch + Min + EndOfLoopSwitch + Min + + +LoopSwitch + Max + EndOfLoopSwitch + Max + + +EndOfLoopSwitch + DoLoop + LoopSwitch + DoLoop + + +IsEven + a + EndOfSwitch + a + + +719 + 591 + +Switch + Odd + SwitchOdd + Gate + + +Switch + a + IsEven + a + + +Switch + a + SwitchOdd + a + + +Switch + Even + IsEven + Gate + + +EndOfSwitch + a + EndOfLoopSwitch + Index + + +SwitchOdd + POne + PseudoPOne + Gate + + +SwitchOdd + PThree + PseudoPThree + Gate + + +SwitchOdd + PFive + PseudoPFive + Gate + + +SwitchOdd + n + PseudoPOne + POne + + +SwitchOdd + n + PseudoPThree + PThree + + +SwitchOdd + n + PseudoPFive + PFive + + +EndOfSwitchOdd + n + EndOfSwitch + a + + +PseudoPOne + a + EndOfSwitchOdd + n + + +PseudoPThree + a + EndOfSwitchOdd + n + + +PseudoPFive + a + EndOfSwitchOdd + n + + + +GraphLoopSwitchOfSwitchAborted + LoopSwitch__Index + LoopSwitch + Index + +3 + 0 + + +GraphLoopSwitchOfSwitchAborted + LoopSwitch__Min + LoopSwitch + Min + +3 + -5 + + +GraphLoopSwitchOfSwitchAborted + LoopSwitch__Max + LoopSwitch + Max + +3 + 17 + diff --git a/examples/GraphLoopSwitchs.py b/examples/GraphLoopSwitchs.py index 637832a..af267b6 100644 --- a/examples/GraphLoopSwitchs.py +++ b/examples/GraphLoopSwitchs.py @@ -1,26 +1,26 @@ -# Generated python file of Graph GraphLoopSwitchs +# Generated python file of Graph GraphLoopSwitchs_1 from SuperV import * -# Graph creation of GraphLoopSwitchs -def DefGraphLoopSwitchs() : - GraphLoopSwitchs = Graph( 'GraphLoopSwitchs' ) - GraphLoopSwitchs.SetName( 'GraphLoopSwitchs' ) - GraphLoopSwitchs.SetAuthor( 'JR' ) - GraphLoopSwitchs.SetComment( '' ) - GraphLoopSwitchs.Coords( 0 , 0 ) +# Graph creation of GraphLoopSwitchs_1 +def DefGraphLoopSwitchs_1() : + GraphLoopSwitchs_1 = Graph( 'GraphLoopSwitchs_1' ) + GraphLoopSwitchs_1.SetName( 'GraphLoopSwitchs_1' ) + GraphLoopSwitchs_1.SetAuthor( 'JR' ) + GraphLoopSwitchs_1.SetComment( '' ) + GraphLoopSwitchs_1.Coords( 0 , 0 ) # Creation of Factory Nodes # Creation of InLine Nodes PyIsOdd = [] - PyIsOdd.append( 'from time import * ' ) - PyIsOdd.append( 'def IsOdd(a) : ' ) - PyIsOdd.append( ' print a,"IsOdd" ' ) - PyIsOdd.append( ' sleep( 1 ) ' ) - PyIsOdd.append( ' return a ' ) - IsOdd = GraphLoopSwitchs.INode( 'IsOdd' , PyIsOdd ) + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd(a) : ' ) + PyIsOdd.append( ' print a,"IsOdd" ' ) + PyIsOdd.append( ' sleep( 1 ) ' ) + PyIsOdd.append( ' return a,1 ' ) + IsOdd = GraphLoopSwitchs_1.INode( 'IsOdd' , PyIsOdd ) IsOdd.SetName( 'IsOdd' ) IsOdd.SetAuthor( '' ) IsOdd.SetComment( 'Python function' ) @@ -28,28 +28,32 @@ def DefGraphLoopSwitchs() : IIsOdda = IsOdd.InPort( 'a' , 'long' ) IIsOddGate = IsOdd.GetInPort( 'Gate' ) OIsOdda = IsOdd.OutPort( 'a' , 'long' ) + OIsOddOdd = IsOdd.OutPort( 'Odd' , 'long' ) OIsOddGate = IsOdd.GetOutPort( 'Gate' ) PyIsEven = [] - PyIsEven.append( 'from time import * ' ) - PyIsEven.append( 'def IsEven(a) : ' ) - PyIsEven.append( ' print a,"IsEven" ' ) - PyIsEven.append( ' sleep( 1 ) ' ) - PyIsEven.append( ' return a ' ) - IsEven = GraphLoopSwitchs.INode( 'IsEven' , PyIsEven ) + PyIsEven.append( 'from time import * ' ) + PyIsEven.append( 'def IsEven(a) : ' ) + PyIsEven.append( ' print a,"IsEven" ' ) + PyIsEven.append( ' sleep( 1 ) ' ) + PyIsEven.append( ' return a,1 ' ) + IsEven = GraphLoopSwitchs_1.INode( 'IsEven' , PyIsEven ) IsEven.SetName( 'IsEven' ) IsEven.SetAuthor( '' ) IsEven.SetComment( 'Python function' ) - IsEven.Coords( 479 , 311 ) + IsEven.Coords( 482 , 292 ) IIsEvena = IsEven.InPort( 'a' , 'long' ) IIsEvenGate = IsEven.GetInPort( 'Gate' ) OIsEvena = IsEven.OutPort( 'a' , 'long' ) + OIsEvenEven = IsEven.OutPort( 'Even' , 'long' ) OIsEvenGate = IsEven.GetOutPort( 'Gate' ) PySwitchsCompare = [] + PySwitchsCompare.append( 'from time import * ' ) PySwitchsCompare.append( 'def SwitchsCompare(aOdd,Odd,aEven,Even) : ' ) - PySwitchsCompare.append( ' return a ' ) - SwitchsCompare = GraphLoopSwitchs.INode( 'SwitchsCompare' , PySwitchsCompare ) + PySwitchsCompare.append( ' sleep(1) ' ) + PySwitchsCompare.append( ' return aOdd ' ) + SwitchsCompare = GraphLoopSwitchs_1.INode( 'SwitchsCompare' , PySwitchsCompare ) SwitchsCompare.SetName( 'SwitchsCompare' ) SwitchsCompare.SetAuthor( '' ) SwitchsCompare.SetComment( 'Compute Node' ) @@ -77,7 +81,7 @@ def DefGraphLoopSwitchs() : PyNextLoop.append( 'def NextLoop(Index,Min,Max) : ' ) PyNextLoop.append( ' Index = Index + 1 ' ) PyNextLoop.append( ' return Index,Min,Max ' ) - Loop,EndOfLoop = GraphLoopSwitchs.LNode( 'InitLoop' , PyLoop , 'MoreLoop' , PyMoreLoop , 'NextLoop' , PyNextLoop ) + Loop,EndOfLoop = GraphLoopSwitchs_1.LNode( 'InitLoop' , PyLoop , 'MoreLoop' , PyMoreLoop , 'NextLoop' , PyNextLoop ) EndOfLoop.SetName( 'EndOfLoop' ) EndOfLoop.SetAuthor( '' ) EndOfLoop.SetComment( 'Compute Node' ) @@ -110,18 +114,21 @@ def DefGraphLoopSwitchs() : # Creation of Switch Nodes PySwitchOdd = [] - PySwitchOdd.append( 'from time import * ' ) - PySwitchOdd.append( 'def Switch(a) : ' ) - PySwitchOdd.append( ' if ( a & 1 ) == 0 : ' ) - PySwitchOdd.append( ' sleep(1) ' ) - PySwitchOdd.append( ' return a & 1,1-(a&1),a ' ) - SwitchOdd,EndOfSwitchOdd = GraphLoopSwitchs.SNode( 'Switch' , PySwitchOdd ) + PySwitchOdd.append( 'from time import * ' ) + PySwitchOdd.append( 'def Switch(a) : ' ) + PySwitchOdd.append( ' sleep(1) ' ) + PySwitchOdd.append( ' return a & 1,1-(a&1),a ' ) + SwitchOdd,EndOfSwitchOdd = GraphLoopSwitchs_1.SNode( 'Switch' , PySwitchOdd ) EndOfSwitchOdd.SetName( 'EndOfSwitchOdd' ) EndOfSwitchOdd.SetAuthor( '' ) EndOfSwitchOdd.SetComment( 'Compute Node' ) EndOfSwitchOdd.Coords( 711 , 161 ) PyEndOfSwitchOdd = [] - EndOfSwitchOdd.SetPyFunction( '' , PyEndOfSwitchOdd ) + PyEndOfSwitchOdd.append( 'from time import * ' ) + PyEndOfSwitchOdd.append( 'def EndOfSwitchOdd(a,Odd) : ' ) + PyEndOfSwitchOdd.append( ' sleep(1) ' ) + PyEndOfSwitchOdd.append( ' return a,Odd ' ) + EndOfSwitchOdd.SetPyFunction( 'EndOfSwitchOdd' , PyEndOfSwitchOdd ) IEndOfSwitchOdda = EndOfSwitchOdd.InPort( 'a' , 'long' ) IEndOfSwitchOddOdd = EndOfSwitchOdd.InPort( 'Odd' , 'boolean' ) IEndOfSwitchOddDefault = EndOfSwitchOdd.GetInPort( 'Default' ) @@ -140,18 +147,21 @@ def DefGraphLoopSwitchs() : OSwitchOddDefault = SwitchOdd.GetOutPort( 'Default' ) PySwitchEven = [] - PySwitchEven.append( 'from time import * ' ) - PySwitchEven.append( 'def Switch(a) : ' ) - PySwitchEven.append( ' if ( a & 1 ) == 0 : ' ) - PySwitchEven.append( ' sleep(1) ' ) - PySwitchEven.append( ' return a & 1,1-(a&1),a ' ) - SwitchEven,EndOfSwitchEven = GraphLoopSwitchs.SNode( 'Switch' , PySwitchEven ) + PySwitchEven.append( 'from time import * ' ) + PySwitchEven.append( 'def Switch(a) : ' ) + PySwitchEven.append( ' sleep(1) ' ) + PySwitchEven.append( ' return a & 1,1-(a&1),a ' ) + SwitchEven,EndOfSwitchEven = GraphLoopSwitchs_1.SNode( 'Switch' , PySwitchEven ) EndOfSwitchEven.SetName( 'EndOfSwitchEven' ) EndOfSwitchEven.SetAuthor( '' ) EndOfSwitchEven.SetComment( 'Compute Node' ) EndOfSwitchEven.Coords( 718 , 361 ) PyEndOfSwitchEven = [] - EndOfSwitchEven.SetPyFunction( '' , PyEndOfSwitchEven ) + PyEndOfSwitchEven.append( 'from time import * ' ) + PyEndOfSwitchEven.append( 'def EndOfSwitchEven(a,Even) : ' ) + PyEndOfSwitchEven.append( ' sleep(1) ' ) + PyEndOfSwitchEven.append( ' return a,Even ' ) + EndOfSwitchEven.SetPyFunction( 'EndOfSwitchEven' , PyEndOfSwitchEven ) IEndOfSwitchEvena = EndOfSwitchEven.InPort( 'a' , 'long' ) IEndOfSwitchEvenEven = EndOfSwitchEven.InPort( 'Even' , 'boolean' ) IEndOfSwitchEvenDefault = EndOfSwitchEven.GetInPort( 'Default' ) @@ -170,57 +180,56 @@ def DefGraphLoopSwitchs() : OSwitchEvenDefault = SwitchEven.GetOutPort( 'Default' ) # Creation of Links - LIsOddaEndOfSwitchOdda = GraphLoopSwitchs.Link( OIsOdda , IEndOfSwitchOdda ) + LIsOddaEndOfSwitchOdda = GraphLoopSwitchs_1.Link( OIsOdda , IEndOfSwitchOdda ) - LSwitchOddOddIsOddGate = GraphLoopSwitchs.Link( OSwitchOddOdd , IIsOddGate ) + LIsOddOddEndOfSwitchOddOdd = GraphLoopSwitchs_1.Link( OIsOddOdd , IEndOfSwitchOddOdd ) - LSwitchOddOddEndOfSwitchOddOdd = GraphLoopSwitchs.Link( OSwitchOddOdd , IEndOfSwitchOddOdd ) + LSwitchOddOddIsOddGate = GraphLoopSwitchs_1.Link( OSwitchOddOdd , IIsOddGate ) - LSwitchOddaIsOdda = GraphLoopSwitchs.Link( OSwitchOdda , IIsOdda ) - LSwitchOddaIsOdda.AddCoord( 1 , 443 , 121 ) - LSwitchOddaIsOdda.AddCoord( 2 , 443 , 212 ) + LSwitchOddaIsOdda = GraphLoopSwitchs_1.Link( OSwitchOdda , IIsOdda ) - LSwitchOddDefaultEndOfSwitchOddDefault = GraphLoopSwitchs.Link( OSwitchOddDefault , IEndOfSwitchOddDefault ) + LSwitchOddDefaultEndOfSwitchOddDefault = GraphLoopSwitchs_1.Link( OSwitchOddDefault , IEndOfSwitchOddDefault ) - LEndOfSwitchOddaSwitchsCompareaOdd = GraphLoopSwitchs.Link( OEndOfSwitchOdda , ISwitchsCompareaOdd ) + LEndOfSwitchOddaSwitchsCompareaOdd = GraphLoopSwitchs_1.Link( OEndOfSwitchOdda , ISwitchsCompareaOdd ) - LEndOfSwitchOddOddSwitchsCompareOdd = GraphLoopSwitchs.Link( OEndOfSwitchOddOdd , ISwitchsCompareOdd ) + LEndOfSwitchOddOddSwitchsCompareOdd = GraphLoopSwitchs_1.Link( OEndOfSwitchOddOdd , ISwitchsCompareOdd ) - LIsEvenaEndOfSwitchEvena = GraphLoopSwitchs.Link( OIsEvena , IEndOfSwitchEvena ) + LIsEvenaEndOfSwitchEvena = GraphLoopSwitchs_1.Link( OIsEvena , IEndOfSwitchEvena ) - LLoopIndexSwitchEvena = GraphLoopSwitchs.Link( OLoopIndex , ISwitchEvena ) + LIsEvenEvenEndOfSwitchEvenEven = GraphLoopSwitchs_1.Link( OIsEvenEven , IEndOfSwitchEvenEven ) - LLoopIndexSwitchOdda = GraphLoopSwitchs.Link( OLoopIndex , ISwitchOdda ) + LLoopIndexSwitchEvena = GraphLoopSwitchs_1.Link( OLoopIndex , ISwitchEvena ) - LLoopMinEndOfLoopMin = GraphLoopSwitchs.Link( OLoopMin , IEndOfLoopMin ) + LLoopIndexSwitchOdda = GraphLoopSwitchs_1.Link( OLoopIndex , ISwitchOdda ) - LLoopMaxEndOfLoopMax = GraphLoopSwitchs.Link( OLoopMax , IEndOfLoopMax ) + LLoopMinEndOfLoopMin = GraphLoopSwitchs_1.Link( OLoopMin , IEndOfLoopMin ) - LSwitchEvenOddIsEvenGate = GraphLoopSwitchs.Link( OSwitchEvenOdd , IIsEvenGate ) + LLoopMaxEndOfLoopMax = GraphLoopSwitchs_1.Link( OLoopMax , IEndOfLoopMax ) - LSwitchEvenEvenEndOfSwitchEvenDefault = GraphLoopSwitchs.Link( OSwitchEvenEven , IEndOfSwitchEvenDefault ) + LSwitchEvenEvenIsEvenGate = GraphLoopSwitchs_1.Link( OSwitchEvenEven , IIsEvenGate ) - LSwitchEvenaIsEvena = GraphLoopSwitchs.Link( OSwitchEvena , IIsEvena ) - LSwitchEvenaIsEvena.AddCoord( 1 , 434 , 382 ) - LSwitchEvenaIsEvena.AddCoord( 2 , 434 , 457 ) + LSwitchEvenaIsEvena = GraphLoopSwitchs_1.Link( OSwitchEvena , IIsEvena ) - LEndOfSwitchEvenaSwitchsCompareaEven = GraphLoopSwitchs.Link( OEndOfSwitchEvena , ISwitchsCompareaEven ) + LSwitchEvenDefaultEndOfSwitchEvenDefault = GraphLoopSwitchs_1.Link( OSwitchEvenDefault , IEndOfSwitchEvenDefault ) - LEndOfSwitchEvenEvenSwitchsCompareEven = GraphLoopSwitchs.Link( OEndOfSwitchEvenEven , ISwitchsCompareEven ) + LEndOfSwitchEvenaSwitchsCompareaEven = GraphLoopSwitchs_1.Link( OEndOfSwitchEvena , ISwitchsCompareaEven ) - LSwitchsCompareaEndOfLoopIndex = GraphLoopSwitchs.Link( OSwitchsComparea , IEndOfLoopIndex ) + LEndOfSwitchEvenEvenSwitchsCompareEven = GraphLoopSwitchs_1.Link( OEndOfSwitchEvenEven , ISwitchsCompareEven ) + + LSwitchsCompareaEndOfLoopIndex = GraphLoopSwitchs_1.Link( OSwitchsComparea , IEndOfLoopIndex ) # Input datas ILoopIndex.Input( 0 ) ILoopMin.Input( 0 ) - ILoopMax.Input( 100 ) + ILoopMax.Input( 23 ) # Output Ports of the graph #OSwitchOddEven = SwitchOdd.GetOutPort( 'Even' ) #OEndOfLoopIndex = EndOfLoop.GetOutPort( 'Index' ) #OEndOfLoopMin = EndOfLoop.GetOutPort( 'Min' ) #OEndOfLoopMax = EndOfLoop.GetOutPort( 'Max' ) - return GraphLoopSwitchs + #OSwitchEvenOdd = SwitchEven.GetOutPort( 'Odd' ) + return GraphLoopSwitchs_1 -GraphLoopSwitchs = DefGraphLoopSwitchs() +GraphLoopSwitchs_1 = DefGraphLoopSwitchs_1() diff --git a/examples/GraphLoopSwitchs.xml b/examples/GraphLoopSwitchs.xml index 7403dd0..c331d87 100644 --- a/examples/GraphLoopSwitchs.xml +++ b/examples/GraphLoopSwitchs.xml @@ -5,11 +5,11 @@ ? ? - GraphLoopSwitchs + GraphLoopSwitchs_1 1 ? -GraphLoopSwitchs +GraphLoopSwitchs_1 long @@ -32,11 +32,14 @@ EndOfLoop__Min long - EndOfLoop__Max + EndOfLoop__Max + +long + SwitchEven__Odd 14/10/2003 - 10:29:4 - 19/1/2005 - 18:42:37 + 8/3/2005 - 15:15:0 1.05 JR ? @@ -59,18 +62,21 @@ long - a + a + +long + Odd IsOdd - - - - - - 19/1/2005 - 18:26:50 - 19/1/2005 - 18:26:50 + + + + + + 8/3/2005 - 15:15:0 + 8/3/2005 - 15:15:0 1.05 ? ? @@ -84,7 +90,7 @@ 6 EndOfSwitchOdd -Switch +SwitchOdd long @@ -103,13 +109,12 @@ Switch - - - - - - 19/1/2005 - 18:26:50 - 19/1/2005 - 18:26:50 + + + + + 8/3/2005 - 15:15:0 + 8/3/2005 - 15:15:0 1.05 ? ? @@ -123,7 +128,7 @@ 7 SwitchOdd -EndOfSwitch +EndOfSwitchOdd long @@ -141,10 +146,13 @@ -? - - 19/1/2005 - 18:26:50 - 19/1/2005 - 18:26:50 +EndOfSwitchOdd + + + + + 8/3/2005 - 15:15:0 + 8/3/2005 - 15:15:0 1.05 ? ? @@ -158,7 +166,7 @@ 3 ? -IsOdd_1 +IsEven long @@ -166,24 +174,27 @@ long - a + a + +long + Even IsEven - - - - - - 19/1/2005 - 18:26:50 - 19/1/2005 - 18:26:50 + + + + + + 8/3/2005 - 15:15:0 + 8/3/2005 - 15:15:0 1.05 ? ? Python function - 479 - 311 + 482 + 292 ? ? @@ -191,7 +202,7 @@ 4 EndOfLoop -InitLoop +Loop long @@ -231,8 +242,8 @@ - 19/1/2005 - 18:26:50 - 19/1/2005 - 18:26:50 + 8/3/2005 - 15:15:0 + 8/3/2005 - 15:15:0 1.05 ? ? @@ -246,7 +257,7 @@ 5 Loop -EndOfInitLoop +EndOfLoop long @@ -272,8 +283,8 @@ ? - 19/1/2005 - 18:26:50 - 19/1/2005 - 18:26:50 + 8/3/2005 - 15:15:0 + 8/3/2005 - 15:15:0 1.05 ? ? @@ -287,7 +298,7 @@ 6 EndOfSwitchEven -Switch_1 +SwitchEven long @@ -306,13 +317,12 @@ Switch - - - - - - 19/1/2005 - 18:26:50 - 19/1/2005 - 18:26:50 + + + + + 8/3/2005 - 15:15:0 + 8/3/2005 - 15:15:0 1.05 ? ? @@ -326,7 +336,7 @@ 7 SwitchEven -EndSwitch +EndOfSwitchEven long @@ -344,10 +354,13 @@ -? - - 19/1/2005 - 18:26:50 - 19/1/2005 - 18:26:50 +EndOfSwitchEven + + + + + 8/3/2005 - 15:15:0 + 8/3/2005 - 15:15:0 1.05 ? ? @@ -383,10 +396,12 @@ SwitchsCompare + - - 19/1/2005 - 18:34:18 - 19/1/2005 - 18:34:18 + + + 8/3/2005 - 15:15:0 + 8/3/2005 - 15:15:0 2.0 ? ? @@ -401,29 +416,23 @@ a -SwitchOdd +IsOdd Odd - IsOdd - Gate + EndOfSwitchOdd + Odd SwitchOdd Odd - EndOfSwitchOdd - Odd + IsOdd + Gate SwitchOdd a IsOdd a - - -443 - 121 - -443 - 212 + SwitchOdd Default @@ -449,6 +458,12 @@ a +IsEven + Even + EndOfSwitchEven + Even + + Loop DoLoop EndOfLoop @@ -486,28 +501,22 @@ SwitchEven - Odd + Even IsEven Gate -SwitchEven - Even - EndOfSwitchEven - Default - - SwitchEven a IsEven a - - -434 - 382 - -434 - 457 + + +SwitchEven + Default + EndOfSwitchEven + Default + EndOfSwitchEven a @@ -528,7 +537,7 @@ -GraphLoopSwitchs +GraphLoopSwitchs_1 Loop__Index Loop Index @@ -537,7 +546,7 @@ 0 -GraphLoopSwitchs +GraphLoopSwitchs_1 Loop__Min Loop Min @@ -546,11 +555,11 @@ 0 -GraphLoopSwitchs +GraphLoopSwitchs_1 Loop__Max Loop Max 3 - 100 + 23 diff --git a/examples/GraphLoopSwitchsAborted.py b/examples/GraphLoopSwitchsAborted.py new file mode 100644 index 0000000..c34b09f --- /dev/null +++ b/examples/GraphLoopSwitchsAborted.py @@ -0,0 +1,231 @@ + +# Generated python file of Graph GraphLoopSwitchsAborted + +from SuperV import * + +# Graph creation of GraphLoopSwitchsAborted +def DefGraphLoopSwitchsAborted() : + GraphLoopSwitchsAborted = Graph( 'GraphLoopSwitchsAborted' ) + GraphLoopSwitchsAborted.SetName( 'GraphLoopSwitchsAborted' ) + GraphLoopSwitchsAborted.SetAuthor( 'JR' ) + GraphLoopSwitchsAborted.SetComment( 'Default links are missing' ) + GraphLoopSwitchsAborted.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsOdd = [] + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd(a) : ' ) + PyIsOdd.append( ' print a,"IsOdd" ' ) + PyIsOdd.append( ' sleep( 1 ) ' ) + PyIsOdd.append( ' return a,1 ' ) + IsOdd = GraphLoopSwitchsAborted.INode( 'IsOdd' , PyIsOdd ) + IsOdd.SetName( 'IsOdd' ) + IsOdd.SetAuthor( '' ) + IsOdd.SetComment( 'Python function' ) + IsOdd.Coords( 476 , 50 ) + IIsOdda = IsOdd.InPort( 'a' , 'long' ) + IIsOddGate = IsOdd.GetInPort( 'Gate' ) + OIsOdda = IsOdd.OutPort( 'a' , 'long' ) + OIsOddOdd = IsOdd.OutPort( 'Odd' , 'long' ) + OIsOddGate = IsOdd.GetOutPort( 'Gate' ) + + PyIsEven = [] + PyIsEven.append( 'from time import * ' ) + PyIsEven.append( 'def IsEven(a) : ' ) + PyIsEven.append( ' print a,"IsEven" ' ) + PyIsEven.append( ' sleep( 1 ) ' ) + PyIsEven.append( ' return a,1 ' ) + IsEven = GraphLoopSwitchsAborted.INode( 'IsEven' , PyIsEven ) + IsEven.SetName( 'IsEven' ) + IsEven.SetAuthor( '' ) + IsEven.SetComment( 'Python function' ) + IsEven.Coords( 482 , 292 ) + IIsEvena = IsEven.InPort( 'a' , 'long' ) + IIsEvenGate = IsEven.GetInPort( 'Gate' ) + OIsEvena = IsEven.OutPort( 'a' , 'long' ) + OIsEvenEven = IsEven.OutPort( 'Even' , 'long' ) + OIsEvenGate = IsEven.GetOutPort( 'Gate' ) + + PySwitchsCompare = [] + PySwitchsCompare.append( 'from time import * ' ) + PySwitchsCompare.append( 'def SwitchsCompare(aOdd,Odd,aEven,Even) : ' ) + PySwitchsCompare.append( ' sleep(1) ' ) + PySwitchsCompare.append( ' return aOdd ' ) + SwitchsCompare = GraphLoopSwitchsAborted.INode( 'SwitchsCompare' , PySwitchsCompare ) + SwitchsCompare.SetName( 'SwitchsCompare' ) + SwitchsCompare.SetAuthor( '' ) + SwitchsCompare.SetComment( 'Compute Node' ) + SwitchsCompare.Coords( 919 , 242 ) + ISwitchsCompareaOdd = SwitchsCompare.InPort( 'aOdd' , 'long' ) + ISwitchsCompareOdd = SwitchsCompare.InPort( 'Odd' , 'boolean' ) + ISwitchsCompareaEven = SwitchsCompare.InPort( 'aEven' , 'long' ) + ISwitchsCompareEven = SwitchsCompare.InPort( 'Even' , 'boolean' ) + ISwitchsCompareGate = SwitchsCompare.GetInPort( 'Gate' ) + OSwitchsComparea = SwitchsCompare.OutPort( 'a' , 'long' ) + OSwitchsCompareGate = SwitchsCompare.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyLoop = [] + PyLoop.append( 'def InitLoop(Index,Min,Max) : ' ) + PyLoop.append( ' return Index,Min,Max ' ) + PyMoreLoop = [] + PyMoreLoop.append( 'def MoreLoop(Index,Min,Max) : ' ) + PyMoreLoop.append( ' if Index <= Max : ' ) + PyMoreLoop.append( ' DoLoop = 1 ' ) + PyMoreLoop.append( ' else : ' ) + PyMoreLoop.append( ' DoLoop = 0 ' ) + PyMoreLoop.append( ' return DoLoop,Index,Min,Max ' ) + PyNextLoop = [] + PyNextLoop.append( 'def NextLoop(Index,Min,Max) : ' ) + PyNextLoop.append( ' Index = Index + 1 ' ) + PyNextLoop.append( ' return Index,Min,Max ' ) + Loop,EndOfLoop = GraphLoopSwitchsAborted.LNode( 'InitLoop' , PyLoop , 'MoreLoop' , PyMoreLoop , 'NextLoop' , PyNextLoop ) + EndOfLoop.SetName( 'EndOfLoop' ) + EndOfLoop.SetAuthor( '' ) + EndOfLoop.SetComment( 'Compute Node' ) + EndOfLoop.Coords( 1102 , 282 ) + PyEndOfLoop = [] + EndOfLoop.SetPyFunction( '' , PyEndOfLoop ) + ILoopDoLoop = Loop.GetInPort( 'DoLoop' ) + ILoopIndex = Loop.InPort( 'Index' , 'long' ) + ILoopMin = Loop.InPort( 'Min' , 'long' ) + ILoopMax = Loop.InPort( 'Max' , 'long' ) + ILoopGate = Loop.GetInPort( 'Gate' ) + OLoopDoLoop = Loop.GetOutPort( 'DoLoop' ) + OLoopIndex = Loop.GetOutPort( 'Index' ) + OLoopMin = Loop.GetOutPort( 'Min' ) + OLoopMax = Loop.GetOutPort( 'Max' ) + IEndOfLoopDoLoop = EndOfLoop.GetInPort( 'DoLoop' ) + IEndOfLoopIndex = EndOfLoop.GetInPort( 'Index' ) + IEndOfLoopMin = EndOfLoop.GetInPort( 'Min' ) + IEndOfLoopMax = EndOfLoop.GetInPort( 'Max' ) + IEndOfLoopGate = EndOfLoop.GetInPort( 'Gate' ) + OEndOfLoopDoLoop = EndOfLoop.GetOutPort( 'DoLoop' ) + OEndOfLoopIndex = EndOfLoop.GetOutPort( 'Index' ) + OEndOfLoopMin = EndOfLoop.GetOutPort( 'Min' ) + OEndOfLoopMax = EndOfLoop.GetOutPort( 'Max' ) + OEndOfLoopGate = EndOfLoop.GetOutPort( 'Gate' ) + Loop.SetName( 'Loop' ) + Loop.SetAuthor( '' ) + Loop.SetComment( 'Compute Node' ) + Loop.Coords( 12 , 276 ) + + # Creation of Switch Nodes + PySwitchOdd = [] + PySwitchOdd.append( 'from time import * ' ) + PySwitchOdd.append( 'def Switch(a) : ' ) + PySwitchOdd.append( ' sleep(1) ' ) + PySwitchOdd.append( ' return a & 1,1-(a&1),a ' ) + SwitchOdd,EndOfSwitchOdd = GraphLoopSwitchsAborted.SNode( 'Switch' , PySwitchOdd ) + EndOfSwitchOdd.SetName( 'EndOfSwitchOdd' ) + EndOfSwitchOdd.SetAuthor( '' ) + EndOfSwitchOdd.SetComment( 'Compute Node' ) + EndOfSwitchOdd.Coords( 711 , 161 ) + PyEndOfSwitchOdd = [] + PyEndOfSwitchOdd.append( 'from time import * ' ) + PyEndOfSwitchOdd.append( 'def EndOfSwitchOdd(a,Odd) : ' ) + PyEndOfSwitchOdd.append( ' sleep(1) ' ) + PyEndOfSwitchOdd.append( ' return a,Odd ' ) + EndOfSwitchOdd.SetPyFunction( 'EndOfSwitchOdd' , PyEndOfSwitchOdd ) + IEndOfSwitchOdda = EndOfSwitchOdd.InPort( 'a' , 'long' ) + IEndOfSwitchOddOdd = EndOfSwitchOdd.InPort( 'Odd' , 'boolean' ) + IEndOfSwitchOddDefault = EndOfSwitchOdd.GetInPort( 'Default' ) + OEndOfSwitchOdda = EndOfSwitchOdd.OutPort( 'a' , 'long' ) + OEndOfSwitchOddOdd = EndOfSwitchOdd.OutPort( 'Odd' , 'boolean' ) + OEndOfSwitchOddGate = EndOfSwitchOdd.GetOutPort( 'Gate' ) + SwitchOdd.SetName( 'SwitchOdd' ) + SwitchOdd.SetAuthor( '' ) + SwitchOdd.SetComment( 'Compute Node' ) + SwitchOdd.Coords( 240 , 141 ) + ISwitchOdda = SwitchOdd.InPort( 'a' , 'long' ) + ISwitchOddGate = SwitchOdd.GetInPort( 'Gate' ) + OSwitchOddOdd = SwitchOdd.OutPort( 'Odd' , 'long' ) + OSwitchOddEven = SwitchOdd.OutPort( 'Even' , 'int' ) + OSwitchOdda = SwitchOdd.OutPort( 'a' , 'int' ) + OSwitchOddDefault = SwitchOdd.GetOutPort( 'Default' ) + + PySwitchEven = [] + PySwitchEven.append( 'from time import * ' ) + PySwitchEven.append( 'def Switch(a) : ' ) + PySwitchEven.append( ' sleep(1) ' ) + PySwitchEven.append( ' return a & 1,1-(a&1),a ' ) + SwitchEven,EndOfSwitchEven = GraphLoopSwitchsAborted.SNode( 'Switch' , PySwitchEven ) + EndOfSwitchEven.SetName( 'EndOfSwitchEven' ) + EndOfSwitchEven.SetAuthor( '' ) + EndOfSwitchEven.SetComment( 'Compute Node' ) + EndOfSwitchEven.Coords( 718 , 361 ) + PyEndOfSwitchEven = [] + PyEndOfSwitchEven.append( 'from time import * ' ) + PyEndOfSwitchEven.append( 'def EndOfSwitchEven(a,Even) : ' ) + PyEndOfSwitchEven.append( ' sleep(1) ' ) + PyEndOfSwitchEven.append( ' return a,Even ' ) + EndOfSwitchEven.SetPyFunction( 'EndOfSwitchEven' , PyEndOfSwitchEven ) + IEndOfSwitchEvena = EndOfSwitchEven.InPort( 'a' , 'long' ) + IEndOfSwitchEvenEven = EndOfSwitchEven.InPort( 'Even' , 'boolean' ) + IEndOfSwitchEvenDefault = EndOfSwitchEven.GetInPort( 'Default' ) + OEndOfSwitchEvena = EndOfSwitchEven.OutPort( 'a' , 'long' ) + OEndOfSwitchEvenEven = EndOfSwitchEven.OutPort( 'Even' , 'boolean' ) + OEndOfSwitchEvenGate = EndOfSwitchEven.GetOutPort( 'Gate' ) + SwitchEven.SetName( 'SwitchEven' ) + SwitchEven.SetAuthor( '' ) + SwitchEven.SetComment( 'Compute Node' ) + SwitchEven.Coords( 235 , 386 ) + ISwitchEvena = SwitchEven.InPort( 'a' , 'long' ) + ISwitchEvenGate = SwitchEven.GetInPort( 'Gate' ) + OSwitchEvenOdd = SwitchEven.OutPort( 'Odd' , 'long' ) + OSwitchEvenEven = SwitchEven.OutPort( 'Even' , 'int' ) + OSwitchEvena = SwitchEven.OutPort( 'a' , 'int' ) + OSwitchEvenDefault = SwitchEven.GetOutPort( 'Default' ) + + # Creation of Links + LIsOddaEndOfSwitchOdda = GraphLoopSwitchsAborted.Link( OIsOdda , IEndOfSwitchOdda ) + + LIsOddOddEndOfSwitchOddOdd = GraphLoopSwitchsAborted.Link( OIsOddOdd , IEndOfSwitchOddOdd ) + + LSwitchOddOddIsOddGate = GraphLoopSwitchsAborted.Link( OSwitchOddOdd , IIsOddGate ) + + LSwitchOddaIsOdda = GraphLoopSwitchsAborted.Link( OSwitchOdda , IIsOdda ) + + LEndOfSwitchOddaSwitchsCompareaOdd = GraphLoopSwitchsAborted.Link( OEndOfSwitchOdda , ISwitchsCompareaOdd ) + + LEndOfSwitchOddOddSwitchsCompareOdd = GraphLoopSwitchsAborted.Link( OEndOfSwitchOddOdd , ISwitchsCompareOdd ) + + LIsEvenaEndOfSwitchEvena = GraphLoopSwitchsAborted.Link( OIsEvena , IEndOfSwitchEvena ) + + LIsEvenEvenEndOfSwitchEvenEven = GraphLoopSwitchsAborted.Link( OIsEvenEven , IEndOfSwitchEvenEven ) + + LLoopIndexSwitchEvena = GraphLoopSwitchsAborted.Link( OLoopIndex , ISwitchEvena ) + + LLoopIndexSwitchOdda = GraphLoopSwitchsAborted.Link( OLoopIndex , ISwitchOdda ) + + LLoopMinEndOfLoopMin = GraphLoopSwitchsAborted.Link( OLoopMin , IEndOfLoopMin ) + + LLoopMaxEndOfLoopMax = GraphLoopSwitchsAborted.Link( OLoopMax , IEndOfLoopMax ) + + LSwitchEvenEvenIsEvenGate = GraphLoopSwitchsAborted.Link( OSwitchEvenEven , IIsEvenGate ) + + LSwitchEvenaIsEvena = GraphLoopSwitchsAborted.Link( OSwitchEvena , IIsEvena ) + + LEndOfSwitchEvenaSwitchsCompareaEven = GraphLoopSwitchsAborted.Link( OEndOfSwitchEvena , ISwitchsCompareaEven ) + + LEndOfSwitchEvenEvenSwitchsCompareEven = GraphLoopSwitchsAborted.Link( OEndOfSwitchEvenEven , ISwitchsCompareEven ) + + LSwitchsCompareaEndOfLoopIndex = GraphLoopSwitchsAborted.Link( OSwitchsComparea , IEndOfLoopIndex ) + + # Input datas + ILoopIndex.Input( 0 ) + ILoopMin.Input( 0 ) + ILoopMax.Input( 23 ) + + # Output Ports of the graph + #OSwitchOddEven = SwitchOdd.GetOutPort( 'Even' ) + #OEndOfLoopIndex = EndOfLoop.GetOutPort( 'Index' ) + #OEndOfLoopMin = EndOfLoop.GetOutPort( 'Min' ) + #OEndOfLoopMax = EndOfLoop.GetOutPort( 'Max' ) + #OSwitchEvenOdd = SwitchEven.GetOutPort( 'Odd' ) + return GraphLoopSwitchsAborted + + +GraphLoopSwitchsAborted = DefGraphLoopSwitchsAborted() diff --git a/examples/GraphLoopSwitchsAborted.xml b/examples/GraphLoopSwitchsAborted.xml new file mode 100644 index 0000000..0529923 --- /dev/null +++ b/examples/GraphLoopSwitchsAborted.xml @@ -0,0 +1,553 @@ + + + + + +? + ? + GraphLoopSwitchsAborted + 1 + ? + +GraphLoopSwitchs_1 + + +long + Loop__Index + +long + Loop__Min + +long + Loop__Max + + +int + SwitchOdd__Even + +long + EndOfLoop__Index + +long + EndOfLoop__Min + +long + EndOfLoop__Max + +long + SwitchEven__Odd + + + 14/10/2003 - 10:29:4 + 14/2/2005 - 16:59:13 + 1.05 + JR + ? + Default links are missing + 0 + 0 + + +? + ? + IsOdd + 3 + ? + +IsOdd + + +long + a + + +long + a + +long + Odd + + + +IsOdd + + + + + + 14/2/2005 - 16:59:13 + 14/2/2005 - 16:59:13 + 1.05 + ? + ? + Python function + 476 + 50 + +? + ? + SwitchOdd + 6 + EndOfSwitchOdd + +SwitchOdd + + +long + a + + +long + Odd + +int + Even + +int + a + + + +Switch + + + + + 14/2/2005 - 16:59:13 + 14/2/2005 - 16:59:13 + 1.05 + ? + ? + Compute Node + 240 + 141 + +? + ? + EndOfSwitchOdd + 7 + SwitchOdd + +EndOfSwitchOdd + + +long + a + +boolean + Odd + + +long + a + +boolean + Odd + + + +EndOfSwitchOdd + + + + + 14/2/2005 - 16:59:13 + 14/2/2005 - 16:59:13 + 1.05 + ? + ? + Compute Node + 711 + 161 + +? + ? + IsEven + 3 + ? + +IsEven + + +long + a + + +long + a + +long + Even + + + +IsEven + + + + + + 14/2/2005 - 16:59:13 + 14/2/2005 - 16:59:13 + 1.05 + ? + ? + Python function + 482 + 292 + +? + ? + Loop + 4 + EndOfLoop + +Loop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +InitLoop + + + +MoreLoop + + + + + + + +NextLoop + + + + 14/2/2005 - 16:59:13 + 14/2/2005 - 16:59:13 + 1.05 + ? + ? + Compute Node + 12 + 276 + +? + ? + EndOfLoop + 5 + Loop + +EndOfLoop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +? + + 14/2/2005 - 16:59:13 + 14/2/2005 - 16:59:13 + 1.05 + ? + ? + Compute Node + 1102 + 282 + +? + ? + SwitchEven + 6 + EndOfSwitchEven + +SwitchEven + + +long + a + + +long + Odd + +int + Even + +int + a + + + +Switch + + + + + 14/2/2005 - 16:59:13 + 14/2/2005 - 16:59:13 + 1.05 + ? + ? + Compute Node + 235 + 386 + +? + ? + EndOfSwitchEven + 7 + SwitchEven + +EndOfSwitchEven + + +long + a + +boolean + Even + + +long + a + +boolean + Even + + + +EndOfSwitchEven + + + + + 14/2/2005 - 16:59:13 + 14/2/2005 - 16:59:13 + 1.05 + ? + ? + Compute Node + 718 + 361 + +? + ? + SwitchsCompare + 3 + ? + +SwitchsCompare + + +long + aOdd + +boolean + Odd + +long + aEven + +boolean + Even + + +long + a + + + +SwitchsCompare + + + + + 14/2/2005 - 16:59:13 + 14/2/2005 - 16:59:13 + 2.0 + ? + ? + Compute Node + 919 + 242 + + +IsOdd + a + EndOfSwitchOdd + a + + +IsOdd + Odd + EndOfSwitchOdd + Odd + + +SwitchOdd + Odd + IsOdd + Gate + + +SwitchOdd + a + IsOdd + a + + +EndOfSwitchOdd + a + SwitchsCompare + aOdd + + +EndOfSwitchOdd + Odd + SwitchsCompare + Odd + + +IsEven + a + EndOfSwitchEven + a + + +IsEven + Even + EndOfSwitchEven + Even + + +Loop + DoLoop + EndOfLoop + DoLoop + + +Loop + Index + SwitchEven + a + + +Loop + Index + SwitchOdd + a + + +Loop + Min + EndOfLoop + Min + + +Loop + Max + EndOfLoop + Max + + +EndOfLoop + DoLoop + Loop + DoLoop + + +SwitchEven + Even + IsEven + Gate + + +SwitchEven + a + IsEven + a + + +EndOfSwitchEven + a + SwitchsCompare + aEven + + +EndOfSwitchEven + Even + SwitchsCompare + Even + + +SwitchsCompare + a + EndOfLoop + Index + + + +GraphLoopSwitchsAborted + Loop__Index + Loop + Index + +3 + 0 + + +GraphLoopSwitchsAborted + Loop__Min + Loop + Min + +3 + 0 + + +GraphLoopSwitchsAborted + Loop__Max + Loop + Max + +3 + 23 + diff --git a/examples/GraphLoopSwitchsBranches.py b/examples/GraphLoopSwitchsBranches.py new file mode 100644 index 0000000..40b474c --- /dev/null +++ b/examples/GraphLoopSwitchsBranches.py @@ -0,0 +1,290 @@ + +# Generated python file of Graph GraphLoopSwitchsBranches_1 + +from SuperV import * + +# Graph creation of GraphLoopSwitchsBranches_1 +def DefGraphLoopSwitchsBranches_1() : + GraphLoopSwitchsBranches_1 = Graph( 'GraphLoopSwitchsBranches_1' ) + GraphLoopSwitchsBranches_1.SetName( 'GraphLoopSwitchsBranches_1' ) + GraphLoopSwitchsBranches_1.SetAuthor( 'JR' ) + GraphLoopSwitchsBranches_1.SetComment( '' ) + GraphLoopSwitchsBranches_1.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsOdd = [] + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd(a) : ' ) + PyIsOdd.append( ' print a,"IsOdd" ' ) + PyIsOdd.append( ' sleep( 1 ) ' ) + PyIsOdd.append( ' return a,1 ' ) + IsOdd = GraphLoopSwitchsBranches_1.INode( 'IsOdd' , PyIsOdd ) + IsOdd.SetName( 'IsOdd' ) + IsOdd.SetAuthor( '' ) + IsOdd.SetComment( 'Python function' ) + IsOdd.Coords( 476 , 2 ) + IIsOdda = IsOdd.InPort( 'a' , 'long' ) + IIsOddGate = IsOdd.GetInPort( 'Gate' ) + OIsOdda = IsOdd.OutPort( 'a' , 'long' ) + OIsOddOdd = IsOdd.OutPort( 'Odd' , 'long' ) + OIsOddGate = IsOdd.GetOutPort( 'Gate' ) + + PyIsEven = [] + PyIsEven.append( 'from time import * ' ) + PyIsEven.append( 'def IsEven(a) : ' ) + PyIsEven.append( ' print a,"IsEven" ' ) + PyIsEven.append( ' sleep( 1 ) ' ) + PyIsEven.append( ' return a,1 ' ) + IsEven = GraphLoopSwitchsBranches_1.INode( 'IsEven' , PyIsEven ) + IsEven.SetName( 'IsEven' ) + IsEven.SetAuthor( '' ) + IsEven.SetComment( 'Python function' ) + IsEven.Coords( 472 , 724 ) + IIsEvena = IsEven.InPort( 'a' , 'long' ) + IIsEvenGate = IsEven.GetInPort( 'Gate' ) + OIsEvena = IsEven.OutPort( 'a' , 'long' ) + OIsEvenEven = IsEven.OutPort( 'Even' , 'long' ) + OIsEvenGate = IsEven.GetOutPort( 'Gate' ) + + PySwitchsCompare = [] + PySwitchsCompare.append( 'from time import * ' ) + PySwitchsCompare.append( 'def SwitchsCompare(aOdd,Odd,aEven,Even,Index) : ' ) + PySwitchsCompare.append( ' sleep(1) ' ) + PySwitchsCompare.append( ' return Index ' ) + SwitchsCompare = GraphLoopSwitchsBranches_1.INode( 'SwitchsCompare' , PySwitchsCompare ) + SwitchsCompare.SetName( 'SwitchsCompare' ) + SwitchsCompare.SetAuthor( '' ) + SwitchsCompare.SetComment( 'Compute Node' ) + SwitchsCompare.Coords( 918 , 221 ) + ISwitchsCompareaOdd = SwitchsCompare.InPort( 'aOdd' , 'long' ) + ISwitchsCompareOdd = SwitchsCompare.InPort( 'Odd' , 'boolean' ) + ISwitchsCompareaEven = SwitchsCompare.InPort( 'aEven' , 'long' ) + ISwitchsCompareEven = SwitchsCompare.InPort( 'Even' , 'boolean' ) + ISwitchsCompareIndex = SwitchsCompare.InPort( 'Index' , 'long' ) + ISwitchsCompareGate = SwitchsCompare.GetInPort( 'Gate' ) + OSwitchsCompareIndex = SwitchsCompare.OutPort( 'Index' , 'long' ) + OSwitchsCompareGate = SwitchsCompare.GetOutPort( 'Gate' ) + + PyIsNotOdd = [] + PyIsNotOdd.append( 'from time import * ' ) + PyIsNotOdd.append( 'def IsNotOdd(Even) : ' ) + PyIsNotOdd.append( ' sleep(1) ' ) + PyIsNotOdd.append( ' return Even ' ) + IsNotOdd = GraphLoopSwitchsBranches_1.INode( 'IsNotOdd' , PyIsNotOdd ) + IsNotOdd.SetName( 'IsNotOdd' ) + IsNotOdd.SetAuthor( '' ) + IsNotOdd.SetComment( 'Compute Node' ) + IsNotOdd.Coords( 477 , 145 ) + IIsNotOddEven = IsNotOdd.InPort( 'Even' , 'long' ) + IIsNotOddGate = IsNotOdd.GetInPort( 'Gate' ) + OIsNotOddEven = IsNotOdd.OutPort( 'Even' , 'long' ) + OIsNotOddGate = IsNotOdd.GetOutPort( 'Gate' ) + + PyIsNotEven = [] + PyIsNotEven.append( 'from time import * ' ) + PyIsNotEven.append( 'def IsNotEven(Odd) : ' ) + PyIsNotEven.append( ' sleep(1) ' ) + PyIsNotEven.append( ' return Odd ' ) + IsNotEven = GraphLoopSwitchsBranches_1.INode( 'IsNotEven' , PyIsNotEven ) + IsNotEven.SetName( 'IsNotEven' ) + IsNotEven.SetAuthor( '' ) + IsNotEven.SetComment( 'Compute Node' ) + IsNotEven.Coords( 477 , 570 ) + IIsNotEvenOdd = IsNotEven.InPort( 'Odd' , 'long' ) + IIsNotEvenGate = IsNotEven.GetInPort( 'Gate' ) + OIsNotEvenOdd = IsNotEven.OutPort( 'Odd' , 'long' ) + OIsNotEvenGate = IsNotEven.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyLoop = [] + PyLoop.append( 'def InitLoop(Index,Min,Max) : ' ) + PyLoop.append( ' return Index,Min,Max ' ) + PyMoreLoop = [] + PyMoreLoop.append( 'def MoreLoop(Index,Min,Max) : ' ) + PyMoreLoop.append( ' if Index <= Max : ' ) + PyMoreLoop.append( ' DoLoop = 1 ' ) + PyMoreLoop.append( ' else : ' ) + PyMoreLoop.append( ' DoLoop = 0 ' ) + PyMoreLoop.append( ' return DoLoop,Index,Min,Max ' ) + PyNextLoop = [] + PyNextLoop.append( 'def NextLoop(Index,Min,Max) : ' ) + PyNextLoop.append( ' Index = Index + 1 ' ) + PyNextLoop.append( ' return Index,Min,Max ' ) + Loop,EndOfLoop = GraphLoopSwitchsBranches_1.LNode( 'InitLoop' , PyLoop , 'MoreLoop' , PyMoreLoop , 'NextLoop' , PyNextLoop ) + EndOfLoop.SetName( 'EndOfLoop' ) + EndOfLoop.SetAuthor( '' ) + EndOfLoop.SetComment( 'Compute Node' ) + EndOfLoop.Coords( 1099 , 261 ) + PyEndOfLoop = [] + EndOfLoop.SetPyFunction( '' , PyEndOfLoop ) + ILoopDoLoop = Loop.GetInPort( 'DoLoop' ) + ILoopIndex = Loop.InPort( 'Index' , 'long' ) + ILoopMin = Loop.InPort( 'Min' , 'long' ) + ILoopMax = Loop.InPort( 'Max' , 'long' ) + ILoopGate = Loop.GetInPort( 'Gate' ) + OLoopDoLoop = Loop.GetOutPort( 'DoLoop' ) + OLoopIndex = Loop.GetOutPort( 'Index' ) + OLoopMin = Loop.GetOutPort( 'Min' ) + OLoopMax = Loop.GetOutPort( 'Max' ) + IEndOfLoopDoLoop = EndOfLoop.GetInPort( 'DoLoop' ) + IEndOfLoopIndex = EndOfLoop.GetInPort( 'Index' ) + IEndOfLoopMin = EndOfLoop.GetInPort( 'Min' ) + IEndOfLoopMax = EndOfLoop.GetInPort( 'Max' ) + IEndOfLoopGate = EndOfLoop.GetInPort( 'Gate' ) + OEndOfLoopDoLoop = EndOfLoop.GetOutPort( 'DoLoop' ) + OEndOfLoopIndex = EndOfLoop.GetOutPort( 'Index' ) + OEndOfLoopMin = EndOfLoop.GetOutPort( 'Min' ) + OEndOfLoopMax = EndOfLoop.GetOutPort( 'Max' ) + OEndOfLoopGate = EndOfLoop.GetOutPort( 'Gate' ) + Loop.SetName( 'Loop' ) + Loop.SetAuthor( '' ) + Loop.SetComment( 'Compute Node' ) + Loop.Coords( 19 , 341 ) + + # Creation of Switch Nodes + PySwitchOdd = [] + PySwitchOdd.append( 'from time import * ' ) + PySwitchOdd.append( 'def SwitchOdd(a) : ' ) + PySwitchOdd.append( ' sleep(1) ' ) + PySwitchOdd.append( ' OddEven = 'Odd' ' ) + PySwitchOdd.append( ' if (a&1) == 0 : ' ) + PySwitchOdd.append( ' OddEven = 'Even' ' ) + PySwitchOdd.append( ' return a & 1,1-(a&1),a,OddEven ' ) + SwitchOdd,EndOfSwitchOdd = GraphLoopSwitchsBranches_1.SNode( 'SwitchOdd' , PySwitchOdd ) + EndOfSwitchOdd.SetName( 'EndOfSwitchOdd' ) + EndOfSwitchOdd.SetAuthor( '' ) + EndOfSwitchOdd.SetComment( 'Compute Node' ) + EndOfSwitchOdd.Coords( 715 , 208 ) + PyEndOfSwitchOdd = [] + PyEndOfSwitchOdd.append( 'from time import * ' ) + PyEndOfSwitchOdd.append( 'def EndOfSwitchOdd(a,Odd,Even,OddEven) : ' ) + PyEndOfSwitchOdd.append( ' sleep(1) ' ) + PyEndOfSwitchOdd.append( ' return a,Odd ' ) + EndOfSwitchOdd.SetPyFunction( 'EndOfSwitchOdd' , PyEndOfSwitchOdd ) + IEndOfSwitchOdda = EndOfSwitchOdd.InPort( 'a' , 'long' ) + IEndOfSwitchOddOdd = EndOfSwitchOdd.InPort( 'Odd' , 'boolean' ) + IEndOfSwitchOddEven = EndOfSwitchOdd.InPort( 'Even' , 'long' ) + IEndOfSwitchOddOddEven = EndOfSwitchOdd.InPort( 'OddEven' , 'boolean' ) + IEndOfSwitchOddDefault = EndOfSwitchOdd.GetInPort( 'Default' ) + OEndOfSwitchOdda = EndOfSwitchOdd.OutPort( 'a' , 'long' ) + OEndOfSwitchOddOdd = EndOfSwitchOdd.OutPort( 'Odd' , 'boolean' ) + OEndOfSwitchOddGate = EndOfSwitchOdd.GetOutPort( 'Gate' ) + SwitchOdd.SetName( 'SwitchOdd' ) + SwitchOdd.SetAuthor( '' ) + SwitchOdd.SetComment( 'Compute Node' ) + SwitchOdd.Coords( 241 , 208 ) + ISwitchOdda = SwitchOdd.InPort( 'a' , 'long' ) + ISwitchOddGate = SwitchOdd.GetInPort( 'Gate' ) + OSwitchOddOdd = SwitchOdd.OutPort( 'Odd' , 'long' ) + OSwitchOddEven = SwitchOdd.OutPort( 'Even' , 'int' ) + OSwitchOdda = SwitchOdd.OutPort( 'a' , 'int' ) + OSwitchOddOddEven = SwitchOdd.OutPort( 'OddEven' , 'string' ) + OSwitchOddDefault = SwitchOdd.GetOutPort( 'Default' ) + + PySwitchEven = [] + PySwitchEven.append( 'from time import * ' ) + PySwitchEven.append( 'def SwitchEven(a) : ' ) + PySwitchEven.append( ' sleep(1) ' ) + PySwitchEven.append( ' OddEven = 'Even' ' ) + PySwitchEven.append( ' if (a&1) != 0 : ' ) + PySwitchEven.append( ' OddEven = 'Odd' ' ) + PySwitchEven.append( ' return a & 1,1-(a&1),a,OddEven ' ) + SwitchEven,EndOfSwitchEven = GraphLoopSwitchsBranches_1.SNode( 'SwitchEven' , PySwitchEven ) + EndOfSwitchEven.SetName( 'EndOfSwitchEven' ) + EndOfSwitchEven.SetAuthor( '' ) + EndOfSwitchEven.SetComment( 'Compute Node' ) + EndOfSwitchEven.Coords( 722 , 425 ) + PyEndOfSwitchEven = [] + PyEndOfSwitchEven.append( 'from time import * ' ) + PyEndOfSwitchEven.append( 'def EndOfSwitchEven(a,Even,Odd,OddEven) : ' ) + PyEndOfSwitchEven.append( ' sleep(1) ' ) + PyEndOfSwitchEven.append( ' return a,Even ' ) + EndOfSwitchEven.SetPyFunction( 'EndOfSwitchEven' , PyEndOfSwitchEven ) + IEndOfSwitchEvena = EndOfSwitchEven.InPort( 'a' , 'long' ) + IEndOfSwitchEvenEven = EndOfSwitchEven.InPort( 'Even' , 'boolean' ) + IEndOfSwitchEvenOdd = EndOfSwitchEven.InPort( 'Odd' , 'long' ) + IEndOfSwitchEvenOddEven = EndOfSwitchEven.InPort( 'OddEven' , 'string' ) + IEndOfSwitchEvenDefault = EndOfSwitchEven.GetInPort( 'Default' ) + OEndOfSwitchEvena = EndOfSwitchEven.OutPort( 'a' , 'long' ) + OEndOfSwitchEvenEven = EndOfSwitchEven.OutPort( 'Even' , 'boolean' ) + OEndOfSwitchEvenGate = EndOfSwitchEven.GetOutPort( 'Gate' ) + SwitchEven.SetName( 'SwitchEven' ) + SwitchEven.SetAuthor( '' ) + SwitchEven.SetComment( 'Compute Node' ) + SwitchEven.Coords( 228 , 425 ) + ISwitchEvena = SwitchEven.InPort( 'a' , 'long' ) + ISwitchEvenGate = SwitchEven.GetInPort( 'Gate' ) + OSwitchEvenOdd = SwitchEven.OutPort( 'Odd' , 'long' ) + OSwitchEvenEven = SwitchEven.OutPort( 'Even' , 'int' ) + OSwitchEvena = SwitchEven.OutPort( 'a' , 'int' ) + OSwitchEvenOddEven = SwitchEven.OutPort( 'OddEven' , 'string' ) + OSwitchEvenDefault = SwitchEven.GetOutPort( 'Default' ) + + # Creation of Links + LIsOddaEndOfSwitchOdda = GraphLoopSwitchsBranches_1.Link( OIsOdda , IEndOfSwitchOdda ) + + LIsOddOddEndOfSwitchOddOdd = GraphLoopSwitchsBranches_1.Link( OIsOddOdd , IEndOfSwitchOddOdd ) + + LSwitchOddOddIsOddGate = GraphLoopSwitchsBranches_1.Link( OSwitchOddOdd , IIsOddGate ) + + LSwitchOddEvenIsNotOddEven = GraphLoopSwitchsBranches_1.Link( OSwitchOddEven , IIsNotOddEven ) + + LSwitchOddaIsOdda = GraphLoopSwitchsBranches_1.Link( OSwitchOdda , IIsOdda ) + + LSwitchOddOddEvenEndOfSwitchOddOddEven = GraphLoopSwitchsBranches_1.Link( OSwitchOddOddEven , IEndOfSwitchOddOddEven ) + + LSwitchOddDefaultEndOfSwitchOddDefault = GraphLoopSwitchsBranches_1.Link( OSwitchOddDefault , IEndOfSwitchOddDefault ) + + LEndOfSwitchOddaSwitchsCompareaOdd = GraphLoopSwitchsBranches_1.Link( OEndOfSwitchOdda , ISwitchsCompareaOdd ) + + LEndOfSwitchOddOddSwitchsCompareOdd = GraphLoopSwitchsBranches_1.Link( OEndOfSwitchOddOdd , ISwitchsCompareOdd ) + + LIsEvenaEndOfSwitchEvena = GraphLoopSwitchsBranches_1.Link( OIsEvena , IEndOfSwitchEvena ) + + LIsEvenEvenEndOfSwitchEvenEven = GraphLoopSwitchsBranches_1.Link( OIsEvenEven , IEndOfSwitchEvenEven ) + + LLoopIndexSwitchOdda = GraphLoopSwitchsBranches_1.Link( OLoopIndex , ISwitchOdda ) + + LLoopIndexSwitchEvena = GraphLoopSwitchsBranches_1.Link( OLoopIndex , ISwitchEvena ) + + LLoopIndexSwitchsCompareIndex = GraphLoopSwitchsBranches_1.Link( OLoopIndex , ISwitchsCompareIndex ) + + LLoopMinEndOfLoopMin = GraphLoopSwitchsBranches_1.Link( OLoopMin , IEndOfLoopMin ) + + LLoopMaxEndOfLoopMax = GraphLoopSwitchsBranches_1.Link( OLoopMax , IEndOfLoopMax ) + + LSwitchEvenOddIsNotEvenOdd = GraphLoopSwitchsBranches_1.Link( OSwitchEvenOdd , IIsNotEvenOdd ) + + LSwitchEvenEvenIsEvenGate = GraphLoopSwitchsBranches_1.Link( OSwitchEvenEven , IIsEvenGate ) + + LSwitchEvenaIsEvena = GraphLoopSwitchsBranches_1.Link( OSwitchEvena , IIsEvena ) + + LSwitchEvenOddEvenEndOfSwitchEvenOddEven = GraphLoopSwitchsBranches_1.Link( OSwitchEvenOddEven , IEndOfSwitchEvenOddEven ) + + LSwitchEvenDefaultEndOfSwitchEvenDefault = GraphLoopSwitchsBranches_1.Link( OSwitchEvenDefault , IEndOfSwitchEvenDefault ) + + LEndOfSwitchEvenaSwitchsCompareaEven = GraphLoopSwitchsBranches_1.Link( OEndOfSwitchEvena , ISwitchsCompareaEven ) + + LEndOfSwitchEvenEvenSwitchsCompareEven = GraphLoopSwitchsBranches_1.Link( OEndOfSwitchEvenEven , ISwitchsCompareEven ) + + LSwitchsCompareIndexEndOfLoopIndex = GraphLoopSwitchsBranches_1.Link( OSwitchsCompareIndex , IEndOfLoopIndex ) + + LIsNotOddEvenEndOfSwitchOddEven = GraphLoopSwitchsBranches_1.Link( OIsNotOddEven , IEndOfSwitchOddEven ) + + LIsNotEvenOddEndOfSwitchEvenOdd = GraphLoopSwitchsBranches_1.Link( OIsNotEvenOdd , IEndOfSwitchEvenOdd ) + + # Input datas + ILoopIndex.Input( 0 ) + ILoopMin.Input( 0 ) + ILoopMax.Input( 23 ) + + # Output Ports of the graph + #OEndOfLoopIndex = EndOfLoop.GetOutPort( 'Index' ) + #OEndOfLoopMin = EndOfLoop.GetOutPort( 'Min' ) + #OEndOfLoopMax = EndOfLoop.GetOutPort( 'Max' ) + return GraphLoopSwitchsBranches_1 + + +GraphLoopSwitchsBranches_1 = DefGraphLoopSwitchsBranches_1() diff --git a/examples/GraphLoopSwitchsBranches.xml b/examples/GraphLoopSwitchsBranches.xml new file mode 100644 index 0000000..293e2cd --- /dev/null +++ b/examples/GraphLoopSwitchsBranches.xml @@ -0,0 +1,692 @@ + + + + + +? + ? + GraphLoopSwitchsBranches_1 + 1 + ? + +GraphLoopSwitchsBranches_1 + + +long + Loop__Index + +long + Loop__Min + +long + Loop__Max + + +long + EndOfLoop__Index + +long + EndOfLoop__Min + +long + EndOfLoop__Max + + + 14/10/2003 - 10:29:4 + 11/2/2005 - 17:27:23 + 1.05 + JR + ? + ? + 0 + 0 + + +? + ? + IsOdd + 3 + ? + +IsOdd + + +long + a + + +long + a + +long + Odd + + + +IsOdd + + + + + + 11/2/2005 - 17:27:23 + 11/2/2005 - 17:27:23 + 1.05 + ? + ? + Python function + 476 + 2 + +? + ? + SwitchOdd + 6 + EndOfSwitchOdd + +SwitchOdd + + +long + a + + +long + Odd + +int + Even + +int + a + +string + OddEven + + + +SwitchOdd + + + + + + + + 11/2/2005 - 17:27:23 + 11/2/2005 - 17:27:23 + 1.05 + ? + ? + Compute Node + 241 + 208 + +? + ? + EndOfSwitchOdd + 7 + SwitchOdd + +EndOfSwitchOdd + + +long + a + +boolean + Odd + +long + Even + +boolean + OddEven + + +long + a + +boolean + Odd + + + +EndOfSwitchOdd + + + + + 11/2/2005 - 17:27:23 + 11/2/2005 - 17:27:23 + 1.05 + ? + ? + Compute Node + 715 + 208 + +? + ? + IsEven + 3 + ? + +IsEven + + +long + a + + +long + a + +long + Even + + + +IsEven + + + + + + 11/2/2005 - 17:27:23 + 11/2/2005 - 17:27:23 + 1.05 + ? + ? + Python function + 472 + 724 + +? + ? + Loop + 4 + EndOfLoop + +Loop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +InitLoop + + + +MoreLoop + + + + + + + +NextLoop + + + + 11/2/2005 - 17:27:23 + 11/2/2005 - 17:27:23 + 1.05 + ? + ? + Compute Node + 19 + 341 + +? + ? + EndOfLoop + 5 + Loop + +EndOfLoop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +? + + 11/2/2005 - 17:27:23 + 11/2/2005 - 17:27:23 + 1.05 + ? + ? + Compute Node + 1099 + 261 + +? + ? + SwitchEven + 6 + EndOfSwitchEven + +SwitchEven + + +long + a + + +long + Odd + +int + Even + +int + a + +string + OddEven + + + +SwitchEven + + + + + + + + 11/2/2005 - 17:27:23 + 11/2/2005 - 17:27:23 + 1.05 + ? + ? + Compute Node + 228 + 425 + +? + ? + EndOfSwitchEven + 7 + SwitchEven + +EndOfSwitchEven + + +long + a + +boolean + Even + +long + Odd + +string + OddEven + + +long + a + +boolean + Even + + + +EndOfSwitchEven + + + + + 11/2/2005 - 17:27:23 + 11/2/2005 - 17:27:23 + 1.05 + ? + ? + Compute Node + 722 + 425 + +? + ? + SwitchsCompare + 3 + ? + +SwitchsCompare + + +long + aOdd + +boolean + Odd + +long + aEven + +boolean + Even + +long + Index + + +long + Index + + + +SwitchsCompare + + + + + 11/2/2005 - 17:27:23 + 11/2/2005 - 17:27:23 + 2.0 + ? + ? + Compute Node + 918 + 221 + +? + ? + IsNotOdd + 3 + ? + +IsNotOdd + + +long + Even + + +long + Even + + + +IsNotOdd + + + + + 11/2/2005 - 17:27:23 + 11/2/2005 - 17:27:23 + 2.0 + ? + ? + Compute Node + 477 + 145 + +? + ? + IsNotEven + 3 + ? + +IsNotEven + + +long + Odd + + +long + Odd + + + +IsNotEven + + + + + 11/2/2005 - 17:27:23 + 11/2/2005 - 17:27:23 + 2.0 + ? + ? + Compute Node + 477 + 570 + + +IsOdd + a + EndOfSwitchOdd + a + + +IsOdd + Odd + EndOfSwitchOdd + Odd + + +SwitchOdd + Odd + IsOdd + Gate + + +SwitchOdd + Even + IsNotOdd + Even + + +SwitchOdd + a + IsOdd + a + + +SwitchOdd + OddEven + EndOfSwitchOdd + OddEven + + +SwitchOdd + Default + EndOfSwitchOdd + Default + + +EndOfSwitchOdd + a + SwitchsCompare + aOdd + + +EndOfSwitchOdd + Odd + SwitchsCompare + Odd + + +IsEven + a + EndOfSwitchEven + a + + +IsEven + Even + EndOfSwitchEven + Even + + +Loop + DoLoop + EndOfLoop + DoLoop + + +Loop + Index + SwitchOdd + a + + +Loop + Index + SwitchEven + a + + +Loop + Index + SwitchsCompare + Index + + +Loop + Min + EndOfLoop + Min + + +Loop + Max + EndOfLoop + Max + + +EndOfLoop + DoLoop + Loop + DoLoop + + +SwitchEven + Odd + IsNotEven + Odd + + +SwitchEven + Even + IsEven + Gate + + +SwitchEven + a + IsEven + a + + +SwitchEven + OddEven + EndOfSwitchEven + OddEven + + +SwitchEven + Default + EndOfSwitchEven + Default + + +EndOfSwitchEven + a + SwitchsCompare + aEven + + +EndOfSwitchEven + Even + SwitchsCompare + Even + + +SwitchsCompare + Index + EndOfLoop + Index + + +IsNotOdd + Even + EndOfSwitchOdd + Even + + +IsNotEven + Odd + EndOfSwitchEven + Odd + + + +GraphLoopSwitchsBranches_1 + Loop__Index + Loop + Index + +3 + 0 + + +GraphLoopSwitchsBranches_1 + Loop__Min + Loop + Min + +3 + 0 + + +GraphLoopSwitchsBranches_1 + Loop__Max + Loop + Max + +3 + 23 + diff --git a/examples/GraphLoopSwitchsBranchesDefaultAborted.py b/examples/GraphLoopSwitchsBranchesDefaultAborted.py new file mode 100644 index 0000000..8591848 --- /dev/null +++ b/examples/GraphLoopSwitchsBranchesDefaultAborted.py @@ -0,0 +1,346 @@ + +# Generated python file of Graph GraphLoopSwitchsBranchesdefaultAborted + +from SuperV import * + +# Graph creation of GraphLoopSwitchsBranchesdefaultAborted +def DefGraphLoopSwitchsBranchesdefaultAborted() : + GraphLoopSwitchsBranchesdefaultAborted = Graph( 'GraphLoopSwitchsBranchesdefaultAborted' ) + GraphLoopSwitchsBranchesdefaultAborted.SetName( 'GraphLoopSwitchsBranchesdefaultAborted' ) + GraphLoopSwitchsBranchesdefaultAborted.SetAuthor( 'JR' ) + GraphLoopSwitchsBranchesdefaultAborted.SetComment( '' ) + GraphLoopSwitchsBranchesdefaultAborted.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsOdd = [] + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd(a) : ' ) + PyIsOdd.append( ' print a,"IsOdd" ' ) + PyIsOdd.append( ' sleep( 1 ) ' ) + PyIsOdd.append( ' return a,1 ' ) + IsOdd = GraphLoopSwitchsBranchesdefaultAborted.INode( 'IsOdd' , PyIsOdd ) + IsOdd.SetName( 'IsOdd' ) + IsOdd.SetAuthor( '' ) + IsOdd.SetComment( 'Python function' ) + IsOdd.Coords( 476 , 2 ) + IIsOdda = IsOdd.InPort( 'a' , 'long' ) + IIsOddGate = IsOdd.GetInPort( 'Gate' ) + OIsOdda = IsOdd.OutPort( 'a' , 'long' ) + OIsOddOdd = IsOdd.OutPort( 'Odd' , 'long' ) + OIsOddGate = IsOdd.GetOutPort( 'Gate' ) + + PyIsEven = [] + PyIsEven.append( 'from time import * ' ) + PyIsEven.append( 'def IsEven(a) : ' ) + PyIsEven.append( ' print a,"IsEven" ' ) + PyIsEven.append( ' sleep( 1 ) ' ) + PyIsEven.append( ' return a,1 ' ) + IsEven = GraphLoopSwitchsBranchesdefaultAborted.INode( 'IsEven' , PyIsEven ) + IsEven.SetName( 'IsEven' ) + IsEven.SetAuthor( '' ) + IsEven.SetComment( 'Python function' ) + IsEven.Coords( 472 , 724 ) + IIsEvena = IsEven.InPort( 'a' , 'long' ) + IIsEvenGate = IsEven.GetInPort( 'Gate' ) + OIsEvena = IsEven.OutPort( 'a' , 'long' ) + OIsEvenEven = IsEven.OutPort( 'Even' , 'long' ) + OIsEvenGate = IsEven.GetOutPort( 'Gate' ) + + PySwitchsCompare = [] + PySwitchsCompare.append( 'from time import * ' ) + PySwitchsCompare.append( 'def SwitchsCompare(aOdd,Odd,aEven,Even,Index) : ' ) + PySwitchsCompare.append( ' sleep(1) ' ) + PySwitchsCompare.append( ' return Index ' ) + SwitchsCompare = GraphLoopSwitchsBranchesdefaultAborted.INode( 'SwitchsCompare' , PySwitchsCompare ) + SwitchsCompare.SetName( 'SwitchsCompare' ) + SwitchsCompare.SetAuthor( '' ) + SwitchsCompare.SetComment( 'Compute Node' ) + SwitchsCompare.Coords( 916 , 269 ) + ISwitchsCompareaOdd = SwitchsCompare.InPort( 'aOdd' , 'long' ) + ISwitchsCompareOdd = SwitchsCompare.InPort( 'Odd' , 'boolean' ) + ISwitchsCompareaEven = SwitchsCompare.InPort( 'aEven' , 'long' ) + ISwitchsCompareEven = SwitchsCompare.InPort( 'Even' , 'boolean' ) + ISwitchsCompareIndex = SwitchsCompare.InPort( 'Index' , 'long' ) + ISwitchsCompareGate = SwitchsCompare.GetInPort( 'Gate' ) + OSwitchsCompareIndex = SwitchsCompare.OutPort( 'Index' , 'long' ) + OSwitchsCompareGate = SwitchsCompare.GetOutPort( 'Gate' ) + + PyIsNotOdd = [] + PyIsNotOdd.append( 'from time import * ' ) + PyIsNotOdd.append( 'def IsNotOdd(Even) : ' ) + PyIsNotOdd.append( ' sleep(1) ' ) + PyIsNotOdd.append( ' return Even ' ) + IsNotOdd = GraphLoopSwitchsBranchesdefaultAborted.INode( 'IsNotOdd' , PyIsNotOdd ) + IsNotOdd.SetName( 'IsNotOdd' ) + IsNotOdd.SetAuthor( '' ) + IsNotOdd.SetComment( 'Compute Node' ) + IsNotOdd.Coords( 477 , 137 ) + IIsNotOddEven = IsNotOdd.InPort( 'Even' , 'long' ) + IIsNotOddGate = IsNotOdd.GetInPort( 'Gate' ) + OIsNotOddEven = IsNotOdd.OutPort( 'Even' , 'long' ) + OIsNotOddGate = IsNotOdd.GetOutPort( 'Gate' ) + + PyIsNotEven = [] + PyIsNotEven.append( 'from time import * ' ) + PyIsNotEven.append( 'def IsNotEven(Odd) : ' ) + PyIsNotEven.append( ' sleep(1) ' ) + PyIsNotEven.append( ' return Odd ' ) + IsNotEven = GraphLoopSwitchsBranchesdefaultAborted.INode( 'IsNotEven' , PyIsNotEven ) + IsNotEven.SetName( 'IsNotEven' ) + IsNotEven.SetAuthor( '' ) + IsNotEven.SetComment( 'Compute Node' ) + IsNotEven.Coords( 475 , 601 ) + IIsNotEvenOdd = IsNotEven.InPort( 'Odd' , 'long' ) + IIsNotEvenGate = IsNotEven.GetInPort( 'Gate' ) + OIsNotEvenOdd = IsNotEven.OutPort( 'Odd' , 'long' ) + OIsNotEvenGate = IsNotEven.GetOutPort( 'Gate' ) + + PyIsOdddefault = [] + PyIsOdddefault.append( 'from time import * ' ) + PyIsOdddefault.append( 'def IsOdddefault(a) : ' ) + PyIsOdddefault.append( ' sleep(1) ' ) + PyIsOdddefault.append( ' return a,0 ' ) + PyIsOdddefault.append( '' ) + IsOdddefault = GraphLoopSwitchsBranchesdefaultAborted.INode( 'IsOdddefault' , PyIsOdddefault ) + IsOdddefault.SetName( 'IsOdddefault' ) + IsOdddefault.SetAuthor( '' ) + IsOdddefault.SetComment( 'Compute Node' ) + IsOdddefault.Coords( 477 , 285 ) + IIsOdddefaulta = IsOdddefault.InPort( 'a' , 'long' ) + IIsOdddefaultGate = IsOdddefault.GetInPort( 'Gate' ) + OIsOdddefaulta = IsOdddefault.OutPort( 'a' , 'long' ) + OIsOdddefaultOdd = IsOdddefault.OutPort( 'Odd' , 'long' ) + OIsOdddefaultGate = IsOdddefault.GetOutPort( 'Gate' ) + + PyIsEvendefault = [] + PyIsEvendefault.append( 'from time import * ' ) + PyIsEvendefault.append( 'def IsEvendefault(a) : ' ) + PyIsEvendefault.append( ' sleep(1) ' ) + PyIsEvendefault.append( ' return a,0 ' ) + PyIsEvendefault.append( '' ) + IsEvendefault = GraphLoopSwitchsBranchesdefaultAborted.INode( 'IsEvendefault' , PyIsEvendefault ) + IsEvendefault.SetName( 'IsEvendefault' ) + IsEvendefault.SetAuthor( '' ) + IsEvendefault.SetComment( 'Compute Node' ) + IsEvendefault.Coords( 478 , 434 ) + IIsEvendefaulta = IsEvendefault.InPort( 'a' , 'long' ) + IIsEvendefaultGate = IsEvendefault.GetInPort( 'Gate' ) + OIsEvendefaulta = IsEvendefault.OutPort( 'a' , 'long' ) + OIsEvendefaultEven = IsEvendefault.OutPort( 'Even' , 'long' ) + OIsEvendefaultGate = IsEvendefault.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyLoop = [] + PyLoop.append( 'def InitLoop(Index,Min,Max) : ' ) + PyLoop.append( ' Index = Max ' ) + PyLoop.append( ' return Index,Min,Max ' ) + PyMoreLoop = [] + PyMoreLoop.append( 'def MoreLoop(Index,Min,Max) : ' ) + PyMoreLoop.append( ' if Index >= Min : ' ) + PyMoreLoop.append( ' DoLoop = 1 ' ) + PyMoreLoop.append( ' else : ' ) + PyMoreLoop.append( ' DoLoop = 0 ' ) + PyMoreLoop.append( ' return DoLoop,Index,Min,Max ' ) + PyNextLoop = [] + PyNextLoop.append( 'def NextLoop(Index,Min,Max) : ' ) + PyNextLoop.append( ' Index = Index - 1 ' ) + PyNextLoop.append( ' return Index,Min,Max ' ) + Loop,EndOfLoop = GraphLoopSwitchsBranchesdefaultAborted.LNode( 'InitLoop' , PyLoop , 'MoreLoop' , PyMoreLoop , 'NextLoop' , PyNextLoop ) + EndOfLoop.SetName( 'EndOfLoop' ) + EndOfLoop.SetAuthor( '' ) + EndOfLoop.SetComment( 'Compute Node' ) + EndOfLoop.Coords( 1097 , 309 ) + PyEndOfLoop = [] + EndOfLoop.SetPyFunction( '' , PyEndOfLoop ) + ILoopDoLoop = Loop.GetInPort( 'DoLoop' ) + ILoopIndex = Loop.InPort( 'Index' , 'long' ) + ILoopMin = Loop.InPort( 'Min' , 'long' ) + ILoopMax = Loop.InPort( 'Max' , 'long' ) + ILoopGate = Loop.GetInPort( 'Gate' ) + OLoopDoLoop = Loop.GetOutPort( 'DoLoop' ) + OLoopIndex = Loop.GetOutPort( 'Index' ) + OLoopMin = Loop.GetOutPort( 'Min' ) + OLoopMax = Loop.GetOutPort( 'Max' ) + IEndOfLoopDoLoop = EndOfLoop.GetInPort( 'DoLoop' ) + IEndOfLoopIndex = EndOfLoop.GetInPort( 'Index' ) + IEndOfLoopMin = EndOfLoop.GetInPort( 'Min' ) + IEndOfLoopMax = EndOfLoop.GetInPort( 'Max' ) + IEndOfLoopGate = EndOfLoop.GetInPort( 'Gate' ) + OEndOfLoopDoLoop = EndOfLoop.GetOutPort( 'DoLoop' ) + OEndOfLoopIndex = EndOfLoop.GetOutPort( 'Index' ) + OEndOfLoopMin = EndOfLoop.GetOutPort( 'Min' ) + OEndOfLoopMax = EndOfLoop.GetOutPort( 'Max' ) + OEndOfLoopGate = EndOfLoop.GetOutPort( 'Gate' ) + Loop.SetName( 'Loop' ) + Loop.SetAuthor( '' ) + Loop.SetComment( 'Compute Node' ) + Loop.Coords( 18 , 389 ) + + # Creation of Switch Nodes + PySwitchOdd = [] + PySwitchOdd.append( 'from time import * ' ) + PySwitchOdd.append( 'def SwitchOdd(a) : ' ) + PySwitchOdd.append( ' sleep(1) ' ) + PySwitchOdd.append( ' if a <= 0 : ' ) + PySwitchOdd.append( ' OddEven = '<=0' ' ) + PySwitchOdd.append( ' return 0,0,0,a,OddEven ' ) + PySwitchOdd.append( ' OddEven = 'Odd' ' ) + PySwitchOdd.append( ' if (a&1) == 0 : ' ) + PySwitchOdd.append( ' OddEven = 'Even' ' ) + PySwitchOdd.append( ' return a & 1,1-(a&1),1-(a&1),a,OddEven ' ) + SwitchOdd,EndOfSwitchOdd = GraphLoopSwitchsBranchesdefaultAborted.SNode( 'SwitchOdd' , PySwitchOdd ) + EndOfSwitchOdd.SetName( 'EndOfSwitchOdd' ) + EndOfSwitchOdd.SetAuthor( '' ) + EndOfSwitchOdd.SetComment( 'Compute Node' ) + EndOfSwitchOdd.Coords( 718 , 162 ) + PyEndOfSwitchOdd = [] + PyEndOfSwitchOdd.append( 'from time import * ' ) + PyEndOfSwitchOdd.append( 'def EndOfSwitchOdd(a,Odd,Even,OddEven) : ' ) + PyEndOfSwitchOdd.append( ' sleep(1) ' ) + PyEndOfSwitchOdd.append( ' return a,Odd ' ) + EndOfSwitchOdd.SetPyFunction( 'EndOfSwitchOdd' , PyEndOfSwitchOdd ) + IEndOfSwitchOdda = EndOfSwitchOdd.InPort( 'a' , 'long' ) + IEndOfSwitchOddOdd = EndOfSwitchOdd.InPort( 'Odd' , 'boolean' ) + IEndOfSwitchOddEven = EndOfSwitchOdd.InPort( 'Even' , 'long' ) + IEndOfSwitchOddOddEven = EndOfSwitchOdd.InPort( 'OddEven' , 'boolean' ) + IEndOfSwitchOddDefault = EndOfSwitchOdd.GetInPort( 'Default' ) + OEndOfSwitchOdda = EndOfSwitchOdd.OutPort( 'a' , 'long' ) + OEndOfSwitchOddOdd = EndOfSwitchOdd.OutPort( 'Odd' , 'boolean' ) + OEndOfSwitchOddGate = EndOfSwitchOdd.GetOutPort( 'Gate' ) + SwitchOdd.SetName( 'SwitchOdd' ) + SwitchOdd.SetAuthor( '' ) + SwitchOdd.SetComment( 'Compute Node' ) + SwitchOdd.Coords( 240 , 142 ) + ISwitchOdda = SwitchOdd.InPort( 'a' , 'long' ) + ISwitchOddGate = SwitchOdd.GetInPort( 'Gate' ) + OSwitchOddOdd = SwitchOdd.OutPort( 'Odd' , 'long' ) + OSwitchOddEven = SwitchOdd.OutPort( 'Even' , 'int' ) + OSwitchOdddefault = SwitchOdd.OutPort( 'default' , 'long' ) + OSwitchOdda = SwitchOdd.OutPort( 'a' , 'long' ) + OSwitchOddOddEven = SwitchOdd.OutPort( 'OddEven' , 'string' ) + OSwitchOddDefault = SwitchOdd.GetOutPort( 'Default' ) + + PySwitchEven = [] + PySwitchEven.append( 'from time import * ' ) + PySwitchEven.append( 'def SwitchEven(a) : ' ) + PySwitchEven.append( ' sleep(1) ' ) + PySwitchEven.append( ' if a <= 0 : ' ) + PySwitchEven.append( ' OddEven = '<=0' ' ) + PySwitchEven.append( ' return 0,0,0,a,OddEven ' ) + PySwitchEven.append( ' OddEven = 'Even' ' ) + PySwitchEven.append( ' if (a&1) != 0 : ' ) + PySwitchEven.append( ' OddEven = 'Odd' ' ) + PySwitchEven.append( ' print (a&1),1-(a&1),(a&1),a,OddEven ' ) + PySwitchEven.append( ' return (a&1),1-(a&1),(a&1),a,OddEven ' ) + SwitchEven,EndOfSwitchEven = GraphLoopSwitchsBranchesdefaultAborted.SNode( 'SwitchEven' , PySwitchEven ) + EndOfSwitchEven.SetName( 'EndOfSwitchEven' ) + EndOfSwitchEven.SetAuthor( '' ) + EndOfSwitchEven.SetComment( 'Compute Node' ) + EndOfSwitchEven.Coords( 721 , 477 ) + PyEndOfSwitchEven = [] + PyEndOfSwitchEven.append( 'from time import * ' ) + PyEndOfSwitchEven.append( 'def EndOfSwitchEven(a,Even,Odd,OddEven) : ' ) + PyEndOfSwitchEven.append( ' sleep(1) ' ) + PyEndOfSwitchEven.append( ' return a,Even ' ) + EndOfSwitchEven.SetPyFunction( 'EndOfSwitchEven' , PyEndOfSwitchEven ) + IEndOfSwitchEvena = EndOfSwitchEven.InPort( 'a' , 'long' ) + IEndOfSwitchEvenEven = EndOfSwitchEven.InPort( 'Even' , 'boolean' ) + IEndOfSwitchEvenOdd = EndOfSwitchEven.InPort( 'Odd' , 'long' ) + IEndOfSwitchEvenOddEven = EndOfSwitchEven.InPort( 'OddEven' , 'string' ) + IEndOfSwitchEvenDefault = EndOfSwitchEven.GetInPort( 'Default' ) + OEndOfSwitchEvena = EndOfSwitchEven.OutPort( 'a' , 'long' ) + OEndOfSwitchEvenEven = EndOfSwitchEven.OutPort( 'Even' , 'boolean' ) + OEndOfSwitchEvenGate = EndOfSwitchEven.GetOutPort( 'Gate' ) + SwitchEven.SetName( 'SwitchEven' ) + SwitchEven.SetAuthor( '' ) + SwitchEven.SetComment( 'Compute Node' ) + SwitchEven.Coords( 230 , 457 ) + ISwitchEvena = SwitchEven.InPort( 'a' , 'long' ) + ISwitchEvenGate = SwitchEven.GetInPort( 'Gate' ) + OSwitchEvenOdd = SwitchEven.OutPort( 'Odd' , 'long' ) + OSwitchEvenEven = SwitchEven.OutPort( 'Even' , 'int' ) + OSwitchEvendefault = SwitchEven.OutPort( 'default' , 'long' ) + OSwitchEvena = SwitchEven.OutPort( 'a' , 'int' ) + OSwitchEvenOddEven = SwitchEven.OutPort( 'OddEven' , 'string' ) + OSwitchEvenDefault = SwitchEven.GetOutPort( 'Default' ) + + # Creation of Links + LIsOddaEndOfSwitchOdda = GraphLoopSwitchsBranchesdefaultAborted.Link( OIsOdda , IEndOfSwitchOdda ) + + LIsOddOddEndOfSwitchOddOdd = GraphLoopSwitchsBranchesdefaultAborted.Link( OIsOddOdd , IEndOfSwitchOddOdd ) + + LSwitchOddOddIsOddGate = GraphLoopSwitchsBranchesdefaultAborted.Link( OSwitchOddOdd , IIsOddGate ) + + LSwitchOddEvenIsNotOddEven = GraphLoopSwitchsBranchesdefaultAborted.Link( OSwitchOddEven , IIsNotOddEven ) + + LSwitchOdddefaultIsOdddefaultGate = GraphLoopSwitchsBranchesdefaultAborted.Link( OSwitchOdddefault , IIsOdddefaultGate ) + + LSwitchOddaIsOdddefaulta = GraphLoopSwitchsBranchesdefaultAborted.Link( OSwitchOdda , IIsOdddefaulta ) + + LSwitchOddaIsOdda = GraphLoopSwitchsBranchesdefaultAborted.Link( OSwitchOdda , IIsOdda ) + + LSwitchOddOddEvenEndOfSwitchOddOddEven = GraphLoopSwitchsBranchesdefaultAborted.Link( OSwitchOddOddEven , IEndOfSwitchOddOddEven ) + + LEndOfSwitchOddaSwitchsCompareaOdd = GraphLoopSwitchsBranchesdefaultAborted.Link( OEndOfSwitchOdda , ISwitchsCompareaOdd ) + + LEndOfSwitchOddOddSwitchsCompareOdd = GraphLoopSwitchsBranchesdefaultAborted.Link( OEndOfSwitchOddOdd , ISwitchsCompareOdd ) + + LIsEvenaEndOfSwitchEvena = GraphLoopSwitchsBranchesdefaultAborted.Link( OIsEvena , IEndOfSwitchEvena ) + + LIsEvenEvenEndOfSwitchEvenEven = GraphLoopSwitchsBranchesdefaultAborted.Link( OIsEvenEven , IEndOfSwitchEvenEven ) + + LLoopIndexSwitchsCompareIndex = GraphLoopSwitchsBranchesdefaultAborted.Link( OLoopIndex , ISwitchsCompareIndex ) + + LLoopIndexSwitchOdda = GraphLoopSwitchsBranchesdefaultAborted.Link( OLoopIndex , ISwitchOdda ) + + LLoopIndexSwitchEvena = GraphLoopSwitchsBranchesdefaultAborted.Link( OLoopIndex , ISwitchEvena ) + + LLoopMinEndOfLoopMin = GraphLoopSwitchsBranchesdefaultAborted.Link( OLoopMin , IEndOfLoopMin ) + + LLoopMaxEndOfLoopMax = GraphLoopSwitchsBranchesdefaultAborted.Link( OLoopMax , IEndOfLoopMax ) + + LSwitchEvenOddIsNotEvenOdd = GraphLoopSwitchsBranchesdefaultAborted.Link( OSwitchEvenOdd , IIsNotEvenOdd ) + + LSwitchEvenEvenIsEvenGate = GraphLoopSwitchsBranchesdefaultAborted.Link( OSwitchEvenEven , IIsEvenGate ) + + LSwitchEvendefaultIsEvendefaultGate = GraphLoopSwitchsBranchesdefaultAborted.Link( OSwitchEvendefault , IIsEvendefaultGate ) + + LSwitchEvenaIsEvena = GraphLoopSwitchsBranchesdefaultAborted.Link( OSwitchEvena , IIsEvena ) + + LSwitchEvenaIsEvendefaulta = GraphLoopSwitchsBranchesdefaultAborted.Link( OSwitchEvena , IIsEvendefaulta ) + + LSwitchEvenOddEvenEndOfSwitchEvenOddEven = GraphLoopSwitchsBranchesdefaultAborted.Link( OSwitchEvenOddEven , IEndOfSwitchEvenOddEven ) + + LEndOfSwitchEvenaSwitchsCompareaEven = GraphLoopSwitchsBranchesdefaultAborted.Link( OEndOfSwitchEvena , ISwitchsCompareaEven ) + + LEndOfSwitchEvenEvenSwitchsCompareEven = GraphLoopSwitchsBranchesdefaultAborted.Link( OEndOfSwitchEvenEven , ISwitchsCompareEven ) + + LSwitchsCompareIndexEndOfLoopIndex = GraphLoopSwitchsBranchesdefaultAborted.Link( OSwitchsCompareIndex , IEndOfLoopIndex ) + + LIsNotOddEvenEndOfSwitchOddEven = GraphLoopSwitchsBranchesdefaultAborted.Link( OIsNotOddEven , IEndOfSwitchOddEven ) + + LIsNotEvenOddEndOfSwitchEvenOdd = GraphLoopSwitchsBranchesdefaultAborted.Link( OIsNotEvenOdd , IEndOfSwitchEvenOdd ) + + LIsOdddefaultaEndOfSwitchOdda = GraphLoopSwitchsBranchesdefaultAborted.Link( OIsOdddefaulta , IEndOfSwitchOdda ) + + LIsOdddefaultOddEndOfSwitchOddOdd = GraphLoopSwitchsBranchesdefaultAborted.Link( OIsOdddefaultOdd , IEndOfSwitchOddOdd ) + + LIsEvendefaultaEndOfSwitchEvena = GraphLoopSwitchsBranchesdefaultAborted.Link( OIsEvendefaulta , IEndOfSwitchEvena ) + + LIsEvendefaultEvenEndOfSwitchEvenEven = GraphLoopSwitchsBranchesdefaultAborted.Link( OIsEvendefaultEven , IEndOfSwitchEvenEven ) + + # Input datas + ILoopIndex.Input( 0 ) + ILoopMin.Input( -5 ) + ILoopMax.Input( 11 ) + + # Output Ports of the graph + #OEndOfLoopIndex = EndOfLoop.GetOutPort( 'Index' ) + #OEndOfLoopMin = EndOfLoop.GetOutPort( 'Min' ) + #OEndOfLoopMax = EndOfLoop.GetOutPort( 'Max' ) + return GraphLoopSwitchsBranchesdefaultAborted + + +GraphLoopSwitchsBranchesdefaultAborted = DefGraphLoopSwitchsBranchesdefaultAborted() diff --git a/examples/GraphLoopSwitchsBranchesDefaultAborted.xml b/examples/GraphLoopSwitchsBranchesDefaultAborted.xml new file mode 100644 index 0000000..ee1f2b3 --- /dev/null +++ b/examples/GraphLoopSwitchsBranchesDefaultAborted.xml @@ -0,0 +1,814 @@ + + + + + +? + ? + GraphLoopSwitchsBranchesdefaultAborted + 1 + ? + +GraphLoopSwitchsBranchesdefault + + +long + Loop__Index + +long + Loop__Min + +long + Loop__Max + + +long + EndOfLoop__Index + +long + EndOfLoop__Min + +long + EndOfLoop__Max + + + 14/10/2003 - 10:29:4 + 14/2/2005 - 17:10:5 + 1.05 + JR + ? + ? + 0 + 0 + + +? + ? + IsOdd + 3 + ? + +IsOdd + + +long + a + + +long + a + +long + Odd + + + +IsOdd + + + + + + 14/2/2005 - 17:10:5 + 14/2/2005 - 17:10:5 + 1.05 + ? + ? + Python function + 476 + 2 + +? + ? + SwitchOdd + 6 + EndOfSwitchOdd + +SwitchOdd + + +long + a + + +long + Odd + +int + Even + +long + default + +long + a + +string + OddEven + + + +SwitchOdd + + + + + + + + + + + 14/2/2005 - 17:10:5 + 14/2/2005 - 17:10:5 + 1.05 + ? + ? + Compute Node + 240 + 142 + +? + ? + EndOfSwitchOdd + 7 + SwitchOdd + +EndOfSwitchOdd + + +long + a + +boolean + Odd + +long + Even + +boolean + OddEven + + +long + a + +boolean + Odd + + + +EndOfSwitchOdd + + + + + 14/2/2005 - 17:10:5 + 14/2/2005 - 17:10:5 + 1.05 + ? + ? + Compute Node + 718 + 162 + +? + ? + IsEven + 3 + ? + +IsEven + + +long + a + + +long + a + +long + Even + + + +IsEven + + + + + + 14/2/2005 - 17:10:5 + 14/2/2005 - 17:10:5 + 1.05 + ? + ? + Python function + 472 + 724 + +? + ? + Loop + 4 + EndOfLoop + +Loop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +InitLoop + + + + +MoreLoop + + = Min : ]]> + + + + + +NextLoop + + + + 14/2/2005 - 17:10:5 + 14/2/2005 - 17:10:5 + 1.05 + ? + ? + Compute Node + 18 + 389 + +? + ? + EndOfLoop + 5 + Loop + +EndOfLoop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +? + + 14/2/2005 - 17:10:5 + 14/2/2005 - 17:10:5 + 1.05 + ? + ? + Compute Node + 1097 + 309 + +? + ? + SwitchEven + 6 + EndOfSwitchEven + +SwitchEven + + +long + a + + +long + Odd + +int + Even + +long + default + +int + a + +string + OddEven + + + +SwitchEven + + + + + + + + + + + + 14/2/2005 - 17:10:5 + 14/2/2005 - 17:10:5 + 1.05 + ? + ? + Compute Node + 230 + 457 + +? + ? + EndOfSwitchEven + 7 + SwitchEven + +EndOfSwitchEven + + +long + a + +boolean + Even + +long + Odd + +string + OddEven + + +long + a + +boolean + Even + + + +EndOfSwitchEven + + + + + 14/2/2005 - 17:10:5 + 14/2/2005 - 17:10:5 + 1.05 + ? + ? + Compute Node + 721 + 477 + +? + ? + SwitchsCompare + 3 + ? + +SwitchsCompare + + +long + aOdd + +boolean + Odd + +long + aEven + +boolean + Even + +long + Index + + +long + Index + + + +SwitchsCompare + + + + + 14/2/2005 - 17:10:5 + 14/2/2005 - 17:10:5 + 2.0 + ? + ? + Compute Node + 916 + 269 + +? + ? + IsNotOdd + 3 + ? + +IsNotOdd + + +long + Even + + +long + Even + + + +IsNotOdd + + + + + 14/2/2005 - 17:10:5 + 14/2/2005 - 17:10:5 + 2.0 + ? + ? + Compute Node + 477 + 137 + +? + ? + IsNotEven + 3 + ? + +IsNotEven + + +long + Odd + + +long + Odd + + + +IsNotEven + + + + + 14/2/2005 - 17:10:5 + 14/2/2005 - 17:10:5 + 2.0 + ? + ? + Compute Node + 475 + 601 + +? + ? + IsOdddefault + 3 + ? + +IsOdddefault + + +long + a + + +long + a + +long + Odd + + + +IsOdddefault + + + + + + 14/2/2005 - 17:10:5 + 14/2/2005 - 17:10:5 + 2.0 + ? + ? + Compute Node + 477 + 285 + +? + ? + IsEvendefault + 3 + ? + +IsEvendefault + + +long + a + + +long + a + +long + Even + + + +IsEvendefault + + + + + + 14/2/2005 - 17:10:5 + 14/2/2005 - 17:10:5 + 2.0 + ? + ? + Compute Node + 478 + 434 + + +IsOdd + a + EndOfSwitchOdd + a + + +IsOdd + Odd + EndOfSwitchOdd + Odd + + +SwitchOdd + Odd + IsOdd + Gate + + +SwitchOdd + Even + IsNotOdd + Even + + +SwitchOdd + default + IsOdddefault + Gate + + +SwitchOdd + a + IsOdddefault + a + + +SwitchOdd + a + IsOdd + a + + +SwitchOdd + OddEven + EndOfSwitchOdd + OddEven + + +EndOfSwitchOdd + a + SwitchsCompare + aOdd + + +EndOfSwitchOdd + Odd + SwitchsCompare + Odd + + +IsEven + a + EndOfSwitchEven + a + + +IsEven + Even + EndOfSwitchEven + Even + + +Loop + DoLoop + EndOfLoop + DoLoop + + +Loop + Index + SwitchsCompare + Index + + +Loop + Index + SwitchOdd + a + + +Loop + Index + SwitchEven + a + + +Loop + Min + EndOfLoop + Min + + +Loop + Max + EndOfLoop + Max + + +EndOfLoop + DoLoop + Loop + DoLoop + + +SwitchEven + Odd + IsNotEven + Odd + + +SwitchEven + Even + IsEven + Gate + + +SwitchEven + default + IsEvendefault + Gate + + +SwitchEven + a + IsEven + a + + +SwitchEven + a + IsEvendefault + a + + +SwitchEven + OddEven + EndOfSwitchEven + OddEven + + +EndOfSwitchEven + a + SwitchsCompare + aEven + + +EndOfSwitchEven + Even + SwitchsCompare + Even + + +SwitchsCompare + Index + EndOfLoop + Index + + +IsNotOdd + Even + EndOfSwitchOdd + Even + + +IsNotEven + Odd + EndOfSwitchEven + Odd + + +IsOdddefault + a + EndOfSwitchOdd + a + + +IsOdddefault + Odd + EndOfSwitchOdd + Odd + + +IsEvendefault + a + EndOfSwitchEven + a + + +IsEvendefault + Even + EndOfSwitchEven + Even + + + +GraphLoopSwitchsBranchesdefaultAborted + Loop__Index + Loop + Index + +3 + 0 + + +GraphLoopSwitchsBranchesdefaultAborted + Loop__Min + Loop + Min + +3 + -5 + + +GraphLoopSwitchsBranchesdefaultAborted + Loop__Max + Loop + Max + +3 + 11 + diff --git a/examples/GraphLoopSwitchsBranchesdefault.py b/examples/GraphLoopSwitchsBranchesdefault.py new file mode 100644 index 0000000..1af8dd7 --- /dev/null +++ b/examples/GraphLoopSwitchsBranchesdefault.py @@ -0,0 +1,350 @@ + +# Generated python file of Graph GraphLoopSwitchsBranchesdefault + +from SuperV import * + +# Graph creation of GraphLoopSwitchsBranchesdefault +def DefGraphLoopSwitchsBranchesdefault() : + GraphLoopSwitchsBranchesdefault = Graph( 'GraphLoopSwitchsBranchesdefault' ) + GraphLoopSwitchsBranchesdefault.SetName( 'GraphLoopSwitchsBranchesdefault' ) + GraphLoopSwitchsBranchesdefault.SetAuthor( 'JR' ) + GraphLoopSwitchsBranchesdefault.SetComment( '' ) + GraphLoopSwitchsBranchesdefault.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsOdd = [] + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd(a) : ' ) + PyIsOdd.append( ' print a,"IsOdd" ' ) + PyIsOdd.append( ' sleep( 1 ) ' ) + PyIsOdd.append( ' return a,1 ' ) + IsOdd = GraphLoopSwitchsBranchesdefault.INode( 'IsOdd' , PyIsOdd ) + IsOdd.SetName( 'IsOdd' ) + IsOdd.SetAuthor( '' ) + IsOdd.SetComment( 'Python function' ) + IsOdd.Coords( 476 , 2 ) + IIsOdda = IsOdd.InPort( 'a' , 'long' ) + IIsOddGate = IsOdd.GetInPort( 'Gate' ) + OIsOdda = IsOdd.OutPort( 'a' , 'long' ) + OIsOddOdd = IsOdd.OutPort( 'Odd' , 'long' ) + OIsOddGate = IsOdd.GetOutPort( 'Gate' ) + + PyIsEven = [] + PyIsEven.append( 'from time import * ' ) + PyIsEven.append( 'def IsEven(a) : ' ) + PyIsEven.append( ' print a,"IsEven" ' ) + PyIsEven.append( ' sleep( 1 ) ' ) + PyIsEven.append( ' return a,1 ' ) + IsEven = GraphLoopSwitchsBranchesdefault.INode( 'IsEven' , PyIsEven ) + IsEven.SetName( 'IsEven' ) + IsEven.SetAuthor( '' ) + IsEven.SetComment( 'Python function' ) + IsEven.Coords( 472 , 724 ) + IIsEvena = IsEven.InPort( 'a' , 'long' ) + IIsEvenGate = IsEven.GetInPort( 'Gate' ) + OIsEvena = IsEven.OutPort( 'a' , 'long' ) + OIsEvenEven = IsEven.OutPort( 'Even' , 'long' ) + OIsEvenGate = IsEven.GetOutPort( 'Gate' ) + + PySwitchsCompare = [] + PySwitchsCompare.append( 'from time import * ' ) + PySwitchsCompare.append( 'def SwitchsCompare(aOdd,Odd,aEven,Even,Index) : ' ) + PySwitchsCompare.append( ' sleep(1) ' ) + PySwitchsCompare.append( ' return Index ' ) + SwitchsCompare = GraphLoopSwitchsBranchesdefault.INode( 'SwitchsCompare' , PySwitchsCompare ) + SwitchsCompare.SetName( 'SwitchsCompare' ) + SwitchsCompare.SetAuthor( '' ) + SwitchsCompare.SetComment( 'Compute Node' ) + SwitchsCompare.Coords( 916 , 269 ) + ISwitchsCompareaOdd = SwitchsCompare.InPort( 'aOdd' , 'long' ) + ISwitchsCompareOdd = SwitchsCompare.InPort( 'Odd' , 'boolean' ) + ISwitchsCompareaEven = SwitchsCompare.InPort( 'aEven' , 'long' ) + ISwitchsCompareEven = SwitchsCompare.InPort( 'Even' , 'boolean' ) + ISwitchsCompareIndex = SwitchsCompare.InPort( 'Index' , 'long' ) + ISwitchsCompareGate = SwitchsCompare.GetInPort( 'Gate' ) + OSwitchsCompareIndex = SwitchsCompare.OutPort( 'Index' , 'long' ) + OSwitchsCompareGate = SwitchsCompare.GetOutPort( 'Gate' ) + + PyIsNotOdd = [] + PyIsNotOdd.append( 'from time import * ' ) + PyIsNotOdd.append( 'def IsNotOdd(Even) : ' ) + PyIsNotOdd.append( ' sleep(1) ' ) + PyIsNotOdd.append( ' return Even ' ) + IsNotOdd = GraphLoopSwitchsBranchesdefault.INode( 'IsNotOdd' , PyIsNotOdd ) + IsNotOdd.SetName( 'IsNotOdd' ) + IsNotOdd.SetAuthor( '' ) + IsNotOdd.SetComment( 'Compute Node' ) + IsNotOdd.Coords( 477 , 137 ) + IIsNotOddEven = IsNotOdd.InPort( 'Even' , 'long' ) + IIsNotOddGate = IsNotOdd.GetInPort( 'Gate' ) + OIsNotOddEven = IsNotOdd.OutPort( 'Even' , 'long' ) + OIsNotOddGate = IsNotOdd.GetOutPort( 'Gate' ) + + PyIsNotEven = [] + PyIsNotEven.append( 'from time import * ' ) + PyIsNotEven.append( 'def IsNotEven(Odd) : ' ) + PyIsNotEven.append( ' sleep(1) ' ) + PyIsNotEven.append( ' return Odd ' ) + IsNotEven = GraphLoopSwitchsBranchesdefault.INode( 'IsNotEven' , PyIsNotEven ) + IsNotEven.SetName( 'IsNotEven' ) + IsNotEven.SetAuthor( '' ) + IsNotEven.SetComment( 'Compute Node' ) + IsNotEven.Coords( 475 , 601 ) + IIsNotEvenOdd = IsNotEven.InPort( 'Odd' , 'long' ) + IIsNotEvenGate = IsNotEven.GetInPort( 'Gate' ) + OIsNotEvenOdd = IsNotEven.OutPort( 'Odd' , 'long' ) + OIsNotEvenGate = IsNotEven.GetOutPort( 'Gate' ) + + PyIsOdddefault = [] + PyIsOdddefault.append( 'from time import * ' ) + PyIsOdddefault.append( 'def IsOdddefault(a) : ' ) + PyIsOdddefault.append( ' sleep(1) ' ) + PyIsOdddefault.append( ' return a,0 ' ) + PyIsOdddefault.append( ' ' ) + IsOdddefault = GraphLoopSwitchsBranchesdefault.INode( 'IsOdddefault' , PyIsOdddefault ) + IsOdddefault.SetName( 'IsOdddefault' ) + IsOdddefault.SetAuthor( '' ) + IsOdddefault.SetComment( 'Compute Node' ) + IsOdddefault.Coords( 477 , 285 ) + IIsOdddefaulta = IsOdddefault.InPort( 'a' , 'long' ) + IIsOdddefaultGate = IsOdddefault.GetInPort( 'Gate' ) + OIsOdddefaulta = IsOdddefault.OutPort( 'a' , 'long' ) + OIsOdddefaultOdd = IsOdddefault.OutPort( 'Odd' , 'long' ) + OIsOdddefaultGate = IsOdddefault.GetOutPort( 'Gate' ) + + PyIsEvendefault = [] + PyIsEvendefault.append( 'from time import * ' ) + PyIsEvendefault.append( 'def IsEvendefault(a) : ' ) + PyIsEvendefault.append( ' sleep(1) ' ) + PyIsEvendefault.append( ' return a,0 ' ) + PyIsEvendefault.append( ' ' ) + IsEvendefault = GraphLoopSwitchsBranchesdefault.INode( 'IsEvendefault' , PyIsEvendefault ) + IsEvendefault.SetName( 'IsEvendefault' ) + IsEvendefault.SetAuthor( '' ) + IsEvendefault.SetComment( 'Compute Node' ) + IsEvendefault.Coords( 478 , 434 ) + IIsEvendefaulta = IsEvendefault.InPort( 'a' , 'long' ) + IIsEvendefaultGate = IsEvendefault.GetInPort( 'Gate' ) + OIsEvendefaulta = IsEvendefault.OutPort( 'a' , 'long' ) + OIsEvendefaultEven = IsEvendefault.OutPort( 'Even' , 'long' ) + OIsEvendefaultGate = IsEvendefault.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyLoop = [] + PyLoop.append( 'def InitLoop(Index,Min,Max) : ' ) + PyLoop.append( ' Index = Max ' ) + PyLoop.append( ' return Index,Min,Max ' ) + PyMoreLoop = [] + PyMoreLoop.append( 'def MoreLoop(Index,Min,Max) : ' ) + PyMoreLoop.append( ' if Index >= Min : ' ) + PyMoreLoop.append( ' DoLoop = 1 ' ) + PyMoreLoop.append( ' else : ' ) + PyMoreLoop.append( ' DoLoop = 0 ' ) + PyMoreLoop.append( ' return DoLoop,Index,Min,Max ' ) + PyNextLoop = [] + PyNextLoop.append( 'def NextLoop(Index,Min,Max) : ' ) + PyNextLoop.append( ' Index = Index - 1 ' ) + PyNextLoop.append( ' return Index,Min,Max ' ) + Loop,EndOfLoop = GraphLoopSwitchsBranchesdefault.LNode( 'InitLoop' , PyLoop , 'MoreLoop' , PyMoreLoop , 'NextLoop' , PyNextLoop ) + EndOfLoop.SetName( 'EndOfLoop' ) + EndOfLoop.SetAuthor( '' ) + EndOfLoop.SetComment( 'Compute Node' ) + EndOfLoop.Coords( 1097 , 309 ) + PyEndOfLoop = [] + EndOfLoop.SetPyFunction( '' , PyEndOfLoop ) + ILoopDoLoop = Loop.GetInPort( 'DoLoop' ) + ILoopIndex = Loop.InPort( 'Index' , 'long' ) + ILoopMin = Loop.InPort( 'Min' , 'long' ) + ILoopMax = Loop.InPort( 'Max' , 'long' ) + ILoopGate = Loop.GetInPort( 'Gate' ) + OLoopDoLoop = Loop.GetOutPort( 'DoLoop' ) + OLoopIndex = Loop.GetOutPort( 'Index' ) + OLoopMin = Loop.GetOutPort( 'Min' ) + OLoopMax = Loop.GetOutPort( 'Max' ) + IEndOfLoopDoLoop = EndOfLoop.GetInPort( 'DoLoop' ) + IEndOfLoopIndex = EndOfLoop.GetInPort( 'Index' ) + IEndOfLoopMin = EndOfLoop.GetInPort( 'Min' ) + IEndOfLoopMax = EndOfLoop.GetInPort( 'Max' ) + IEndOfLoopGate = EndOfLoop.GetInPort( 'Gate' ) + OEndOfLoopDoLoop = EndOfLoop.GetOutPort( 'DoLoop' ) + OEndOfLoopIndex = EndOfLoop.GetOutPort( 'Index' ) + OEndOfLoopMin = EndOfLoop.GetOutPort( 'Min' ) + OEndOfLoopMax = EndOfLoop.GetOutPort( 'Max' ) + OEndOfLoopGate = EndOfLoop.GetOutPort( 'Gate' ) + Loop.SetName( 'Loop' ) + Loop.SetAuthor( '' ) + Loop.SetComment( 'Compute Node' ) + Loop.Coords( 18 , 389 ) + + # Creation of Switch Nodes + PySwitchOdd = [] + PySwitchOdd.append( 'from time import * ' ) + PySwitchOdd.append( 'def SwitchOdd(a) : ' ) + PySwitchOdd.append( ' sleep(1) ' ) + PySwitchOdd.append( ' if a <= 0 : ' ) + PySwitchOdd.append( ' OddEven = '<=0' ' ) + PySwitchOdd.append( ' return 0,0,0,a,OddEven ' ) + PySwitchOdd.append( ' OddEven = 'Odd' ' ) + PySwitchOdd.append( ' if (a&1) == 0 : ' ) + PySwitchOdd.append( ' OddEven = 'Even' ' ) + PySwitchOdd.append( ' return a & 1,1-(a&1),1-(a&1),a,OddEven ' ) + SwitchOdd,EndOfSwitchOdd = GraphLoopSwitchsBranchesdefault.SNode( 'SwitchOdd' , PySwitchOdd ) + EndOfSwitchOdd.SetName( 'EndOfSwitchOdd' ) + EndOfSwitchOdd.SetAuthor( '' ) + EndOfSwitchOdd.SetComment( 'Compute Node' ) + EndOfSwitchOdd.Coords( 718 , 162 ) + PyEndOfSwitchOdd = [] + PyEndOfSwitchOdd.append( 'from time import * ' ) + PyEndOfSwitchOdd.append( 'def EndOfSwitchOdd(a,Odd,Even,OddEven) : ' ) + PyEndOfSwitchOdd.append( ' sleep(1) ' ) + PyEndOfSwitchOdd.append( ' return a,Odd ' ) + EndOfSwitchOdd.SetPyFunction( 'EndOfSwitchOdd' , PyEndOfSwitchOdd ) + IEndOfSwitchOdda = EndOfSwitchOdd.InPort( 'a' , 'long' ) + IEndOfSwitchOddOdd = EndOfSwitchOdd.InPort( 'Odd' , 'boolean' ) + IEndOfSwitchOddEven = EndOfSwitchOdd.InPort( 'Even' , 'long' ) + IEndOfSwitchOddOddEven = EndOfSwitchOdd.InPort( 'OddEven' , 'boolean' ) + IEndOfSwitchOddDefault = EndOfSwitchOdd.GetInPort( 'Default' ) + OEndOfSwitchOdda = EndOfSwitchOdd.OutPort( 'a' , 'long' ) + OEndOfSwitchOddOdd = EndOfSwitchOdd.OutPort( 'Odd' , 'boolean' ) + OEndOfSwitchOddGate = EndOfSwitchOdd.GetOutPort( 'Gate' ) + SwitchOdd.SetName( 'SwitchOdd' ) + SwitchOdd.SetAuthor( '' ) + SwitchOdd.SetComment( 'Compute Node' ) + SwitchOdd.Coords( 240 , 142 ) + ISwitchOdda = SwitchOdd.InPort( 'a' , 'long' ) + ISwitchOddGate = SwitchOdd.GetInPort( 'Gate' ) + OSwitchOddOdd = SwitchOdd.OutPort( 'Odd' , 'long' ) + OSwitchOddEven = SwitchOdd.OutPort( 'Even' , 'int' ) + OSwitchOdddefault = SwitchOdd.OutPort( 'default' , 'long' ) + OSwitchOdda = SwitchOdd.OutPort( 'a' , 'long' ) + OSwitchOddOddEven = SwitchOdd.OutPort( 'OddEven' , 'string' ) + OSwitchOddDefault = SwitchOdd.GetOutPort( 'Default' ) + + PySwitchEven = [] + PySwitchEven.append( 'from time import * ' ) + PySwitchEven.append( 'def SwitchEven(a) : ' ) + PySwitchEven.append( ' sleep(1) ' ) + PySwitchEven.append( ' if a <= 0 : ' ) + PySwitchEven.append( ' OddEven = '<=0' ' ) + PySwitchEven.append( ' return 0,0,0,a,OddEven ' ) + PySwitchEven.append( ' OddEven = 'Even' ' ) + PySwitchEven.append( ' if (a&1) != 0 : ' ) + PySwitchEven.append( ' OddEven = 'Odd' ' ) + PySwitchEven.append( ' print (a&1),1-(a&1),(a&1),a,OddEven ' ) + PySwitchEven.append( ' return (a&1),1-(a&1),(a&1),a,OddEven ' ) + SwitchEven,EndOfSwitchEven = GraphLoopSwitchsBranchesdefault.SNode( 'SwitchEven' , PySwitchEven ) + EndOfSwitchEven.SetName( 'EndOfSwitchEven' ) + EndOfSwitchEven.SetAuthor( '' ) + EndOfSwitchEven.SetComment( 'Compute Node' ) + EndOfSwitchEven.Coords( 721 , 477 ) + PyEndOfSwitchEven = [] + PyEndOfSwitchEven.append( 'from time import * ' ) + PyEndOfSwitchEven.append( 'def EndOfSwitchEven(a,Even,Odd,OddEven) : ' ) + PyEndOfSwitchEven.append( ' sleep(1) ' ) + PyEndOfSwitchEven.append( ' return a,Even ' ) + EndOfSwitchEven.SetPyFunction( 'EndOfSwitchEven' , PyEndOfSwitchEven ) + IEndOfSwitchEvena = EndOfSwitchEven.InPort( 'a' , 'long' ) + IEndOfSwitchEvenEven = EndOfSwitchEven.InPort( 'Even' , 'boolean' ) + IEndOfSwitchEvenOdd = EndOfSwitchEven.InPort( 'Odd' , 'long' ) + IEndOfSwitchEvenOddEven = EndOfSwitchEven.InPort( 'OddEven' , 'string' ) + IEndOfSwitchEvenDefault = EndOfSwitchEven.GetInPort( 'Default' ) + OEndOfSwitchEvena = EndOfSwitchEven.OutPort( 'a' , 'long' ) + OEndOfSwitchEvenEven = EndOfSwitchEven.OutPort( 'Even' , 'boolean' ) + OEndOfSwitchEvenGate = EndOfSwitchEven.GetOutPort( 'Gate' ) + SwitchEven.SetName( 'SwitchEven' ) + SwitchEven.SetAuthor( '' ) + SwitchEven.SetComment( 'Compute Node' ) + SwitchEven.Coords( 230 , 457 ) + ISwitchEvena = SwitchEven.InPort( 'a' , 'long' ) + ISwitchEvenGate = SwitchEven.GetInPort( 'Gate' ) + OSwitchEvenOdd = SwitchEven.OutPort( 'Odd' , 'long' ) + OSwitchEvenEven = SwitchEven.OutPort( 'Even' , 'int' ) + OSwitchEvendefault = SwitchEven.OutPort( 'default' , 'long' ) + OSwitchEvena = SwitchEven.OutPort( 'a' , 'int' ) + OSwitchEvenOddEven = SwitchEven.OutPort( 'OddEven' , 'string' ) + OSwitchEvenDefault = SwitchEven.GetOutPort( 'Default' ) + + # Creation of Links + LIsOddaEndOfSwitchOdda = GraphLoopSwitchsBranchesdefault.Link( OIsOdda , IEndOfSwitchOdda ) + + LIsOddOddEndOfSwitchOddOdd = GraphLoopSwitchsBranchesdefault.Link( OIsOddOdd , IEndOfSwitchOddOdd ) + + LSwitchOddOddIsOddGate = GraphLoopSwitchsBranchesdefault.Link( OSwitchOddOdd , IIsOddGate ) + + LSwitchOddEvenIsNotOddEven = GraphLoopSwitchsBranchesdefault.Link( OSwitchOddEven , IIsNotOddEven ) + + LSwitchOdddefaultIsOdddefaultGate = GraphLoopSwitchsBranchesdefault.Link( OSwitchOdddefault , IIsOdddefaultGate ) + + LSwitchOddaIsOdddefaulta = GraphLoopSwitchsBranchesdefault.Link( OSwitchOdda , IIsOdddefaulta ) + + LSwitchOddaIsOdda = GraphLoopSwitchsBranchesdefault.Link( OSwitchOdda , IIsOdda ) + + LSwitchOddOddEvenEndOfSwitchOddOddEven = GraphLoopSwitchsBranchesdefault.Link( OSwitchOddOddEven , IEndOfSwitchOddOddEven ) + + LSwitchOddDefaultEndOfSwitchOddDefault = GraphLoopSwitchsBranchesdefault.Link( OSwitchOddDefault , IEndOfSwitchOddDefault ) + + LEndOfSwitchOddaSwitchsCompareaOdd = GraphLoopSwitchsBranchesdefault.Link( OEndOfSwitchOdda , ISwitchsCompareaOdd ) + + LEndOfSwitchOddOddSwitchsCompareOdd = GraphLoopSwitchsBranchesdefault.Link( OEndOfSwitchOddOdd , ISwitchsCompareOdd ) + + LIsEvenaEndOfSwitchEvena = GraphLoopSwitchsBranchesdefault.Link( OIsEvena , IEndOfSwitchEvena ) + + LIsEvenEvenEndOfSwitchEvenEven = GraphLoopSwitchsBranchesdefault.Link( OIsEvenEven , IEndOfSwitchEvenEven ) + + LLoopIndexSwitchsCompareIndex = GraphLoopSwitchsBranchesdefault.Link( OLoopIndex , ISwitchsCompareIndex ) + + LLoopIndexSwitchOdda = GraphLoopSwitchsBranchesdefault.Link( OLoopIndex , ISwitchOdda ) + + LLoopIndexSwitchEvena = GraphLoopSwitchsBranchesdefault.Link( OLoopIndex , ISwitchEvena ) + + LLoopMinEndOfLoopMin = GraphLoopSwitchsBranchesdefault.Link( OLoopMin , IEndOfLoopMin ) + + LLoopMaxEndOfLoopMax = GraphLoopSwitchsBranchesdefault.Link( OLoopMax , IEndOfLoopMax ) + + LSwitchEvenOddIsNotEvenOdd = GraphLoopSwitchsBranchesdefault.Link( OSwitchEvenOdd , IIsNotEvenOdd ) + + LSwitchEvenEvenIsEvenGate = GraphLoopSwitchsBranchesdefault.Link( OSwitchEvenEven , IIsEvenGate ) + + LSwitchEvendefaultIsEvendefaultGate = GraphLoopSwitchsBranchesdefault.Link( OSwitchEvendefault , IIsEvendefaultGate ) + + LSwitchEvenaIsEvena = GraphLoopSwitchsBranchesdefault.Link( OSwitchEvena , IIsEvena ) + + LSwitchEvenaIsEvendefaulta = GraphLoopSwitchsBranchesdefault.Link( OSwitchEvena , IIsEvendefaulta ) + + LSwitchEvenOddEvenEndOfSwitchEvenOddEven = GraphLoopSwitchsBranchesdefault.Link( OSwitchEvenOddEven , IEndOfSwitchEvenOddEven ) + + LSwitchEvenDefaultEndOfSwitchEvenDefault = GraphLoopSwitchsBranchesdefault.Link( OSwitchEvenDefault , IEndOfSwitchEvenDefault ) + + LEndOfSwitchEvenaSwitchsCompareaEven = GraphLoopSwitchsBranchesdefault.Link( OEndOfSwitchEvena , ISwitchsCompareaEven ) + + LEndOfSwitchEvenEvenSwitchsCompareEven = GraphLoopSwitchsBranchesdefault.Link( OEndOfSwitchEvenEven , ISwitchsCompareEven ) + + LSwitchsCompareIndexEndOfLoopIndex = GraphLoopSwitchsBranchesdefault.Link( OSwitchsCompareIndex , IEndOfLoopIndex ) + + LIsNotOddEvenEndOfSwitchOddEven = GraphLoopSwitchsBranchesdefault.Link( OIsNotOddEven , IEndOfSwitchOddEven ) + + LIsNotEvenOddEndOfSwitchEvenOdd = GraphLoopSwitchsBranchesdefault.Link( OIsNotEvenOdd , IEndOfSwitchEvenOdd ) + + LIsOdddefaultaEndOfSwitchOdda = GraphLoopSwitchsBranchesdefault.Link( OIsOdddefaulta , IEndOfSwitchOdda ) + + LIsOdddefaultOddEndOfSwitchOddOdd = GraphLoopSwitchsBranchesdefault.Link( OIsOdddefaultOdd , IEndOfSwitchOddOdd ) + + LIsEvendefaultaEndOfSwitchEvena = GraphLoopSwitchsBranchesdefault.Link( OIsEvendefaulta , IEndOfSwitchEvena ) + + LIsEvendefaultEvenEndOfSwitchEvenEven = GraphLoopSwitchsBranchesdefault.Link( OIsEvendefaultEven , IEndOfSwitchEvenEven ) + + # Input datas + ILoopIndex.Input( 0 ) + ILoopMin.Input( -5 ) + ILoopMax.Input( 23 ) + + # Output Ports of the graph + #OEndOfLoopIndex = EndOfLoop.GetOutPort( 'Index' ) + #OEndOfLoopMin = EndOfLoop.GetOutPort( 'Min' ) + #OEndOfLoopMax = EndOfLoop.GetOutPort( 'Max' ) + return GraphLoopSwitchsBranchesdefault + + +GraphLoopSwitchsBranchesdefault = DefGraphLoopSwitchsBranchesdefault() diff --git a/examples/GraphLoopSwitchsBranchesdefault.xml b/examples/GraphLoopSwitchsBranchesdefault.xml new file mode 100644 index 0000000..29a71f6 --- /dev/null +++ b/examples/GraphLoopSwitchsBranchesdefault.xml @@ -0,0 +1,826 @@ + + + + + +? + ? + GraphLoopSwitchsBranchesdefault + 1 + ? + +GraphLoopSwitchsBranchesdefault + + +long + Loop__Index + +long + Loop__Min + +long + Loop__Max + + +long + EndOfLoop__Index + +long + EndOfLoop__Min + +long + EndOfLoop__Max + + + 14/10/2003 - 10:29:4 + 11/2/2005 - 17:25:28 + 1.05 + JR + ? + ? + 0 + 0 + + +? + ? + IsOdd + 3 + ? + +IsOdd + + +long + a + + +long + a + +long + Odd + + + +IsOdd + + + + + + 11/2/2005 - 17:9:54 + 11/2/2005 - 17:9:54 + 1.05 + ? + ? + Python function + 476 + 2 + +? + ? + SwitchOdd + 6 + EndOfSwitchOdd + +SwitchOdd + + +long + a + + +long + Odd + +int + Even + +long + default + +long + a + +string + OddEven + + + +SwitchOdd + + + + + + + + + + + 11/2/2005 - 17:9:54 + 11/2/2005 - 17:9:54 + 1.05 + ? + ? + Compute Node + 240 + 142 + +? + ? + EndOfSwitchOdd + 7 + SwitchOdd + +EndOfSwitchOdd + + +long + a + +boolean + Odd + +long + Even + +boolean + OddEven + + +long + a + +boolean + Odd + + + +EndOfSwitchOdd + + + + + 11/2/2005 - 17:9:54 + 11/2/2005 - 17:9:54 + 1.05 + ? + ? + Compute Node + 718 + 162 + +? + ? + IsEven + 3 + ? + +IsEven + + +long + a + + +long + a + +long + Even + + + +IsEven + + + + + + 11/2/2005 - 17:9:54 + 11/2/2005 - 17:9:54 + 1.05 + ? + ? + Python function + 472 + 724 + +? + ? + Loop + 4 + EndOfLoop + +Loop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +InitLoop + + + + +MoreLoop + + = Min : ]]> + + + + + +NextLoop + + + + 11/2/2005 - 17:9:54 + 11/2/2005 - 17:9:54 + 1.05 + ? + ? + Compute Node + 18 + 389 + +? + ? + EndOfLoop + 5 + Loop + +EndOfLoop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +? + + 11/2/2005 - 17:9:54 + 11/2/2005 - 17:9:54 + 1.05 + ? + ? + Compute Node + 1097 + 309 + +? + ? + SwitchEven + 6 + EndOfSwitchEven + +SwitchEven + + +long + a + + +long + Odd + +int + Even + +long + default + +int + a + +string + OddEven + + + +SwitchEven + + + + + + + + + + + + 11/2/2005 - 17:9:54 + 11/2/2005 - 17:9:54 + 1.05 + ? + ? + Compute Node + 230 + 457 + +? + ? + EndOfSwitchEven + 7 + SwitchEven + +EndOfSwitchEven + + +long + a + +boolean + Even + +long + Odd + +string + OddEven + + +long + a + +boolean + Even + + + +EndOfSwitchEven + + + + + 11/2/2005 - 17:9:54 + 11/2/2005 - 17:9:54 + 1.05 + ? + ? + Compute Node + 721 + 477 + +? + ? + SwitchsCompare + 3 + ? + +SwitchsCompare + + +long + aOdd + +boolean + Odd + +long + aEven + +boolean + Even + +long + Index + + +long + Index + + + +SwitchsCompare + + + + + 11/2/2005 - 17:9:54 + 11/2/2005 - 17:9:54 + 2.0 + ? + ? + Compute Node + 916 + 269 + +? + ? + IsNotOdd + 3 + ? + +IsNotOdd + + +long + Even + + +long + Even + + + +IsNotOdd + + + + + 11/2/2005 - 17:9:54 + 11/2/2005 - 17:9:54 + 2.0 + ? + ? + Compute Node + 477 + 137 + +? + ? + IsNotEven + 3 + ? + +IsNotEven + + +long + Odd + + +long + Odd + + + +IsNotEven + + + + + 11/2/2005 - 17:9:54 + 11/2/2005 - 17:9:54 + 2.0 + ? + ? + Compute Node + 475 + 601 + +? + ? + IsOdddefault + 3 + ? + +IsOdddefault + + +long + a + + +long + a + +long + Odd + + + +IsOdddefault + + + + + + 11/2/2005 - 17:16:6 + 11/2/2005 - 17:16:6 + 2.0 + ? + ? + Compute Node + 477 + 285 + +? + ? + IsEvendefault + 3 + ? + +IsOdddefault_1 + + +long + a + + +long + a + +long + Even + + + +IsEvendefault + + + + + + 11/2/2005 - 17:23:32 + 11/2/2005 - 17:23:32 + 2.0 + ? + ? + Compute Node + 478 + 434 + + +IsOdd + a + EndOfSwitchOdd + a + + +IsOdd + Odd + EndOfSwitchOdd + Odd + + +SwitchOdd + Odd + IsOdd + Gate + + +SwitchOdd + Even + IsNotOdd + Even + + +SwitchOdd + default + IsOdddefault + Gate + + +SwitchOdd + a + IsOdddefault + a + + +SwitchOdd + a + IsOdd + a + + +SwitchOdd + OddEven + EndOfSwitchOdd + OddEven + + +SwitchOdd + Default + EndOfSwitchOdd + Default + + +EndOfSwitchOdd + a + SwitchsCompare + aOdd + + +EndOfSwitchOdd + Odd + SwitchsCompare + Odd + + +IsEven + a + EndOfSwitchEven + a + + +IsEven + Even + EndOfSwitchEven + Even + + +Loop + DoLoop + EndOfLoop + DoLoop + + +Loop + Index + SwitchsCompare + Index + + +Loop + Index + SwitchOdd + a + + +Loop + Index + SwitchEven + a + + +Loop + Min + EndOfLoop + Min + + +Loop + Max + EndOfLoop + Max + + +EndOfLoop + DoLoop + Loop + DoLoop + + +SwitchEven + Odd + IsNotEven + Odd + + +SwitchEven + Even + IsEven + Gate + + +SwitchEven + default + IsEvendefault + Gate + + +SwitchEven + a + IsEven + a + + +SwitchEven + a + IsEvendefault + a + + +SwitchEven + OddEven + EndOfSwitchEven + OddEven + + +SwitchEven + Default + EndOfSwitchEven + Default + + +EndOfSwitchEven + a + SwitchsCompare + aEven + + +EndOfSwitchEven + Even + SwitchsCompare + Even + + +SwitchsCompare + Index + EndOfLoop + Index + + +IsNotOdd + Even + EndOfSwitchOdd + Even + + +IsNotEven + Odd + EndOfSwitchEven + Odd + + +IsOdddefault + a + EndOfSwitchOdd + a + + +IsOdddefault + Odd + EndOfSwitchOdd + Odd + + +IsEvendefault + a + EndOfSwitchEven + a + + +IsEvendefault + Even + EndOfSwitchEven + Even + + + +GraphLoopSwitchsBranchesdefault + Loop__Index + Loop + Index + +3 + 0 + + +GraphLoopSwitchsBranchesdefault + Loop__Min + Loop + Min + +3 + -5 + + +GraphLoopSwitchsBranchesdefault + Loop__Max + Loop + Max + +3 + 23 + diff --git a/examples/GraphLoopSwitchsNOTValid.py b/examples/GraphLoopSwitchsNOTValid.py new file mode 100644 index 0000000..09b9a00 --- /dev/null +++ b/examples/GraphLoopSwitchsNOTValid.py @@ -0,0 +1,229 @@ + +# Generated python file of Graph GraphLoopSwitchsNOTValid + +from SuperV import * + +# Graph creation of GraphLoopSwitchsNOTValid +def DefGraphLoopSwitchsNOTValid() : + GraphLoopSwitchsNOTValid = Graph( 'GraphLoopSwitchsNOTValid' ) + GraphLoopSwitchsNOTValid.SetName( 'GraphLoopSwitchsNOTValid' ) + GraphLoopSwitchsNOTValid.SetAuthor( 'JR' ) + GraphLoopSwitchsNOTValid.SetComment( '' ) + GraphLoopSwitchsNOTValid.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsOdd = [] + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd(a) : ' ) + PyIsOdd.append( ' print a,"IsOdd" ' ) + PyIsOdd.append( ' sleep( 1 ) ' ) + PyIsOdd.append( ' return a ' ) + IsOdd = GraphLoopSwitchsNOTValid.INode( 'IsOdd' , PyIsOdd ) + IsOdd.SetName( 'IsOdd' ) + IsOdd.SetAuthor( '' ) + IsOdd.SetComment( 'Python function' ) + IsOdd.Coords( 476 , 50 ) + IIsOdda = IsOdd.InPort( 'a' , 'long' ) + IIsOddGate = IsOdd.GetInPort( 'Gate' ) + OIsOdda = IsOdd.OutPort( 'a' , 'long' ) + OIsOddGate = IsOdd.GetOutPort( 'Gate' ) + + PyIsEven = [] + PyIsEven.append( 'from time import * ' ) + PyIsEven.append( 'def IsEven(a) : ' ) + PyIsEven.append( ' print a,"IsEven" ' ) + PyIsEven.append( ' sleep( 1 ) ' ) + PyIsEven.append( ' return a ' ) + IsEven = GraphLoopSwitchsNOTValid.INode( 'IsEven' , PyIsEven ) + IsEven.SetName( 'IsEven' ) + IsEven.SetAuthor( '' ) + IsEven.SetComment( 'Python function' ) + IsEven.Coords( 479 , 311 ) + IIsEvena = IsEven.InPort( 'a' , 'long' ) + IIsEvenGate = IsEven.GetInPort( 'Gate' ) + OIsEvena = IsEven.OutPort( 'a' , 'long' ) + OIsEvenGate = IsEven.GetOutPort( 'Gate' ) + + PySwitchsCompare = [] + PySwitchsCompare.append( 'def SwitchsCompare(aOdd,Odd,aEven,Even) : ' ) + PySwitchsCompare.append( ' return a ' ) + SwitchsCompare = GraphLoopSwitchsNOTValid.INode( 'SwitchsCompare' , PySwitchsCompare ) + SwitchsCompare.SetName( 'SwitchsCompare' ) + SwitchsCompare.SetAuthor( '' ) + SwitchsCompare.SetComment( 'Compute Node' ) + SwitchsCompare.Coords( 919 , 242 ) + ISwitchsCompareaOdd = SwitchsCompare.InPort( 'aOdd' , 'long' ) + ISwitchsCompareOdd = SwitchsCompare.InPort( 'Odd' , 'boolean' ) + ISwitchsCompareaEven = SwitchsCompare.InPort( 'aEven' , 'long' ) + ISwitchsCompareEven = SwitchsCompare.InPort( 'Even' , 'boolean' ) + ISwitchsCompareGate = SwitchsCompare.GetInPort( 'Gate' ) + OSwitchsComparea = SwitchsCompare.OutPort( 'a' , 'long' ) + OSwitchsCompareGate = SwitchsCompare.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyLoop = [] + PyLoop.append( 'def InitLoop(Index,Min,Max) : ' ) + PyLoop.append( ' return Index,Min,Max ' ) + PyMoreLoop = [] + PyMoreLoop.append( 'def MoreLoop(Index,Min,Max) : ' ) + PyMoreLoop.append( ' if Index <= Max : ' ) + PyMoreLoop.append( ' DoLoop = 1 ' ) + PyMoreLoop.append( ' else : ' ) + PyMoreLoop.append( ' DoLoop = 0 ' ) + PyMoreLoop.append( ' return DoLoop,Index,Min,Max ' ) + PyNextLoop = [] + PyNextLoop.append( 'def NextLoop(Index,Min,Max) : ' ) + PyNextLoop.append( ' Index = Index + 1 ' ) + PyNextLoop.append( ' return Index,Min,Max ' ) + Loop,EndOfLoop = GraphLoopSwitchsNOTValid.LNode( 'InitLoop' , PyLoop , 'MoreLoop' , PyMoreLoop , 'NextLoop' , PyNextLoop ) + EndOfLoop.SetName( 'EndOfLoop' ) + EndOfLoop.SetAuthor( '' ) + EndOfLoop.SetComment( 'Compute Node' ) + EndOfLoop.Coords( 1102 , 282 ) + PyEndOfLoop = [] + EndOfLoop.SetPyFunction( '' , PyEndOfLoop ) + ILoopDoLoop = Loop.GetInPort( 'DoLoop' ) + ILoopIndex = Loop.InPort( 'Index' , 'long' ) + ILoopMin = Loop.InPort( 'Min' , 'long' ) + ILoopMax = Loop.InPort( 'Max' , 'long' ) + ILoopGate = Loop.GetInPort( 'Gate' ) + OLoopDoLoop = Loop.GetOutPort( 'DoLoop' ) + OLoopIndex = Loop.GetOutPort( 'Index' ) + OLoopMin = Loop.GetOutPort( 'Min' ) + OLoopMax = Loop.GetOutPort( 'Max' ) + IEndOfLoopDoLoop = EndOfLoop.GetInPort( 'DoLoop' ) + IEndOfLoopIndex = EndOfLoop.GetInPort( 'Index' ) + IEndOfLoopMin = EndOfLoop.GetInPort( 'Min' ) + IEndOfLoopMax = EndOfLoop.GetInPort( 'Max' ) + IEndOfLoopGate = EndOfLoop.GetInPort( 'Gate' ) + OEndOfLoopDoLoop = EndOfLoop.GetOutPort( 'DoLoop' ) + OEndOfLoopIndex = EndOfLoop.GetOutPort( 'Index' ) + OEndOfLoopMin = EndOfLoop.GetOutPort( 'Min' ) + OEndOfLoopMax = EndOfLoop.GetOutPort( 'Max' ) + OEndOfLoopGate = EndOfLoop.GetOutPort( 'Gate' ) + Loop.SetName( 'Loop' ) + Loop.SetAuthor( '' ) + Loop.SetComment( 'Compute Node' ) + Loop.Coords( 12 , 276 ) + + # Creation of Switch Nodes + PySwitchOdd = [] + PySwitchOdd.append( 'from time import * ' ) + PySwitchOdd.append( 'def Switch(a) : ' ) + PySwitchOdd.append( ' if ( a & 1 ) == 0 : ' ) + PySwitchOdd.append( ' sleep(1) ' ) + PySwitchOdd.append( ' return a & 1,1-(a&1),a ' ) + SwitchOdd,EndOfSwitchOdd = GraphLoopSwitchsNOTValid.SNode( 'Switch' , PySwitchOdd ) + EndOfSwitchOdd.SetName( 'EndOfSwitchOdd' ) + EndOfSwitchOdd.SetAuthor( '' ) + EndOfSwitchOdd.SetComment( 'Compute Node' ) + EndOfSwitchOdd.Coords( 711 , 161 ) + PyEndOfSwitchOdd = [] + EndOfSwitchOdd.SetPyFunction( '' , PyEndOfSwitchOdd ) + IEndOfSwitchOdda = EndOfSwitchOdd.InPort( 'a' , 'long' ) + IEndOfSwitchOddOdd = EndOfSwitchOdd.InPort( 'Odd' , 'boolean' ) + IEndOfSwitchOddDefault = EndOfSwitchOdd.GetInPort( 'Default' ) + OEndOfSwitchOdda = EndOfSwitchOdd.OutPort( 'a' , 'long' ) + OEndOfSwitchOddOdd = EndOfSwitchOdd.OutPort( 'Odd' , 'boolean' ) + OEndOfSwitchOddGate = EndOfSwitchOdd.GetOutPort( 'Gate' ) + SwitchOdd.SetName( 'SwitchOdd' ) + SwitchOdd.SetAuthor( '' ) + SwitchOdd.SetComment( 'Compute Node' ) + SwitchOdd.Coords( 240 , 141 ) + ISwitchOdda = SwitchOdd.InPort( 'a' , 'long' ) + ISwitchOddGate = SwitchOdd.GetInPort( 'Gate' ) + OSwitchOddOdd = SwitchOdd.OutPort( 'Odd' , 'long' ) + OSwitchOddEven = SwitchOdd.OutPort( 'Even' , 'int' ) + OSwitchOdda = SwitchOdd.OutPort( 'a' , 'int' ) + OSwitchOddDefault = SwitchOdd.GetOutPort( 'Default' ) + + PySwitchEven = [] + PySwitchEven.append( 'from time import * ' ) + PySwitchEven.append( 'def Switch(a) : ' ) + PySwitchEven.append( ' if ( a & 1 ) == 0 : ' ) + PySwitchEven.append( ' sleep(1) ' ) + PySwitchEven.append( ' return a & 1,1-(a&1),a ' ) + SwitchEven,EndOfSwitchEven = GraphLoopSwitchsNOTValid.SNode( 'Switch' , PySwitchEven ) + EndOfSwitchEven.SetName( 'EndOfSwitchEven' ) + EndOfSwitchEven.SetAuthor( '' ) + EndOfSwitchEven.SetComment( 'Compute Node' ) + EndOfSwitchEven.Coords( 718 , 361 ) + PyEndOfSwitchEven = [] + EndOfSwitchEven.SetPyFunction( '' , PyEndOfSwitchEven ) + IEndOfSwitchEvena = EndOfSwitchEven.InPort( 'a' , 'long' ) + IEndOfSwitchEvenEven = EndOfSwitchEven.InPort( 'Even' , 'boolean' ) + IEndOfSwitchEvenDefault = EndOfSwitchEven.GetInPort( 'Default' ) + OEndOfSwitchEvena = EndOfSwitchEven.OutPort( 'a' , 'long' ) + OEndOfSwitchEvenEven = EndOfSwitchEven.OutPort( 'Even' , 'boolean' ) + OEndOfSwitchEvenGate = EndOfSwitchEven.GetOutPort( 'Gate' ) + SwitchEven.SetName( 'SwitchEven' ) + SwitchEven.SetAuthor( '' ) + SwitchEven.SetComment( 'Compute Node' ) + SwitchEven.Coords( 235 , 386 ) + ISwitchEvena = SwitchEven.InPort( 'a' , 'long' ) + ISwitchEvenGate = SwitchEven.GetInPort( 'Gate' ) + OSwitchEvenOdd = SwitchEven.OutPort( 'Odd' , 'long' ) + OSwitchEvenEven = SwitchEven.OutPort( 'Even' , 'int' ) + OSwitchEvena = SwitchEven.OutPort( 'a' , 'int' ) + OSwitchEvenDefault = SwitchEven.GetOutPort( 'Default' ) + + # Creation of Links + LIsOddaEndOfSwitchOdda = GraphLoopSwitchsNOTValid.Link( OIsOdda , IEndOfSwitchOdda ) + + LSwitchOddOddIsOddGate = GraphLoopSwitchsNOTValid.Link( OSwitchOddOdd , IIsOddGate ) + + LSwitchOddOddEndOfSwitchOddOdd = GraphLoopSwitchsNOTValid.Link( OSwitchOddOdd , IEndOfSwitchOddOdd ) + + LSwitchOddaIsOdda = GraphLoopSwitchsNOTValid.Link( OSwitchOdda , IIsOdda ) + LSwitchOddaIsOdda.AddCoord( 1 , 443 , 121 ) + LSwitchOddaIsOdda.AddCoord( 2 , 443 , 212 ) + + LSwitchOddDefaultEndOfSwitchOddDefault = GraphLoopSwitchsNOTValid.Link( OSwitchOddDefault , IEndOfSwitchOddDefault ) + + LEndOfSwitchOddaSwitchsCompareaOdd = GraphLoopSwitchsNOTValid.Link( OEndOfSwitchOdda , ISwitchsCompareaOdd ) + + LEndOfSwitchOddOddSwitchsCompareOdd = GraphLoopSwitchsNOTValid.Link( OEndOfSwitchOddOdd , ISwitchsCompareOdd ) + + LIsEvenaEndOfSwitchEvena = GraphLoopSwitchsNOTValid.Link( OIsEvena , IEndOfSwitchEvena ) + + LLoopIndexSwitchEvena = GraphLoopSwitchsNOTValid.Link( OLoopIndex , ISwitchEvena ) + + LLoopIndexSwitchOdda = GraphLoopSwitchsNOTValid.Link( OLoopIndex , ISwitchOdda ) + + LLoopMinEndOfLoopMin = GraphLoopSwitchsNOTValid.Link( OLoopMin , IEndOfLoopMin ) + + LLoopMaxEndOfLoopMax = GraphLoopSwitchsNOTValid.Link( OLoopMax , IEndOfLoopMax ) + + LSwitchEvenOddIsEvenGate = GraphLoopSwitchsNOTValid.Link( OSwitchEvenOdd , IIsEvenGate ) + + LSwitchEvenEvenEndOfSwitchEvenDefault = GraphLoopSwitchsNOTValid.Link( OSwitchEvenEven , IEndOfSwitchEvenDefault ) + + LSwitchEvenaIsEvena = GraphLoopSwitchsNOTValid.Link( OSwitchEvena , IIsEvena ) + LSwitchEvenaIsEvena.AddCoord( 1 , 434 , 382 ) + LSwitchEvenaIsEvena.AddCoord( 2 , 434 , 457 ) + + LEndOfSwitchEvenaSwitchsCompareaEven = GraphLoopSwitchsNOTValid.Link( OEndOfSwitchEvena , ISwitchsCompareaEven ) + + LEndOfSwitchEvenEvenSwitchsCompareEven = GraphLoopSwitchsNOTValid.Link( OEndOfSwitchEvenEven , ISwitchsCompareEven ) + + LSwitchsCompareaEndOfLoopIndex = GraphLoopSwitchsNOTValid.Link( OSwitchsComparea , IEndOfLoopIndex ) + + # Input datas + ILoopIndex.Input( 0 ) + ILoopMin.Input( 0 ) + ILoopMax.Input( 100 ) + + # Input Ports of the graph + #IEndOfSwitchEvenEven = EndOfSwitchEven.GetInPort( 'Even' ) + + # Output Ports of the graph + #OSwitchOddEven = SwitchOdd.GetOutPort( 'Even' ) + #OEndOfLoopIndex = EndOfLoop.GetOutPort( 'Index' ) + #OEndOfLoopMin = EndOfLoop.GetOutPort( 'Min' ) + #OEndOfLoopMax = EndOfLoop.GetOutPort( 'Max' ) + return GraphLoopSwitchsNOTValid + + +GraphLoopSwitchsNOTValid = DefGraphLoopSwitchsNOTValid() diff --git a/examples/GraphLoopSwitchsNOTValid.xml b/examples/GraphLoopSwitchsNOTValid.xml new file mode 100644 index 0000000..5ba6267 --- /dev/null +++ b/examples/GraphLoopSwitchsNOTValid.xml @@ -0,0 +1,559 @@ + + + + + +? + ? + GraphLoopSwitchsNOTValid + 1 + ? + +GraphLoopSwitchsNOTValid + + +long + Loop__Index + +long + Loop__Min + +long + Loop__Max + +boolean + EndOfSwitchEven__Even + + +int + SwitchOdd__Even + +long + EndOfLoop__Index + +long + EndOfLoop__Min + +long + EndOfLoop__Max + + + 14/10/2003 - 10:29:4 + 8/2/2005 - 11:26:57 + 1.05 + JR + ? + ? + 0 + 0 + + +? + ? + IsOdd + 3 + ? + +IsOdd + + +long + a + + +long + a + + + +IsOdd + + + + + + 8/2/2005 - 11:26:56 + 8/2/2005 - 11:26:56 + 1.05 + ? + ? + Python function + 476 + 50 + +? + ? + SwitchOdd + 6 + EndOfSwitchOdd + +SwitchOdd + + +long + a + + +long + Odd + +int + Even + +int + a + + + +Switch + + + + + + 8/2/2005 - 11:26:56 + 8/2/2005 - 11:26:56 + 1.05 + ? + ? + Compute Node + 240 + 141 + +? + ? + EndOfSwitchOdd + 7 + SwitchOdd + +EndOfSwitchOdd + + +long + a + +boolean + Odd + + +long + a + +boolean + Odd + + + +? + + 8/2/2005 - 11:26:56 + 8/2/2005 - 11:26:56 + 1.05 + ? + ? + Compute Node + 711 + 161 + +? + ? + IsEven + 3 + ? + +IsEven + + +long + a + + +long + a + + + +IsEven + + + + + + 8/2/2005 - 11:26:56 + 8/2/2005 - 11:26:56 + 1.05 + ? + ? + Python function + 479 + 311 + +? + ? + Loop + 4 + EndOfLoop + +Loop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +InitLoop + + + +MoreLoop + + + + + + + +NextLoop + + + + 8/2/2005 - 11:26:56 + 8/2/2005 - 11:26:56 + 1.05 + ? + ? + Compute Node + 12 + 276 + +? + ? + EndOfLoop + 5 + Loop + +EndOfLoop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +? + + 8/2/2005 - 11:26:56 + 8/2/2005 - 11:26:56 + 1.05 + ? + ? + Compute Node + 1102 + 282 + +? + ? + SwitchEven + 6 + EndOfSwitchEven + +SwitchEven + + +long + a + + +long + Odd + +int + Even + +int + a + + + +Switch + + + + + + 8/2/2005 - 11:26:56 + 8/2/2005 - 11:26:56 + 1.05 + ? + ? + Compute Node + 235 + 386 + +? + ? + EndOfSwitchEven + 7 + SwitchEven + +EndOfSwitchEven + + +long + a + +boolean + Even + + +long + a + +boolean + Even + + + +? + + 8/2/2005 - 11:26:56 + 8/2/2005 - 11:26:56 + 1.05 + ? + ? + Compute Node + 718 + 361 + +? + ? + SwitchsCompare + 3 + ? + +SwitchsCompare + + +long + aOdd + +boolean + Odd + +long + aEven + +boolean + Even + + +long + a + + + +SwitchsCompare + + + 8/2/2005 - 11:26:56 + 8/2/2005 - 11:26:56 + 2.0 + ? + ? + Compute Node + 919 + 242 + + +IsOdd + a + EndOfSwitchOdd + a + + +SwitchOdd + Odd + IsOdd + Gate + + +SwitchOdd + Odd + EndOfSwitchOdd + Odd + + +SwitchOdd + a + IsOdd + a + + +443 + 121 + +443 + 212 + +SwitchOdd + Default + EndOfSwitchOdd + Default + + +EndOfSwitchOdd + a + SwitchsCompare + aOdd + + +EndOfSwitchOdd + Odd + SwitchsCompare + Odd + + +IsEven + a + EndOfSwitchEven + a + + +Loop + DoLoop + EndOfLoop + DoLoop + + +Loop + Index + SwitchEven + a + + +Loop + Index + SwitchOdd + a + + +Loop + Min + EndOfLoop + Min + + +Loop + Max + EndOfLoop + Max + + +EndOfLoop + DoLoop + Loop + DoLoop + + +SwitchEven + Odd + IsEven + Gate + + +SwitchEven + Even + EndOfSwitchEven + Default + + +SwitchEven + a + IsEven + a + + +434 + 382 + +434 + 457 + +EndOfSwitchEven + a + SwitchsCompare + aEven + + +EndOfSwitchEven + Even + SwitchsCompare + Even + + +SwitchsCompare + a + EndOfLoop + Index + + + +GraphLoopSwitchsNOTValid + Loop__Index + Loop + Index + +3 + 0 + + +GraphLoopSwitchsNOTValid + Loop__Min + Loop + Min + +3 + 0 + + +GraphLoopSwitchsNOTValid + Loop__Max + Loop + Max + +3 + 100 + diff --git a/examples/GraphLoopTwoBranches.py b/examples/GraphLoopTwoBranches.py new file mode 100644 index 0000000..2aa4b70 --- /dev/null +++ b/examples/GraphLoopTwoBranches.py @@ -0,0 +1,326 @@ + +# Generated python file of Graph GraphLoopTwoBranches_1 + +from SuperV import * + +# Graph creation of GraphLoopTwoBranches_1 +def DefGraphLoopTwoBranches_1() : + GraphLoopTwoBranches_1 = Graph( 'GraphLoopTwoBranches_1' ) + GraphLoopTwoBranches_1.SetName( 'GraphLoopTwoBranches_1' ) + GraphLoopTwoBranches_1.SetAuthor( '' ) + GraphLoopTwoBranches_1.SetComment( '' ) + GraphLoopTwoBranches_1.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsOdd = [] + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd(a) : ' ) + PyIsOdd.append( ' print a,"IsOdd" ' ) + PyIsOdd.append( ' sleep( 1 ) ' ) + PyIsOdd.append( ' return a,1 ' ) + IsOdd = GraphLoopTwoBranches_1.INode( 'IsOdd' , PyIsOdd ) + IsOdd.SetName( 'IsOdd' ) + IsOdd.SetAuthor( '' ) + IsOdd.SetComment( 'Python function' ) + IsOdd.Coords( 476 , 2 ) + IIsOdda = IsOdd.InPort( 'a' , 'long' ) + IIsOddGate = IsOdd.GetInPort( 'Gate' ) + OIsOdda = IsOdd.OutPort( 'a' , 'long' ) + OIsOddOdd = IsOdd.OutPort( 'Odd' , 'long' ) + OIsOddGate = IsOdd.GetOutPort( 'Gate' ) + + PyIsEven = [] + PyIsEven.append( 'from time import * ' ) + PyIsEven.append( 'def IsEven(a) : ' ) + PyIsEven.append( ' print a,"IsEven" ' ) + PyIsEven.append( ' sleep( 1 ) ' ) + PyIsEven.append( ' return a,1 ' ) + IsEven = GraphLoopTwoBranches_1.INode( 'IsEven' , PyIsEven ) + IsEven.SetName( 'IsEven' ) + IsEven.SetAuthor( '' ) + IsEven.SetComment( 'Python function' ) + IsEven.Coords( 472 , 724 ) + IIsEvena = IsEven.InPort( 'a' , 'long' ) + IIsEvenGate = IsEven.GetInPort( 'Gate' ) + OIsEvena = IsEven.OutPort( 'a' , 'long' ) + OIsEvenEven = IsEven.OutPort( 'Even' , 'long' ) + OIsEvenGate = IsEven.GetOutPort( 'Gate' ) + + PyIsNotOdd = [] + PyIsNotOdd.append( 'from time import * ' ) + PyIsNotOdd.append( 'def IsNotOdd(Even) : ' ) + PyIsNotOdd.append( ' sleep(1) ' ) + PyIsNotOdd.append( ' return Even ' ) + IsNotOdd = GraphLoopTwoBranches_1.INode( 'IsNotOdd' , PyIsNotOdd ) + IsNotOdd.SetName( 'IsNotOdd' ) + IsNotOdd.SetAuthor( '' ) + IsNotOdd.SetComment( 'Compute Node' ) + IsNotOdd.Coords( 477 , 137 ) + IIsNotOddEven = IsNotOdd.InPort( 'Even' , 'long' ) + IIsNotOddGate = IsNotOdd.GetInPort( 'Gate' ) + OIsNotOddEven = IsNotOdd.OutPort( 'Even' , 'long' ) + OIsNotOddGate = IsNotOdd.GetOutPort( 'Gate' ) + + PyIsNotEven = [] + PyIsNotEven.append( 'from time import * ' ) + PyIsNotEven.append( 'def IsNotEven(Odd) : ' ) + PyIsNotEven.append( ' sleep(1) ' ) + PyIsNotEven.append( ' return Odd ' ) + IsNotEven = GraphLoopTwoBranches_1.INode( 'IsNotEven' , PyIsNotEven ) + IsNotEven.SetName( 'IsNotEven' ) + IsNotEven.SetAuthor( '' ) + IsNotEven.SetComment( 'Compute Node' ) + IsNotEven.Coords( 475 , 601 ) + IIsNotEvenOdd = IsNotEven.InPort( 'Odd' , 'long' ) + IIsNotEvenGate = IsNotEven.GetInPort( 'Gate' ) + OIsNotEvenOdd = IsNotEven.OutPort( 'Odd' , 'long' ) + OIsNotEvenGate = IsNotEven.GetOutPort( 'Gate' ) + + PyIsOdddefault = [] + PyIsOdddefault.append( 'from time import * ' ) + PyIsOdddefault.append( 'def IsOdddefault(a) : ' ) + PyIsOdddefault.append( ' sleep(1) ' ) + PyIsOdddefault.append( ' return a,0 ' ) + PyIsOdddefault.append( '' ) + IsOdddefault = GraphLoopTwoBranches_1.INode( 'IsOdddefault' , PyIsOdddefault ) + IsOdddefault.SetName( 'IsOdddefault' ) + IsOdddefault.SetAuthor( '' ) + IsOdddefault.SetComment( 'Compute Node' ) + IsOdddefault.Coords( 477 , 285 ) + IIsOdddefaulta = IsOdddefault.InPort( 'a' , 'long' ) + IIsOdddefaultGate = IsOdddefault.GetInPort( 'Gate' ) + OIsOdddefaulta = IsOdddefault.OutPort( 'a' , 'long' ) + OIsOdddefaultOdd = IsOdddefault.OutPort( 'Odd' , 'long' ) + OIsOdddefaultGate = IsOdddefault.GetOutPort( 'Gate' ) + + PyIsEvendefault = [] + PyIsEvendefault.append( 'from time import * ' ) + PyIsEvendefault.append( 'def IsEvendefault(a) : ' ) + PyIsEvendefault.append( ' sleep(1) ' ) + PyIsEvendefault.append( ' return a,0 ' ) + PyIsEvendefault.append( '' ) + IsEvendefault = GraphLoopTwoBranches_1.INode( 'IsEvendefault' , PyIsEvendefault ) + IsEvendefault.SetName( 'IsEvendefault' ) + IsEvendefault.SetAuthor( '' ) + IsEvendefault.SetComment( 'Compute Node' ) + IsEvendefault.Coords( 478 , 434 ) + IIsEvendefaulta = IsEvendefault.InPort( 'a' , 'long' ) + IIsEvendefaultGate = IsEvendefault.GetInPort( 'Gate' ) + OIsEvendefaulta = IsEvendefault.OutPort( 'a' , 'long' ) + OIsEvendefaultEven = IsEvendefault.OutPort( 'Even' , 'long' ) + OIsEvendefaultGate = IsEvendefault.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyLoop = [] + PyLoop.append( 'def InitLoop(Index,Min,Max) : ' ) + PyLoop.append( ' Index = Max ' ) + PyLoop.append( ' return Index,Min,Max ' ) + PyMoreLoop = [] + PyMoreLoop.append( 'def MoreLoop(Index,Min,Max) : ' ) + PyMoreLoop.append( ' if Index >= Min : ' ) + PyMoreLoop.append( ' DoLoop = 1 ' ) + PyMoreLoop.append( ' else : ' ) + PyMoreLoop.append( ' DoLoop = 0 ' ) + PyMoreLoop.append( ' return DoLoop,Index,Min,Max ' ) + PyNextLoop = [] + PyNextLoop.append( 'def NextLoop(Index,Min,Max) : ' ) + PyNextLoop.append( ' Index = Index - 1 ' ) + PyNextLoop.append( ' return Index,Min,Max ' ) + Loop,EndOfLoop = GraphLoopTwoBranches_1.LNode( 'InitLoop' , PyLoop , 'MoreLoop' , PyMoreLoop , 'NextLoop' , PyNextLoop ) + EndOfLoop.SetName( 'EndOfLoop' ) + EndOfLoop.SetAuthor( '' ) + EndOfLoop.SetComment( 'Compute Node' ) + EndOfLoop.Coords( 1097 , 309 ) + PyEndOfLoop = [] + EndOfLoop.SetPyFunction( '' , PyEndOfLoop ) + ILoopDoLoop = Loop.GetInPort( 'DoLoop' ) + ILoopIndex = Loop.InPort( 'Index' , 'long' ) + ILoopMin = Loop.InPort( 'Min' , 'long' ) + ILoopMax = Loop.InPort( 'Max' , 'long' ) + ILoopGate = Loop.GetInPort( 'Gate' ) + OLoopDoLoop = Loop.GetOutPort( 'DoLoop' ) + OLoopIndex = Loop.GetOutPort( 'Index' ) + OLoopMin = Loop.GetOutPort( 'Min' ) + OLoopMax = Loop.GetOutPort( 'Max' ) + IEndOfLoopDoLoop = EndOfLoop.GetInPort( 'DoLoop' ) + IEndOfLoopIndex = EndOfLoop.GetInPort( 'Index' ) + IEndOfLoopMin = EndOfLoop.GetInPort( 'Min' ) + IEndOfLoopMax = EndOfLoop.GetInPort( 'Max' ) + IEndOfLoopGate = EndOfLoop.GetInPort( 'Gate' ) + OEndOfLoopDoLoop = EndOfLoop.GetOutPort( 'DoLoop' ) + OEndOfLoopIndex = EndOfLoop.GetOutPort( 'Index' ) + OEndOfLoopMin = EndOfLoop.GetOutPort( 'Min' ) + OEndOfLoopMax = EndOfLoop.GetOutPort( 'Max' ) + OEndOfLoopGate = EndOfLoop.GetOutPort( 'Gate' ) + Loop.SetName( 'Loop' ) + Loop.SetAuthor( '' ) + Loop.SetComment( 'Compute Node' ) + Loop.Coords( 18 , 389 ) + + # Creation of Switch Nodes + PySwitchOdd = [] + PySwitchOdd.append( 'from time import * ' ) + PySwitchOdd.append( 'def SwitchOdd(a) : ' ) + PySwitchOdd.append( ' sleep(1) ' ) + PySwitchOdd.append( ' if a <= 0 : ' ) + PySwitchOdd.append( ' OddEven = '<=0' ' ) + PySwitchOdd.append( ' return 0,0,0,a,OddEven ' ) + PySwitchOdd.append( ' OddEven = 'Odd' ' ) + PySwitchOdd.append( ' if (a&1) == 0 : ' ) + PySwitchOdd.append( ' OddEven = 'Even' ' ) + PySwitchOdd.append( ' return a & 1,1-(a&1),1-(a&1),a,OddEven ' ) + SwitchOdd,EndOfSwitchOdd = GraphLoopTwoBranches_1.SNode( 'SwitchOdd' , PySwitchOdd ) + EndOfSwitchOdd.SetName( 'EndOfSwitchOdd' ) + EndOfSwitchOdd.SetAuthor( '' ) + EndOfSwitchOdd.SetComment( 'Compute Node' ) + EndOfSwitchOdd.Coords( 718 , 162 ) + PyEndOfSwitchOdd = [] + PyEndOfSwitchOdd.append( 'from time import * ' ) + PyEndOfSwitchOdd.append( 'def EndOfSwitchOdd(a,Odd,Even,OddEven) : ' ) + PyEndOfSwitchOdd.append( ' sleep(1) ' ) + PyEndOfSwitchOdd.append( ' return a,Odd ' ) + EndOfSwitchOdd.SetPyFunction( 'EndOfSwitchOdd' , PyEndOfSwitchOdd ) + IEndOfSwitchOdda = EndOfSwitchOdd.InPort( 'a' , 'long' ) + IEndOfSwitchOddOdd = EndOfSwitchOdd.InPort( 'Odd' , 'boolean' ) + IEndOfSwitchOddEven = EndOfSwitchOdd.InPort( 'Even' , 'long' ) + IEndOfSwitchOddOddEven = EndOfSwitchOdd.InPort( 'OddEven' , 'boolean' ) + IEndOfSwitchOddDefault = EndOfSwitchOdd.GetInPort( 'Default' ) + OEndOfSwitchOdda = EndOfSwitchOdd.OutPort( 'a' , 'long' ) + OEndOfSwitchOddOdd = EndOfSwitchOdd.OutPort( 'Odd' , 'boolean' ) + OEndOfSwitchOddGate = EndOfSwitchOdd.GetOutPort( 'Gate' ) + SwitchOdd.SetName( 'SwitchOdd' ) + SwitchOdd.SetAuthor( '' ) + SwitchOdd.SetComment( 'Compute Node' ) + SwitchOdd.Coords( 240 , 142 ) + ISwitchOdda = SwitchOdd.InPort( 'a' , 'long' ) + ISwitchOddGate = SwitchOdd.GetInPort( 'Gate' ) + OSwitchOddOdd = SwitchOdd.OutPort( 'Odd' , 'long' ) + OSwitchOddEven = SwitchOdd.OutPort( 'Even' , 'int' ) + OSwitchOdddefault = SwitchOdd.OutPort( 'default' , 'long' ) + OSwitchOdda = SwitchOdd.OutPort( 'a' , 'long' ) + OSwitchOddOddEven = SwitchOdd.OutPort( 'OddEven' , 'string' ) + OSwitchOddDefault = SwitchOdd.GetOutPort( 'Default' ) + + PySwitchEven = [] + PySwitchEven.append( 'from time import * ' ) + PySwitchEven.append( 'def SwitchEven(a) : ' ) + PySwitchEven.append( ' sleep(1) ' ) + PySwitchEven.append( ' if a <= 0 : ' ) + PySwitchEven.append( ' OddEven = '<=0' ' ) + PySwitchEven.append( ' return 0,0,0,a,OddEven ' ) + PySwitchEven.append( ' OddEven = 'Even' ' ) + PySwitchEven.append( ' if (a&1) != 0 : ' ) + PySwitchEven.append( ' OddEven = 'Odd' ' ) + PySwitchEven.append( ' print (a&1),1-(a&1),(a&1),a,OddEven ' ) + PySwitchEven.append( ' return (a&1),1-(a&1),(a&1),a,OddEven ' ) + SwitchEven,EndOfSwitchEven = GraphLoopTwoBranches_1.SNode( 'SwitchEven' , PySwitchEven ) + EndOfSwitchEven.SetName( 'EndOfSwitchEven' ) + EndOfSwitchEven.SetAuthor( '' ) + EndOfSwitchEven.SetComment( 'Compute Node' ) + EndOfSwitchEven.Coords( 721 , 477 ) + PyEndOfSwitchEven = [] + PyEndOfSwitchEven.append( 'from time import * ' ) + PyEndOfSwitchEven.append( 'def EndOfSwitchEven(a,Even,Odd,OddEven) : ' ) + PyEndOfSwitchEven.append( ' sleep(1) ' ) + PyEndOfSwitchEven.append( ' return a,Even ' ) + EndOfSwitchEven.SetPyFunction( 'EndOfSwitchEven' , PyEndOfSwitchEven ) + IEndOfSwitchEvena = EndOfSwitchEven.InPort( 'a' , 'long' ) + IEndOfSwitchEvenEven = EndOfSwitchEven.InPort( 'Even' , 'boolean' ) + IEndOfSwitchEvenOdd = EndOfSwitchEven.InPort( 'Odd' , 'long' ) + IEndOfSwitchEvenOddEven = EndOfSwitchEven.InPort( 'OddEven' , 'string' ) + IEndOfSwitchEvenDefault = EndOfSwitchEven.GetInPort( 'Default' ) + OEndOfSwitchEvena = EndOfSwitchEven.OutPort( 'a' , 'long' ) + OEndOfSwitchEvenEven = EndOfSwitchEven.OutPort( 'Even' , 'boolean' ) + OEndOfSwitchEvenGate = EndOfSwitchEven.GetOutPort( 'Gate' ) + SwitchEven.SetName( 'SwitchEven' ) + SwitchEven.SetAuthor( '' ) + SwitchEven.SetComment( 'Compute Node' ) + SwitchEven.Coords( 230 , 457 ) + ISwitchEvena = SwitchEven.InPort( 'a' , 'long' ) + ISwitchEvenGate = SwitchEven.GetInPort( 'Gate' ) + OSwitchEvenOdd = SwitchEven.OutPort( 'Odd' , 'long' ) + OSwitchEvenEven = SwitchEven.OutPort( 'Even' , 'int' ) + OSwitchEvendefault = SwitchEven.OutPort( 'default' , 'long' ) + OSwitchEvena = SwitchEven.OutPort( 'a' , 'int' ) + OSwitchEvenOddEven = SwitchEven.OutPort( 'OddEven' , 'string' ) + OSwitchEvenDefault = SwitchEven.GetOutPort( 'Default' ) + + # Creation of Links + LIsOddaEndOfSwitchOdda = GraphLoopTwoBranches_1.Link( OIsOdda , IEndOfSwitchOdda ) + + LIsOddOddEndOfSwitchOddOdd = GraphLoopTwoBranches_1.Link( OIsOddOdd , IEndOfSwitchOddOdd ) + + LSwitchOddOddIsOddGate = GraphLoopTwoBranches_1.Link( OSwitchOddOdd , IIsOddGate ) + + LSwitchOddEvenIsNotOddEven = GraphLoopTwoBranches_1.Link( OSwitchOddEven , IIsNotOddEven ) + + LSwitchOdddefaultIsOdddefaultGate = GraphLoopTwoBranches_1.Link( OSwitchOdddefault , IIsOdddefaultGate ) + + LSwitchOddaIsOdddefaulta = GraphLoopTwoBranches_1.Link( OSwitchOdda , IIsOdddefaulta ) + + LSwitchOddaIsOdda = GraphLoopTwoBranches_1.Link( OSwitchOdda , IIsOdda ) + + LSwitchOddOddEvenEndOfSwitchOddOddEven = GraphLoopTwoBranches_1.Link( OSwitchOddOddEven , IEndOfSwitchOddOddEven ) + + LSwitchOddDefaultEndOfSwitchOddDefault = GraphLoopTwoBranches_1.Link( OSwitchOddDefault , IEndOfSwitchOddDefault ) + + LEndOfSwitchOddaEndOfLoopIndex = GraphLoopTwoBranches_1.Link( OEndOfSwitchOdda , IEndOfLoopIndex ) + + LIsEvenaEndOfSwitchEvena = GraphLoopTwoBranches_1.Link( OIsEvena , IEndOfSwitchEvena ) + + LIsEvenEvenEndOfSwitchEvenEven = GraphLoopTwoBranches_1.Link( OIsEvenEven , IEndOfSwitchEvenEven ) + + LLoopIndexSwitchOdda = GraphLoopTwoBranches_1.Link( OLoopIndex , ISwitchOdda ) + + LLoopIndexSwitchEvena = GraphLoopTwoBranches_1.Link( OLoopIndex , ISwitchEvena ) + + LLoopMinEndOfLoopMin = GraphLoopTwoBranches_1.Link( OLoopMin , IEndOfLoopMin ) + + LLoopMaxEndOfLoopMax = GraphLoopTwoBranches_1.Link( OLoopMax , IEndOfLoopMax ) + + LSwitchEvenOddIsNotEvenOdd = GraphLoopTwoBranches_1.Link( OSwitchEvenOdd , IIsNotEvenOdd ) + + LSwitchEvenEvenIsEvenGate = GraphLoopTwoBranches_1.Link( OSwitchEvenEven , IIsEvenGate ) + + LSwitchEvendefaultIsEvendefaultGate = GraphLoopTwoBranches_1.Link( OSwitchEvendefault , IIsEvendefaultGate ) + + LSwitchEvenaIsEvena = GraphLoopTwoBranches_1.Link( OSwitchEvena , IIsEvena ) + + LSwitchEvenaIsEvendefaulta = GraphLoopTwoBranches_1.Link( OSwitchEvena , IIsEvendefaulta ) + + LSwitchEvenOddEvenEndOfSwitchEvenOddEven = GraphLoopTwoBranches_1.Link( OSwitchEvenOddEven , IEndOfSwitchEvenOddEven ) + + LSwitchEvenDefaultEndOfSwitchEvenDefault = GraphLoopTwoBranches_1.Link( OSwitchEvenDefault , IEndOfSwitchEvenDefault ) + + LEndOfSwitchEvenGateEndOfLoopGate = GraphLoopTwoBranches_1.Link( OEndOfSwitchEvenGate , IEndOfLoopGate ) + + LIsNotOddEvenEndOfSwitchOddEven = GraphLoopTwoBranches_1.Link( OIsNotOddEven , IEndOfSwitchOddEven ) + + LIsNotEvenOddEndOfSwitchEvenOdd = GraphLoopTwoBranches_1.Link( OIsNotEvenOdd , IEndOfSwitchEvenOdd ) + + LIsOdddefaultaEndOfSwitchOdda = GraphLoopTwoBranches_1.Link( OIsOdddefaulta , IEndOfSwitchOdda ) + + LIsOdddefaultOddEndOfSwitchOddOdd = GraphLoopTwoBranches_1.Link( OIsOdddefaultOdd , IEndOfSwitchOddOdd ) + + LIsEvendefaultaEndOfSwitchEvena = GraphLoopTwoBranches_1.Link( OIsEvendefaulta , IEndOfSwitchEvena ) + + LIsEvendefaultEvenEndOfSwitchEvenEven = GraphLoopTwoBranches_1.Link( OIsEvendefaultEven , IEndOfSwitchEvenEven ) + + # Input datas + ILoopIndex.Input( 0 ) + ILoopMin.Input( -5 ) + ILoopMax.Input( 11 ) + + # Output Ports of the graph + #OEndOfSwitchOddOdd = EndOfSwitchOdd.GetOutPort( 'Odd' ) + #OEndOfLoopIndex = EndOfLoop.GetOutPort( 'Index' ) + #OEndOfLoopMin = EndOfLoop.GetOutPort( 'Min' ) + #OEndOfLoopMax = EndOfLoop.GetOutPort( 'Max' ) + #OEndOfSwitchEvena = EndOfSwitchEven.GetOutPort( 'a' ) + #OEndOfSwitchEvenEven = EndOfSwitchEven.GetOutPort( 'Even' ) + return GraphLoopTwoBranches_1 + + +GraphLoopTwoBranches_1 = DefGraphLoopTwoBranches_1() diff --git a/examples/GraphLoopTwoBranches.xml b/examples/GraphLoopTwoBranches.xml new file mode 100644 index 0000000..4d484bf --- /dev/null +++ b/examples/GraphLoopTwoBranches.xml @@ -0,0 +1,767 @@ + + + + + +? + ? + GraphLoopTwoBranches_1 + 1 + ? + +GraphLoopTwoBranches_1 + + +long + Loop__Index + +long + Loop__Min + +long + Loop__Max + + +boolean + EndOfSwitchOdd__Odd + +long + EndOfLoop__Index + +long + EndOfLoop__Min + +long + EndOfLoop__Max + +long + EndOfSwitchEven__a + +boolean + EndOfSwitchEven__Even + + + 4/7/2005 - 15:59:20 + 4/7/2005 - 17:43:34 + 2.0 + ? + ? + ? + 0 + 0 + + +? + ? + IsOdd + 3 + ? + +IsOdd + + +long + a + + +long + a + +long + Odd + + + +IsOdd + + + + + + 4/7/2005 - 17:38:58 + 4/7/2005 - 17:38:58 + 1.05 + ? + ? + Python function + 476 + 2 + +? + ? + SwitchOdd + 6 + EndOfSwitchOdd + +SwitchOdd + + +long + a + + +long + Odd + +int + Even + +long + default + +long + a + +string + OddEven + + + +SwitchOdd + + + + + + + + + + + 4/7/2005 - 17:38:58 + 4/7/2005 - 17:38:58 + 1.05 + ? + ? + Compute Node + 240 + 142 + +? + ? + EndOfSwitchOdd + 7 + SwitchOdd + +EndOfSwitchOdd + + +long + a + +boolean + Odd + +long + Even + +boolean + OddEven + + +long + a + +boolean + Odd + + + +EndOfSwitchOdd + + + + + 4/7/2005 - 17:38:58 + 4/7/2005 - 17:38:58 + 1.05 + ? + ? + Compute Node + 718 + 162 + +? + ? + IsEven + 3 + ? + +IsEven + + +long + a + + +long + a + +long + Even + + + +IsEven + + + + + + 4/7/2005 - 17:38:58 + 4/7/2005 - 17:38:58 + 1.05 + ? + ? + Python function + 472 + 724 + +? + ? + Loop + 4 + EndOfLoop + +Loop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +InitLoop + + + + +MoreLoop + + = Min : ]]> + + + + + +NextLoop + + + + 4/7/2005 - 17:38:58 + 4/7/2005 - 17:38:58 + 1.05 + ? + ? + Compute Node + 18 + 389 + +? + ? + EndOfLoop + 5 + Loop + +EndOfLoop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +? + + 4/7/2005 - 17:38:58 + 4/7/2005 - 17:38:58 + 1.05 + ? + ? + Compute Node + 1097 + 309 + +? + ? + SwitchEven + 6 + EndOfSwitchEven + +SwitchEven + + +long + a + + +long + Odd + +int + Even + +long + default + +int + a + +string + OddEven + + + +SwitchEven + + + + + + + + + + + + 4/7/2005 - 17:38:58 + 4/7/2005 - 17:38:58 + 1.05 + ? + ? + Compute Node + 230 + 457 + +? + ? + EndOfSwitchEven + 7 + SwitchEven + +EndOfSwitchEven + + +long + a + +boolean + Even + +long + Odd + +string + OddEven + + +long + a + +boolean + Even + + + +EndOfSwitchEven + + + + + 4/7/2005 - 17:38:58 + 4/7/2005 - 17:38:58 + 1.05 + ? + ? + Compute Node + 721 + 477 + +? + ? + IsNotOdd + 3 + ? + +IsNotOdd + + +long + Even + + +long + Even + + + +IsNotOdd + + + + + 4/7/2005 - 17:38:58 + 4/7/2005 - 17:38:58 + 2.0 + ? + ? + Compute Node + 477 + 137 + +? + ? + IsNotEven + 3 + ? + +IsNotEven + + +long + Odd + + +long + Odd + + + +IsNotEven + + + + + 4/7/2005 - 17:38:58 + 4/7/2005 - 17:38:58 + 2.0 + ? + ? + Compute Node + 475 + 601 + +? + ? + IsOdddefault + 3 + ? + +IsOdddefault + + +long + a + + +long + a + +long + Odd + + + +IsOdddefault + + + + + + 4/7/2005 - 17:38:58 + 4/7/2005 - 17:38:58 + 2.0 + ? + ? + Compute Node + 477 + 285 + +? + ? + IsEvendefault + 3 + ? + +IsEvendefault + + +long + a + + +long + a + +long + Even + + + +IsEvendefault + + + + + + 4/7/2005 - 17:38:58 + 4/7/2005 - 17:38:58 + 2.0 + ? + ? + Compute Node + 478 + 434 + + +IsOdd + a + EndOfSwitchOdd + a + + +IsOdd + Odd + EndOfSwitchOdd + Odd + + +SwitchOdd + Odd + IsOdd + Gate + + +SwitchOdd + Even + IsNotOdd + Even + + +SwitchOdd + default + IsOdddefault + Gate + + +SwitchOdd + a + IsOdddefault + a + + +SwitchOdd + a + IsOdd + a + + +SwitchOdd + OddEven + EndOfSwitchOdd + OddEven + + +SwitchOdd + Default + EndOfSwitchOdd + Default + + +EndOfSwitchOdd + a + EndOfLoop + Index + + +IsEven + a + EndOfSwitchEven + a + + +IsEven + Even + EndOfSwitchEven + Even + + +Loop + DoLoop + EndOfLoop + DoLoop + + +Loop + Index + SwitchOdd + a + + +Loop + Index + SwitchEven + a + + +Loop + Min + EndOfLoop + Min + + +Loop + Max + EndOfLoop + Max + + +EndOfLoop + DoLoop + Loop + DoLoop + + +SwitchEven + Odd + IsNotEven + Odd + + +SwitchEven + Even + IsEven + Gate + + +SwitchEven + default + IsEvendefault + Gate + + +SwitchEven + a + IsEven + a + + +SwitchEven + a + IsEvendefault + a + + +SwitchEven + OddEven + EndOfSwitchEven + OddEven + + +SwitchEven + Default + EndOfSwitchEven + Default + + +EndOfSwitchEven + Gate + EndOfLoop + Gate + + +IsNotOdd + Even + EndOfSwitchOdd + Even + + +IsNotEven + Odd + EndOfSwitchEven + Odd + + +IsOdddefault + a + EndOfSwitchOdd + a + + +IsOdddefault + Odd + EndOfSwitchOdd + Odd + + +IsEvendefault + a + EndOfSwitchEven + a + + +IsEvendefault + Even + EndOfSwitchEven + Even + + + +GraphLoopTwoBranches_1 + Loop__Index + Loop + Index + +3 + 0 + + +GraphLoopTwoBranches_1 + Loop__Min + Loop + Min + +3 + -5 + + +GraphLoopTwoBranches_1 + Loop__Max + Loop + Max + +3 + 11 + diff --git a/examples/GraphLoopsGates.py b/examples/GraphLoopsGates.py index 9d63e77..32a276c 100644 --- a/examples/GraphLoopsGates.py +++ b/examples/GraphLoopsGates.py @@ -104,7 +104,7 @@ def DefGraphLoopsGates_1() : EndInit.SetName( 'EndInit' ) EndInit.SetAuthor( '' ) EndInit.SetComment( 'Compute Node' ) - EndInit.Coords( 851 , 200 ) + EndInit.Coords( 838 , 243 ) PyEndInit = [] EndInit.SetPyFunction( 'EndInit' , PyEndInit ) IInitDoLoop = Init.GetInPort( 'DoLoop' ) @@ -210,7 +210,7 @@ def DefGraphLoopsGates_1() : LSub_1GateGateG2 = GraphLoopsGates_1.Link( OSub_1Gate , IGateG2 ) - LGateGEndInitGate = GraphLoopsGates_1.Link( OGateG , IEndInitGate ) + LGateGateEndInitGate = GraphLoopsGates_1.Link( OGateGate , IEndInitGate ) LInit_1IndexEndInit_1Index = GraphLoopsGates_1.Link( OInit_1Index , IEndInit_1Index ) @@ -246,6 +246,7 @@ def DefGraphLoopsGates_1() : #OAdd_1z = Add_1.GetOutPort( 'z' ) #OSubz = Sub.GetOutPort( 'z' ) #OSub_1z = Sub_1.GetOutPort( 'z' ) + #OGateG = Gate.GetOutPort( 'G' ) #OEndInit_1Index = EndInit_1.GetOutPort( 'Index' ) #OEndInit_1Min = EndInit_1.GetOutPort( 'Min' ) #OEndInit_1Max = EndInit_1.GetOutPort( 'Max' ) diff --git a/examples/GraphLoopsGates.xml b/examples/GraphLoopsGates.xml index 38c05b6..0fdc0dc 100644 --- a/examples/GraphLoopsGates.xml +++ b/examples/GraphLoopsGates.xml @@ -70,6 +70,9 @@ double Sub_1__z +long + Gate__G + long EndInit_1__Index @@ -81,7 +84,7 @@ 7/1/2005 - 16:57:1 - 7/1/2005 - 17:57:7 + 5/7/2005 - 16:16:19 2.0 JR ? @@ -141,8 +144,8 @@ - 7/1/2005 - 17:57:7 - 7/1/2005 - 17:57:7 + 5/7/2005 - 16:15:13 + 5/7/2005 - 16:15:13 2.0 ? ? @@ -182,14 +185,14 @@ EndInit - 7/1/2005 - 17:57:7 - 7/1/2005 - 17:57:7 + 5/7/2005 - 16:15:13 + 5/7/2005 - 16:15:13 2.0 ? ? Compute Node - 851 - 200 + 838 + 243 AddComponent AddComponent @@ -214,8 +217,8 @@ z - 7/1/2005 - 17:57:7 - 7/1/2005 - 17:57:7 + 5/7/2005 - 16:15:13 + 5/7/2005 - 16:15:13 2.0 ? localhost/FactoryServer @@ -246,8 +249,8 @@ z - 7/1/2005 - 17:57:7 - 7/1/2005 - 17:57:7 + 5/7/2005 - 16:15:13 + 5/7/2005 - 16:15:13 2.0 ? localhost/FactoryServer @@ -275,8 +278,8 @@ z - 7/1/2005 - 17:57:7 - 7/1/2005 - 17:57:7 + 5/7/2005 - 16:15:13 + 5/7/2005 - 16:15:13 2.0 ? localhost/FactoryServer @@ -304,8 +307,8 @@ z - 7/1/2005 - 17:57:7 - 7/1/2005 - 17:57:7 + 5/7/2005 - 16:15:13 + 5/7/2005 - 16:15:13 2.0 ? localhost/FactoryServer @@ -339,8 +342,8 @@ - 7/1/2005 - 17:57:7 - 7/1/2005 - 17:57:7 + 5/7/2005 - 16:15:13 + 5/7/2005 - 16:15:13 2.0 ? ? @@ -399,8 +402,8 @@ - 7/1/2005 - 17:57:7 - 7/1/2005 - 17:57:7 + 5/7/2005 - 16:15:13 + 5/7/2005 - 16:15:13 2.0 ? ? @@ -440,8 +443,8 @@ EndInit_1 - 7/1/2005 - 17:57:7 - 7/1/2005 - 17:57:7 + 5/7/2005 - 16:15:13 + 5/7/2005 - 16:15:13 2.0 ? ? @@ -547,7 +550,7 @@ Gate - G + Gate EndInit Gate diff --git a/examples/GraphLoopsStupidCoupledSwitchs.py b/examples/GraphLoopsStupidCoupledSwitchs.py new file mode 100644 index 0000000..6119a43 --- /dev/null +++ b/examples/GraphLoopsStupidCoupledSwitchs.py @@ -0,0 +1,273 @@ + +# Generated python file of Graph GraphLoopsStupidCoupledSwitchs + +from SuperV import * + +# Graph creation of GraphLoopsStupidCoupledSwitchs +def DefGraphLoopsStupidCoupledSwitchs() : + GraphLoopsStupidCoupledSwitchs = Graph( 'GraphLoopsStupidCoupledSwitchs' ) + GraphLoopsStupidCoupledSwitchs.SetName( 'GraphLoopsStupidCoupledSwitchs' ) + GraphLoopsStupidCoupledSwitchs.SetAuthor( '' ) + GraphLoopsStupidCoupledSwitchs.SetComment( '' ) + GraphLoopsStupidCoupledSwitchs.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsOdd = [] + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd(a) : ' ) + PyIsOdd.append( ' print a,"IsOdd (GraphSwitchs)" ' ) + PyIsOdd.append( ' sleep( 1 ) ' ) + PyIsOdd.append( ' return a ' ) + IsOdd = GraphLoopsStupidCoupledSwitchs.INode( 'IsOdd' , PyIsOdd ) + IsOdd.SetName( 'IsOdd' ) + IsOdd.SetAuthor( '' ) + IsOdd.SetComment( 'Python function' ) + IsOdd.Coords( 458 , 52 ) + IIsOdda = IsOdd.InPort( 'a' , 'long' ) + IIsOddGate = IsOdd.GetInPort( 'Gate' ) + OIsOdda = IsOdd.OutPort( 'a' , 'long' ) + OIsOddGate = IsOdd.GetOutPort( 'Gate' ) + + PyIsOdd_1 = [] + PyIsOdd_1.append( 'from time import * ' ) + PyIsOdd_1.append( 'def IsOdd(a) : ' ) + PyIsOdd_1.append( ' print a,"IsOdd_1 (GraphSwitchs)" ' ) + PyIsOdd_1.append( ' sleep( 1 ) ' ) + PyIsOdd_1.append( ' return a ' ) + IsOdd_1 = GraphLoopsStupidCoupledSwitchs.INode( 'IsOdd' , PyIsOdd_1 ) + IsOdd_1.SetName( 'IsOdd_1' ) + IsOdd_1.SetAuthor( '' ) + IsOdd_1.SetComment( 'Python function' ) + IsOdd_1.Coords( 487 , 321 ) + IIsOdd_1a = IsOdd_1.InPort( 'a' , 'long' ) + IIsOdd_1Gate = IsOdd_1.GetInPort( 'Gate' ) + OIsOdd_1a = IsOdd_1.OutPort( 'a' , 'long' ) + OIsOdd_1Gate = IsOdd_1.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyInitLoopSwitch = [] + PyInitLoopSwitch.append( 'def InitLoop(Index,Min,Max) : ' ) + PyInitLoopSwitch.append( ' return Index,Min,Max ' ) + PyMoreInitLoopSwitch = [] + PyMoreInitLoopSwitch.append( 'def MoreLoop(Index,Min,Max) : ' ) + PyMoreInitLoopSwitch.append( ' if Index <= Max : ' ) + PyMoreInitLoopSwitch.append( ' DoLoop = 1 ' ) + PyMoreInitLoopSwitch.append( ' else : ' ) + PyMoreInitLoopSwitch.append( ' DoLoop = 0 ' ) + PyMoreInitLoopSwitch.append( ' return DoLoop,Index,Min,Max ' ) + PyNextInitLoopSwitch = [] + PyNextInitLoopSwitch.append( 'def NextLoop(Index,Min,Max) : ' ) + PyNextInitLoopSwitch.append( ' Index = Index + 1 ' ) + PyNextInitLoopSwitch.append( ' return Index,Min,Max ' ) + InitLoopSwitch,EndOfInitLoopSwitch = GraphLoopsStupidCoupledSwitchs.LNode( 'InitLoop' , PyInitLoopSwitch , 'MoreLoop' , PyMoreInitLoopSwitch , 'NextLoop' , PyNextInitLoopSwitch ) + EndOfInitLoopSwitch.SetName( 'EndOfInitLoopSwitch' ) + EndOfInitLoopSwitch.SetAuthor( '' ) + EndOfInitLoopSwitch.SetComment( 'Compute Node' ) + EndOfInitLoopSwitch.Coords( 955 , 122 ) + PyEndOfInitLoopSwitch = [] + EndOfInitLoopSwitch.SetPyFunction( '' , PyEndOfInitLoopSwitch ) + IInitLoopSwitchDoLoop = InitLoopSwitch.GetInPort( 'DoLoop' ) + IInitLoopSwitchIndex = InitLoopSwitch.InPort( 'Index' , 'long' ) + IInitLoopSwitchMin = InitLoopSwitch.InPort( 'Min' , 'long' ) + IInitLoopSwitchMax = InitLoopSwitch.InPort( 'Max' , 'long' ) + IInitLoopSwitchGate = InitLoopSwitch.GetInPort( 'Gate' ) + OInitLoopSwitchDoLoop = InitLoopSwitch.GetOutPort( 'DoLoop' ) + OInitLoopSwitchIndex = InitLoopSwitch.GetOutPort( 'Index' ) + OInitLoopSwitchMin = InitLoopSwitch.GetOutPort( 'Min' ) + OInitLoopSwitchMax = InitLoopSwitch.GetOutPort( 'Max' ) + IEndOfInitLoopSwitchDoLoop = EndOfInitLoopSwitch.GetInPort( 'DoLoop' ) + IEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetInPort( 'Index' ) + IEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetInPort( 'Min' ) + IEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetInPort( 'Max' ) + IEndOfInitLoopSwitchGate = EndOfInitLoopSwitch.GetInPort( 'Gate' ) + OEndOfInitLoopSwitchDoLoop = EndOfInitLoopSwitch.GetOutPort( 'DoLoop' ) + OEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetOutPort( 'Index' ) + OEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetOutPort( 'Min' ) + OEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetOutPort( 'Max' ) + OEndOfInitLoopSwitchGate = EndOfInitLoopSwitch.GetOutPort( 'Gate' ) + InitLoopSwitch.SetName( 'InitLoopSwitch' ) + InitLoopSwitch.SetAuthor( '' ) + InitLoopSwitch.SetComment( 'Compute Node' ) + InitLoopSwitch.Coords( 14 , 136 ) + + PyInitLoop = [] + PyInitLoop.append( 'def InitLoop(Index,Min,Max) : ' ) + PyInitLoop.append( ' return Index,Min,Max ' ) + PyMoreInitLoop = [] + PyMoreInitLoop.append( 'def MoreLoop(Index,Min,Max) : ' ) + PyMoreInitLoop.append( ' if Index <= Max : ' ) + PyMoreInitLoop.append( ' DoLoop = 1 ' ) + PyMoreInitLoop.append( ' else : ' ) + PyMoreInitLoop.append( ' DoLoop = 0 ' ) + PyMoreInitLoop.append( ' return DoLoop,Index,Min,Max ' ) + PyNextInitLoop = [] + PyNextInitLoop.append( 'def NextLoop(Index,Min,Max) : ' ) + PyNextInitLoop.append( ' Index = Index + 1 ' ) + PyNextInitLoop.append( ' return Index,Min,Max ' ) + InitLoop,EndOfInitLoop = GraphLoopsStupidCoupledSwitchs.LNode( 'InitLoop' , PyInitLoop , 'MoreLoop' , PyMoreInitLoop , 'NextLoop' , PyNextInitLoop ) + EndOfInitLoop.SetName( 'EndOfInitLoop' ) + EndOfInitLoop.SetAuthor( '' ) + EndOfInitLoop.SetComment( 'Compute Node' ) + EndOfInitLoop.Coords( 961 , 369 ) + PyEndOfInitLoop = [] + EndOfInitLoop.SetPyFunction( '' , PyEndOfInitLoop ) + IInitLoopDoLoop = InitLoop.GetInPort( 'DoLoop' ) + IInitLoopIndex = InitLoop.InPort( 'Index' , 'long' ) + IInitLoopMin = InitLoop.InPort( 'Min' , 'long' ) + IInitLoopMax = InitLoop.InPort( 'Max' , 'long' ) + IInitLoopGate = InitLoop.GetInPort( 'Gate' ) + OInitLoopDoLoop = InitLoop.GetOutPort( 'DoLoop' ) + OInitLoopIndex = InitLoop.GetOutPort( 'Index' ) + OInitLoopMin = InitLoop.GetOutPort( 'Min' ) + OInitLoopMax = InitLoop.GetOutPort( 'Max' ) + IEndOfInitLoopDoLoop = EndOfInitLoop.GetInPort( 'DoLoop' ) + IEndOfInitLoopIndex = EndOfInitLoop.GetInPort( 'Index' ) + IEndOfInitLoopMin = EndOfInitLoop.GetInPort( 'Min' ) + IEndOfInitLoopMax = EndOfInitLoop.GetInPort( 'Max' ) + IEndOfInitLoopGate = EndOfInitLoop.GetInPort( 'Gate' ) + OEndOfInitLoopDoLoop = EndOfInitLoop.GetOutPort( 'DoLoop' ) + OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) + OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) + OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) + OEndOfInitLoopGate = EndOfInitLoop.GetOutPort( 'Gate' ) + InitLoop.SetName( 'InitLoop' ) + InitLoop.SetAuthor( '' ) + InitLoop.SetComment( 'Compute Node' ) + InitLoop.Coords( 10 , 391 ) + + # Creation of Switch Nodes + PySwitch = [] + PySwitch.append( 'from time import * ' ) + PySwitch.append( 'def Switch(a) : ' ) + PySwitch.append( ' if ( a & 1 ) == 0 : ' ) + PySwitch.append( ' sleep(1) ' ) + PySwitch.append( ' return a & 1,1-(a&1),a ' ) + Switch,EndOfSwitch = GraphLoopsStupidCoupledSwitchs.SNode( 'Switch' , PySwitch ) + EndOfSwitch.SetName( 'EndOfSwitch' ) + EndOfSwitch.SetAuthor( '' ) + EndOfSwitch.SetComment( 'Compute Node' ) + EndOfSwitch.Coords( 690 , 129 ) + PyEndOfSwitch = [] + EndOfSwitch.SetPyFunction( '' , PyEndOfSwitch ) + IEndOfSwitcha = EndOfSwitch.InPort( 'a' , 'long' ) + IEndOfSwitchDefault = EndOfSwitch.GetInPort( 'Default' ) + OEndOfSwitcha = EndOfSwitch.OutPort( 'a' , 'long' ) + OEndOfSwitchGate = EndOfSwitch.GetOutPort( 'Gate' ) + Switch.SetName( 'Switch' ) + Switch.SetAuthor( '' ) + Switch.SetComment( 'Compute Node' ) + Switch.Coords( 245 , 136 ) + ISwitcha = Switch.InPort( 'a' , 'long' ) + ISwitchGate = Switch.GetInPort( 'Gate' ) + OSwitchOdd = Switch.OutPort( 'Odd' , 'long' ) + OSwitchEven = Switch.OutPort( 'Even' , 'int' ) + OSwitcha = Switch.OutPort( 'a' , 'int' ) + OSwitchDefault = Switch.GetOutPort( 'Default' ) + + PySwitch_1 = [] + PySwitch_1.append( 'from time import * ' ) + PySwitch_1.append( 'def Switch(a) : ' ) + PySwitch_1.append( ' if ( a & 1 ) == 0 : ' ) + PySwitch_1.append( ' sleep(1) ' ) + PySwitch_1.append( ' return a & 1,1-(a&1),a ' ) + Switch_1,EndSwitch = GraphLoopsStupidCoupledSwitchs.SNode( 'Switch' , PySwitch_1 ) + EndSwitch.SetName( 'EndSwitch' ) + EndSwitch.SetAuthor( '' ) + EndSwitch.SetComment( 'Compute Node' ) + EndSwitch.Coords( 695 , 387 ) + PyEndSwitch = [] + EndSwitch.SetPyFunction( '' , PyEndSwitch ) + IEndSwitcha = EndSwitch.InPort( 'a' , 'long' ) + IEndSwitchDefault = EndSwitch.GetInPort( 'Default' ) + OEndSwitcha = EndSwitch.OutPort( 'a' , 'long' ) + OEndSwitchGate = EndSwitch.GetOutPort( 'Gate' ) + Switch_1.SetName( 'Switch_1' ) + Switch_1.SetAuthor( '' ) + Switch_1.SetComment( 'Compute Node' ) + Switch_1.Coords( 258 , 391 ) + ISwitch_1a = Switch_1.InPort( 'a' , 'long' ) + ISwitch_1Gate = Switch_1.GetInPort( 'Gate' ) + OSwitch_1Odd = Switch_1.OutPort( 'Odd' , 'long' ) + OSwitch_1Even = Switch_1.OutPort( 'Even' , 'int' ) + OSwitch_1a = Switch_1.OutPort( 'a' , 'int' ) + OSwitch_1Default = Switch_1.GetOutPort( 'Default' ) + + # Creation of Links + LIsOddaEndOfSwitcha = GraphLoopsStupidCoupledSwitchs.Link( OIsOdda , IEndOfSwitcha ) + + LIsOddGateEndOfSwitchDefault = GraphLoopsStupidCoupledSwitchs.Link( OIsOddGate , IEndOfSwitchDefault ) + + LInitLoopSwitchIndexSwitcha = GraphLoopsStupidCoupledSwitchs.Link( OInitLoopSwitchIndex , ISwitcha ) + + LInitLoopSwitchMinEndOfInitLoopSwitchMin = GraphLoopsStupidCoupledSwitchs.Link( OInitLoopSwitchMin , IEndOfInitLoopSwitchMin ) + + LInitLoopSwitchMaxEndOfInitLoopSwitchMax = GraphLoopsStupidCoupledSwitchs.Link( OInitLoopSwitchMax , IEndOfInitLoopSwitchMax ) + + LInitLoopSwitchGateEndSwitchDefault = GraphLoopsStupidCoupledSwitchs.Link( OInitLoopSwitchGate , IEndSwitchDefault ) + + LSwitchaIsOdda = GraphLoopsStupidCoupledSwitchs.Link( OSwitcha , IIsOdda ) + + LSwitchDefaultEndSwitchDefault = GraphLoopsStupidCoupledSwitchs.Link( OSwitchDefault , IEndSwitchDefault ) + + LEndOfSwitchaEndOfInitLoopSwitchIndex = GraphLoopsStupidCoupledSwitchs.Link( OEndOfSwitcha , IEndOfInitLoopSwitchIndex ) + + LIsOdd_1aEndSwitcha = GraphLoopsStupidCoupledSwitchs.Link( OIsOdd_1a , IEndSwitcha ) + + LIsOdd_1GateEndSwitchDefault = GraphLoopsStupidCoupledSwitchs.Link( OIsOdd_1Gate , IEndSwitchDefault ) + + LIsOdd_1GateEndOfSwitchDefault = GraphLoopsStupidCoupledSwitchs.Link( OIsOdd_1Gate , IEndOfSwitchDefault ) + + LInitLoopIndexSwitch_1a = GraphLoopsStupidCoupledSwitchs.Link( OInitLoopIndex , ISwitch_1a ) + + LInitLoopMinEndOfInitLoopMin = GraphLoopsStupidCoupledSwitchs.Link( OInitLoopMin , IEndOfInitLoopMin ) + + LInitLoopMaxEndOfInitLoopMax = GraphLoopsStupidCoupledSwitchs.Link( OInitLoopMax , IEndOfInitLoopMax ) + + LInitLoopGateSwitchGate = GraphLoopsStupidCoupledSwitchs.Link( OInitLoopGate , ISwitchGate ) + + LInitLoopGateSwitch_1Gate = GraphLoopsStupidCoupledSwitchs.Link( OInitLoopGate , ISwitch_1Gate ) + + LInitLoopGateIsOdd_1Gate = GraphLoopsStupidCoupledSwitchs.Link( OInitLoopGate , IIsOdd_1Gate ) + + LInitLoopGateEndOfSwitchDefault = GraphLoopsStupidCoupledSwitchs.Link( OInitLoopGate , IEndOfSwitchDefault ) + + LSwitch_1EvenEndSwitchDefault = GraphLoopsStupidCoupledSwitchs.Link( OSwitch_1Even , IEndSwitchDefault ) + + LSwitch_1aIsOdd_1a = GraphLoopsStupidCoupledSwitchs.Link( OSwitch_1a , IIsOdd_1a ) + + LSwitch_1DefaultIsOddGate = GraphLoopsStupidCoupledSwitchs.Link( OSwitch_1Default , IIsOddGate ) + + LSwitch_1DefaultEndOfSwitchDefault = GraphLoopsStupidCoupledSwitchs.Link( OSwitch_1Default , IEndOfSwitchDefault ) + + LSwitch_1DefaultEndOfInitLoopSwitchGate = GraphLoopsStupidCoupledSwitchs.Link( OSwitch_1Default , IEndOfInitLoopSwitchGate ) + + LSwitch_1DefaultEndOfInitLoopGate = GraphLoopsStupidCoupledSwitchs.Link( OSwitch_1Default , IEndOfInitLoopGate ) + + LSwitch_1DefaultEndSwitchDefault = GraphLoopsStupidCoupledSwitchs.Link( OSwitch_1Default , IEndSwitchDefault ) + + LEndSwitchaEndOfInitLoopIndex = GraphLoopsStupidCoupledSwitchs.Link( OEndSwitcha , IEndOfInitLoopIndex ) + + # Input datas + IInitLoopSwitchIndex.Input( 0 ) + IInitLoopSwitchMin.Input( 0 ) + IInitLoopSwitchMax.Input( 20 ) + IInitLoopIndex.Input( 0 ) + IInitLoopMin.Input( 0 ) + IInitLoopMax.Input( 20 ) + + # Output Ports of the graph + #OEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetOutPort( 'Index' ) + #OEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetOutPort( 'Min' ) + #OEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetOutPort( 'Max' ) + #OSwitchOdd = Switch.GetOutPort( 'Odd' ) + #OSwitchEven = Switch.GetOutPort( 'Even' ) + #OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) + #OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) + #OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) + #OSwitch_1Odd = Switch_1.GetOutPort( 'Odd' ) + return GraphLoopsStupidCoupledSwitchs + + +GraphLoopsStupidCoupledSwitchs = DefGraphLoopsStupidCoupledSwitchs() diff --git a/examples/GraphLoopsStupidCoupledSwitchs.xml b/examples/GraphLoopsStupidCoupledSwitchs.xml new file mode 100644 index 0000000..1a90e1e --- /dev/null +++ b/examples/GraphLoopsStupidCoupledSwitchs.xml @@ -0,0 +1,706 @@ + + + + + +? + ? + GraphLoopsStupidCoupledSwitchs + 1 + ? + +GraphLoopsStupidCoupledSwitchs + + +long + InitLoopSwitch__Index + +long + InitLoopSwitch__Min + +long + InitLoopSwitch__Max + +long + InitLoop__Index + +long + InitLoop__Min + +long + InitLoop__Max + + +long + EndOfInitLoopSwitch__Index + +long + EndOfInitLoopSwitch__Min + +long + EndOfInitLoopSwitch__Max + +long + Switch__Odd + +int + Switch__Even + +long + EndOfInitLoop__Index + +long + EndOfInitLoop__Min + +long + EndOfInitLoop__Max + +long + Switch_1__Odd + + + 14/10/2003 - 10:29:4 + 29/4/2005 - 17:18:4 + 1.05 + ? + ? + ? + 0 + 0 + + +? + ? + IsOdd + 3 + ? + +IsOdd + + +long + a + + +long + a + + + +IsOdd + + + + + + 29/4/2005 - 17:8:53 + 29/4/2005 - 17:8:53 + 1.05 + ? + ? + Python function + 458 + 52 + +? + ? + InitLoopSwitch + 4 + EndOfInitLoopSwitch + +InitLoopSwitch + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +InitLoop + + + +MoreLoop + + + + + + + +NextLoop + + + + 29/4/2005 - 17:8:53 + 29/4/2005 - 17:8:53 + 1.05 + ? + ? + Compute Node + 14 + 136 + +? + ? + EndOfInitLoopSwitch + 5 + InitLoopSwitch + +EndOfInitLoopSwitch + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +? + + 29/4/2005 - 17:8:53 + 29/4/2005 - 17:8:53 + 1.05 + ? + ? + Compute Node + 955 + 122 + +? + ? + Switch + 6 + EndOfSwitch + +Switch + + +long + a + + +long + Odd + +int + Even + +int + a + + + +Switch + + + + + + 29/4/2005 - 17:8:53 + 29/4/2005 - 17:8:53 + 1.05 + ? + ? + Compute Node + 245 + 136 + +? + ? + EndOfSwitch + 7 + Switch + +EndOfSwitch + + +long + a + + +long + a + + + +? + + 29/4/2005 - 17:8:53 + 29/4/2005 - 17:8:53 + 1.05 + ? + ? + Compute Node + 690 + 129 + +? + ? + IsOdd_1 + 3 + ? + +IsOdd_1 + + +long + a + + +long + a + + + +IsOdd + + + + + + 29/4/2005 - 17:8:53 + 29/4/2005 - 17:8:53 + 1.05 + ? + ? + Python function + 487 + 321 + +? + ? + InitLoop + 4 + EndOfInitLoop + +InitLoop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +InitLoop + + + +MoreLoop + + + + + + + +NextLoop + + + + 29/4/2005 - 17:8:53 + 29/4/2005 - 17:8:53 + 1.05 + ? + ? + Compute Node + 10 + 391 + +? + ? + EndOfInitLoop + 5 + InitLoop + +EndOfInitLoop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +? + + 29/4/2005 - 17:8:53 + 29/4/2005 - 17:8:53 + 1.05 + ? + ? + Compute Node + 961 + 369 + +? + ? + Switch_1 + 6 + EndSwitch + +Switch_1 + + +long + a + + +long + Odd + +int + Even + +int + a + + + +Switch + + + + + + 29/4/2005 - 17:8:53 + 29/4/2005 - 17:8:53 + 1.05 + ? + ? + Compute Node + 258 + 391 + +? + ? + EndSwitch + 7 + Switch_1 + +EndSwitch + + +long + a + + +long + a + + + +? + + 29/4/2005 - 17:8:53 + 29/4/2005 - 17:8:53 + 1.05 + ? + ? + Compute Node + 695 + 387 + + +IsOdd + a + EndOfSwitch + a + + +IsOdd + Gate + EndOfSwitch + Default + + +InitLoopSwitch + DoLoop + EndOfInitLoopSwitch + DoLoop + + +InitLoopSwitch + Index + Switch + a + + +InitLoopSwitch + Min + EndOfInitLoopSwitch + Min + + +InitLoopSwitch + Max + EndOfInitLoopSwitch + Max + + +InitLoopSwitch + Gate + EndSwitch + Default + + +EndOfInitLoopSwitch + DoLoop + InitLoopSwitch + DoLoop + + +Switch + a + IsOdd + a + + +Switch + Default + EndSwitch + Default + + +EndOfSwitch + a + EndOfInitLoopSwitch + Index + + +IsOdd_1 + a + EndSwitch + a + + +IsOdd_1 + Gate + EndSwitch + Default + + +IsOdd_1 + Gate + EndOfSwitch + Default + + +InitLoop + DoLoop + EndOfInitLoop + DoLoop + + +InitLoop + Index + Switch_1 + a + + +InitLoop + Min + EndOfInitLoop + Min + + +InitLoop + Max + EndOfInitLoop + Max + + +InitLoop + Gate + Switch + Gate + + +InitLoop + Gate + Switch_1 + Gate + + +InitLoop + Gate + IsOdd_1 + Gate + + +InitLoop + Gate + EndOfSwitch + Default + + +EndOfInitLoop + DoLoop + InitLoop + DoLoop + + +Switch_1 + Even + EndSwitch + Default + + +Switch_1 + a + IsOdd_1 + a + + +Switch_1 + Default + IsOdd + Gate + + +Switch_1 + Default + EndOfSwitch + Default + + +Switch_1 + Default + EndOfInitLoopSwitch + Gate + + +Switch_1 + Default + EndOfInitLoop + Gate + + +Switch_1 + Default + EndSwitch + Default + + +EndSwitch + a + EndOfInitLoop + Index + + + +GraphLoopsStupidCoupledSwitchs + InitLoopSwitch__Index + InitLoopSwitch + Index + +3 + 0 + + +GraphLoopsStupidCoupledSwitchs + InitLoopSwitch__Min + InitLoopSwitch + Min + +3 + 0 + + +GraphLoopsStupidCoupledSwitchs + InitLoopSwitch__Max + InitLoopSwitch + Max + +3 + 20 + + +GraphLoopsStupidCoupledSwitchs + InitLoop__Index + InitLoop + Index + +3 + 0 + + +GraphLoopsStupidCoupledSwitchs + InitLoop__Min + InitLoop + Min + +3 + 0 + + +GraphLoopsStupidCoupledSwitchs + InitLoop__Max + InitLoop + Max + +3 + 20 + diff --git a/examples/GraphMacroNodes.py b/examples/GraphMacroNodes.py index 75fdfe0..a270184 100644 --- a/examples/GraphMacroNodes.py +++ b/examples/GraphMacroNodes.py @@ -17,8 +17,8 @@ def DefGraphMacroNodes() : Add.SetName( 'Add' ) Add.SetAuthor( '' ) Add.SetContainer( 'FactoryServer' ) - Add.SetComment( '' ) - Add.Coords( 15 , 241 ) + Add.SetComment( 'Add from AddComponent' ) + Add.Coords( 9 , 293 ) IAddx = Add.GetInPort( 'x' ) IAddy = Add.GetInPort( 'y' ) IAddGate = Add.GetInPort( 'Gate' ) @@ -30,7 +30,7 @@ def DefGraphMacroNodes() : Sub.SetName( 'Sub' ) Sub.SetAuthor( '' ) Sub.SetContainer( 'FactoryServer' ) - Sub.SetComment( '' ) + Sub.SetComment( 'Sub from SubComponent' ) Sub.Coords( 227 , 99 ) ISubx = Sub.GetInPort( 'x' ) ISuby = Sub.GetInPort( 'y' ) @@ -42,7 +42,7 @@ def DefGraphMacroNodes() : Mul.SetName( 'Mul' ) Mul.SetAuthor( '' ) Mul.SetContainer( 'FactoryServer' ) - Mul.SetComment( '' ) + Mul.SetComment( 'Mul from MulComponent' ) Mul.Coords( 443 , 278 ) IMulx = Mul.GetInPort( 'x' ) IMuly = Mul.GetInPort( 'y' ) @@ -54,7 +54,7 @@ def DefGraphMacroNodes() : Div.SetName( 'Div' ) Div.SetAuthor( '' ) Div.SetContainer( 'FactoryServer' ) - Div.SetComment( '' ) + Div.SetComment( 'Div from DivComponent' ) Div.Coords( 634 , 97 ) IDivx = Div.GetInPort( 'x' ) IDivy = Div.GetInPort( 'y' ) @@ -65,10 +65,11 @@ def DefGraphMacroNodes() : # Creation of Macro Nodes SyrStruct_1 = DefSyrStruct_1() Macro_SyrStruct = GraphMacroNodes.GraphMNode( SyrStruct_1 ) + Macro_SyrStruct.SetCoupled( 'SyrStruct_1' ) Macro_SyrStruct.SetName( 'Macro_SyrStruct' ) Macro_SyrStruct.SetAuthor( '' ) - Macro_SyrStruct.SetComment( '' ) - Macro_SyrStruct.Coords( 0 , 0 ) + Macro_SyrStruct.SetComment( 'Macro Node' ) + Macro_SyrStruct.Coords( 13 , 6 ) IMacro_SyrStructSyrComponent__aContainer = Macro_SyrStruct.GetInPort( 'SyrComponent__aContainer' ) IMacro_SyrStructSyrComponent__aComponent = Macro_SyrStruct.GetInPort( 'SyrComponent__aComponent' ) IMacro_SyrStructforN__N = Macro_SyrStruct.GetInPort( 'forN__N' ) @@ -90,10 +91,11 @@ def DefGraphMacroNodes() : SyrStruct_1_1 = DefSyrStruct_1_1() Macro_SyrStruct_1 = GraphMacroNodes.GraphMNode( SyrStruct_1_1 ) + Macro_SyrStruct_1.SetCoupled( 'SyrStruct_1_1' ) Macro_SyrStruct_1.SetName( 'Macro_SyrStruct_1' ) Macro_SyrStruct_1.SetAuthor( '' ) - Macro_SyrStruct_1.SetComment( '' ) - Macro_SyrStruct_1.Coords( 0 , 0 ) + Macro_SyrStruct_1.SetComment( 'Macro Node' ) + Macro_SyrStruct_1.Coords( 8 , 441 ) IMacro_SyrStruct_1SyrComponent__aContainer = Macro_SyrStruct_1.GetInPort( 'SyrComponent__aContainer' ) IMacro_SyrStruct_1SyrComponent__aComponent = Macro_SyrStruct_1.GetInPort( 'SyrComponent__aComponent' ) IMacro_SyrStruct_1forN__N = Macro_SyrStruct_1.GetInPort( 'forN__N' ) @@ -143,7 +145,7 @@ def DefGraphMacroNodes() : IMacro_SyrStruct_1forN__max.Input( 9 ) IMacro_SyrStruct_1fori__i.Input( 0 ) -# Output Ports of the graph + # Output Ports of the graph #OAddFuncValue = Add.GetOutPort( 'FuncValue' ) #ODivz = Div.GetOutPort( 'z' ) #OMacro_SyrStructEndOfforN__N = Macro_SyrStruct.GetOutPort( 'EndOfforN__N' ) @@ -169,6 +171,7 @@ def DefGraphMacroNodes() : # Graph creation of SyrStruct_1 def DefSyrStruct_1() : SyrStruct_1 = Graph( 'SyrStruct_1' ) + SyrStruct_1.SetCoupled( 'Macro_SyrStruct' ) SyrStruct_1.SetName( 'SyrStruct_1' ) SyrStruct_1.SetAuthor( 'JR' ) SyrStruct_1.SetComment( 'Syracuse algorithm' ) @@ -277,7 +280,7 @@ def DefSyrStruct_1() : EndOfforN.Coords( 1535 , 332 ) PyEndOfforN = [] EndOfforN.SetPyFunction( '' , PyEndOfforN ) - IforNInitLoop = forN.GetInPort( 'DoLoop' ) + IforNDoLoop = forN.GetInPort( 'DoLoop' ) IforNN = forN.InPort( 'N' , 'long' ) IforNK = forN.InPort( 'K' , 'long' ) IforNSyrComponent = forN.InPort( 'SyrComponent' , 'objref' ) @@ -303,6 +306,7 @@ def DefSyrStruct_1() : OEndOfforNSyrComponent = EndOfforN.GetOutPort( 'SyrComponent' ) OEndOfforNmin = EndOfforN.GetOutPort( 'min' ) OEndOfforNmax = EndOfforN.GetOutPort( 'max' ) + OEndOfforNGate = EndOfforN.GetOutPort( 'Gate' ) forN.SetName( 'forN' ) forN.SetAuthor( '' ) forN.SetComment( 'InitN , MoreN , NextN' ) @@ -329,7 +333,7 @@ def DefSyrStruct_1() : EndOfwhileNotOne.Coords( 1366 , 303 ) PyEndOfwhileNotOne = [] EndOfwhileNotOne.SetPyFunction( '' , PyEndOfwhileNotOne ) - IwhileNotOneInitLoop = whileNotOne.GetInPort( 'DoLoop' ) + IwhileNotOneDoLoop = whileNotOne.GetInPort( 'DoLoop' ) IwhileNotOneSyrComponent = whileNotOne.InPort( 'SyrComponent' , 'objref' ) IwhileNotOneN = whileNotOne.InPort( 'N' , 'long' ) IwhileNotOneK = whileNotOne.InPort( 'K' , 'long' ) @@ -347,6 +351,7 @@ def DefSyrStruct_1() : OEndOfwhileNotOneSyrComponent = EndOfwhileNotOne.GetOutPort( 'SyrComponent' ) OEndOfwhileNotOneN = EndOfwhileNotOne.GetOutPort( 'N' ) OEndOfwhileNotOneK = EndOfwhileNotOne.GetOutPort( 'K' ) + OEndOfwhileNotOneGate = EndOfwhileNotOne.GetOutPort( 'Gate' ) whileNotOne.SetName( 'whileNotOne' ) whileNotOne.SetAuthor( '' ) whileNotOne.SetComment( 'InitNotOne , MoreNotOne , NextNotOne' ) @@ -372,7 +377,7 @@ def DefSyrStruct_1() : EndOffori.Coords( 976 , 212 ) PyEndOffori = [] EndOffori.SetPyFunction( '' , PyEndOffori ) - IforiInitLoop = fori.GetInPort( 'DoLoop' ) + IforiDoLoop = fori.GetInPort( 'DoLoop' ) Iforii = fori.InPort( 'i' , 'long' ) IforiK = fori.InPort( 'K' , 'long' ) IforiGate = fori.GetInPort( 'Gate' ) @@ -386,6 +391,7 @@ def DefSyrStruct_1() : OEndOfforiDoLoop = EndOffori.GetOutPort( 'DoLoop' ) OEndOfforii = EndOffori.GetOutPort( 'i' ) OEndOfforiK = EndOffori.GetOutPort( 'K' ) + OEndOfforiGate = EndOffori.GetOutPort( 'Gate' ) fori.SetName( 'fori' ) fori.SetAuthor( '' ) fori.SetComment( 'Initfori, Morefori, Nextfori' ) @@ -411,7 +417,7 @@ def DefSyrStruct_1() : EndOfwhileEven.Coords( 988 , 451 ) PyEndOfwhileEven = [] EndOfwhileEven.SetPyFunction( '' , PyEndOfwhileEven ) - IwhileEvenInitLoop = whileEven.GetInPort( 'DoLoop' ) + IwhileEvenDoLoop = whileEven.GetInPort( 'DoLoop' ) IwhileEvenSyrComponent = whileEven.InPort( 'SyrComponent' , 'objref' ) IwhileEvenN = whileEven.InPort( 'N' , 'long' ) IwhileEvenK = whileEven.InPort( 'K' , 'long' ) @@ -429,6 +435,7 @@ def DefSyrStruct_1() : OEndOfwhileEvenSyrComponent = EndOfwhileEven.GetOutPort( 'SyrComponent' ) OEndOfwhileEvenN = EndOfwhileEven.GetOutPort( 'N' ) OEndOfwhileEvenK = EndOfwhileEven.GetOutPort( 'K' ) + OEndOfwhileEvenGate = EndOfwhileEven.GetOutPort( 'Gate' ) whileEven.SetName( 'whileEven' ) whileEven.SetAuthor( '' ) whileEven.SetComment( 'InitEven, MoreEven, NextEven' ) @@ -589,7 +596,7 @@ def DefSyrStruct_1() : #IforNmax = forN.GetInPort( 'max' ) #Iforii = fori.GetInPort( 'i' ) -# Output Ports of the graph + # Output Ports of the graph #OEndOfforNN = EndOfforN.GetOutPort( 'N' ) #OEndOfforNK = EndOfforN.GetOutPort( 'K' ) #OEndOfforNSyrComponent = EndOfforN.GetOutPort( 'SyrComponent' ) @@ -604,6 +611,7 @@ def DefSyrStruct_1() : # Graph creation of SyrStruct_1_1 def DefSyrStruct_1_1() : SyrStruct_1_1 = Graph( 'SyrStruct_1_1' ) + SyrStruct_1_1.SetCoupled( 'Macro_SyrStruct_1' ) SyrStruct_1_1.SetName( 'SyrStruct_1_1' ) SyrStruct_1_1.SetAuthor( 'JR' ) SyrStruct_1_1.SetComment( 'Syracuse algorithm' ) @@ -712,7 +720,7 @@ def DefSyrStruct_1_1() : EndOfforN.Coords( 1535 , 332 ) PyEndOfforN = [] EndOfforN.SetPyFunction( '' , PyEndOfforN ) - IforNInitLoop = forN.GetInPort( 'DoLoop' ) + IforNDoLoop = forN.GetInPort( 'DoLoop' ) IforNN = forN.InPort( 'N' , 'long' ) IforNK = forN.InPort( 'K' , 'long' ) IforNSyrComponent = forN.InPort( 'SyrComponent' , 'objref' ) @@ -738,6 +746,7 @@ def DefSyrStruct_1_1() : OEndOfforNSyrComponent = EndOfforN.GetOutPort( 'SyrComponent' ) OEndOfforNmin = EndOfforN.GetOutPort( 'min' ) OEndOfforNmax = EndOfforN.GetOutPort( 'max' ) + OEndOfforNGate = EndOfforN.GetOutPort( 'Gate' ) forN.SetName( 'forN' ) forN.SetAuthor( '' ) forN.SetComment( 'InitN , MoreN , NextN' ) @@ -764,7 +773,7 @@ def DefSyrStruct_1_1() : EndOfwhileNotOne.Coords( 1366 , 303 ) PyEndOfwhileNotOne = [] EndOfwhileNotOne.SetPyFunction( '' , PyEndOfwhileNotOne ) - IwhileNotOneInitLoop = whileNotOne.GetInPort( 'DoLoop' ) + IwhileNotOneDoLoop = whileNotOne.GetInPort( 'DoLoop' ) IwhileNotOneSyrComponent = whileNotOne.InPort( 'SyrComponent' , 'objref' ) IwhileNotOneN = whileNotOne.InPort( 'N' , 'long' ) IwhileNotOneK = whileNotOne.InPort( 'K' , 'long' ) @@ -782,6 +791,7 @@ def DefSyrStruct_1_1() : OEndOfwhileNotOneSyrComponent = EndOfwhileNotOne.GetOutPort( 'SyrComponent' ) OEndOfwhileNotOneN = EndOfwhileNotOne.GetOutPort( 'N' ) OEndOfwhileNotOneK = EndOfwhileNotOne.GetOutPort( 'K' ) + OEndOfwhileNotOneGate = EndOfwhileNotOne.GetOutPort( 'Gate' ) whileNotOne.SetName( 'whileNotOne' ) whileNotOne.SetAuthor( '' ) whileNotOne.SetComment( 'InitNotOne , MoreNotOne , NextNotOne' ) @@ -807,7 +817,7 @@ def DefSyrStruct_1_1() : EndOffori.Coords( 976 , 212 ) PyEndOffori = [] EndOffori.SetPyFunction( '' , PyEndOffori ) - IforiInitLoop = fori.GetInPort( 'DoLoop' ) + IforiDoLoop = fori.GetInPort( 'DoLoop' ) Iforii = fori.InPort( 'i' , 'long' ) IforiK = fori.InPort( 'K' , 'long' ) IforiGate = fori.GetInPort( 'Gate' ) @@ -821,6 +831,7 @@ def DefSyrStruct_1_1() : OEndOfforiDoLoop = EndOffori.GetOutPort( 'DoLoop' ) OEndOfforii = EndOffori.GetOutPort( 'i' ) OEndOfforiK = EndOffori.GetOutPort( 'K' ) + OEndOfforiGate = EndOffori.GetOutPort( 'Gate' ) fori.SetName( 'fori' ) fori.SetAuthor( '' ) fori.SetComment( 'Initfori, Morefori, Nextfori' ) @@ -846,7 +857,7 @@ def DefSyrStruct_1_1() : EndOfwhileEven.Coords( 988 , 451 ) PyEndOfwhileEven = [] EndOfwhileEven.SetPyFunction( '' , PyEndOfwhileEven ) - IwhileEvenInitLoop = whileEven.GetInPort( 'DoLoop' ) + IwhileEvenDoLoop = whileEven.GetInPort( 'DoLoop' ) IwhileEvenSyrComponent = whileEven.InPort( 'SyrComponent' , 'objref' ) IwhileEvenN = whileEven.InPort( 'N' , 'long' ) IwhileEvenK = whileEven.InPort( 'K' , 'long' ) @@ -864,6 +875,7 @@ def DefSyrStruct_1_1() : OEndOfwhileEvenSyrComponent = EndOfwhileEven.GetOutPort( 'SyrComponent' ) OEndOfwhileEvenN = EndOfwhileEven.GetOutPort( 'N' ) OEndOfwhileEvenK = EndOfwhileEven.GetOutPort( 'K' ) + OEndOfwhileEvenGate = EndOfwhileEven.GetOutPort( 'Gate' ) whileEven.SetName( 'whileEven' ) whileEven.SetAuthor( '' ) whileEven.SetComment( 'InitEven, MoreEven, NextEven' ) @@ -1024,7 +1036,7 @@ def DefSyrStruct_1_1() : #IforNmax = forN.GetInPort( 'max' ) #Iforii = fori.GetInPort( 'i' ) -# Output Ports of the graph + # Output Ports of the graph #OEndOfforNN = EndOfforN.GetOutPort( 'N' ) #OEndOfforNK = EndOfforN.GetOutPort( 'K' ) #OEndOfforNSyrComponent = EndOfforN.GetOutPort( 'SyrComponent' ) diff --git a/examples/GraphMacroNodes.xml b/examples/GraphMacroNodes.xml index 584f9f3..f02edb5 100644 --- a/examples/GraphMacroNodes.xml +++ b/examples/GraphMacroNodes.xml @@ -126,7 +126,7 @@ 15/6/2004 - 10:28:51 - 15/6/2004 - 10:28:54 + 4/5/2005 - 14:6:2 2.0 ? ? @@ -158,14 +158,14 @@ z - 15/6/2004 - 10:28:51 - 15/6/2004 - 10:28:51 + 4/5/2005 - 14:6:2 + 4/5/2005 - 14:6:2 2.0 ? FactoryServer - ? - 15 - 241 + Add from AddComponent + 9 + 293 SubComponent SubComponent @@ -187,12 +187,12 @@ z - 15/6/2004 - 10:28:51 - 15/6/2004 - 10:28:51 + 4/5/2005 - 14:6:2 + 4/5/2005 - 14:6:2 2.0 ? FactoryServer - ? + Sub from SubComponent 227 99 @@ -216,12 +216,12 @@ z - 15/6/2004 - 10:28:51 - 15/6/2004 - 10:28:51 + 4/5/2005 - 14:6:2 + 4/5/2005 - 14:6:2 2.0 ? FactoryServer - ? + Mul from MulComponent 443 278 @@ -245,12 +245,12 @@ z - 15/6/2004 - 10:28:51 - 15/6/2004 - 10:28:51 + 4/5/2005 - 14:6:2 + 4/5/2005 - 14:6:2 2.0 ? FactoryServer - ? + Div from DivComponent 634 97 @@ -316,14 +316,14 @@ ? - 15/6/2004 - 10:28:52 - 15/6/2004 - 10:28:52 + 4/5/2005 - 14:6:2 + 4/5/2005 - 14:6:2 2.0 ? ? - ? - 0 - 0 + Macro Node + 13 + 6 ? ? @@ -387,14 +387,14 @@ ? - 15/6/2004 - 10:28:54 - 15/6/2004 - 10:28:54 + 4/5/2005 - 14:6:2 + 4/5/2005 - 14:6:2 2.0 ? ? - ? - 0 - 0 + Macro Node + 8 + 441 Add @@ -643,7 +643,7 @@ 15/6/2004 - 10:28:51 - 15/6/2004 - 10:28:52 + 4/5/2005 - 14:6:2 2.0 JR ? @@ -669,8 +669,8 @@ anInteger - 15/6/2004 - 10:28:51 - 15/6/2004 - 10:28:51 + 4/5/2005 - 14:6:2 + 4/5/2005 - 14:6:2 2.0 ? localhost/FactoryServer @@ -695,8 +695,8 @@ aNewCount - 15/6/2004 - 10:28:51 - 15/6/2004 - 10:28:51 + 4/5/2005 - 14:6:2 + 4/5/2005 - 14:6:2 2.0 ? localhost/FactoryServer @@ -721,8 +721,8 @@ aNewCount - 15/6/2004 - 10:28:51 - 15/6/2004 - 10:28:51 + 4/5/2005 - 14:6:2 + 4/5/2005 - 14:6:2 2.0 ? localhost/FactoryServer @@ -747,8 +747,8 @@ anInteger - 15/6/2004 - 10:28:51 - 15/6/2004 - 10:28:51 + 4/5/2005 - 14:6:2 + 4/5/2005 - 14:6:2 2.0 ? localhost/FactoryServer @@ -773,8 +773,8 @@ aNewCount - 15/6/2004 - 10:28:51 - 15/6/2004 - 10:28:51 + 4/5/2005 - 14:6:2 + 4/5/2005 - 14:6:2 2.0 ? localhost/FactoryServer @@ -810,8 +810,8 @@ - 15/6/2004 - 10:28:51 - 15/6/2004 - 10:28:51 + 4/5/2005 - 14:6:2 + 4/5/2005 - 14:6:2 2.0 ? ? @@ -825,7 +825,7 @@ 4 EndOfforN -InitN +forN long @@ -882,8 +882,8 @@ - 15/6/2004 - 10:28:51 - 15/6/2004 - 10:28:51 + 4/5/2005 - 14:6:2 + 4/5/2005 - 14:6:2 2.0 ? ? @@ -897,7 +897,7 @@ 5 forN -EndInitN +EndOfforN long @@ -935,8 +935,8 @@ ? - 15/6/2004 - 10:28:51 - 15/6/2004 - 10:28:51 + 4/5/2005 - 14:6:2 + 4/5/2005 - 14:6:2 2.0 ? ? @@ -950,7 +950,7 @@ 4 EndOfwhileNotOne -InitNotOne +whileNotOne objref @@ -990,8 +990,8 @@ - 15/6/2004 - 10:28:52 - 15/6/2004 - 10:28:52 + 4/5/2005 - 14:6:2 + 4/5/2005 - 14:6:2 2.0 ? ? @@ -1005,7 +1005,7 @@ 5 whileNotOne -EndInitNotOne +EndOfwhileNotOne objref @@ -1031,8 +1031,8 @@ ? - 15/6/2004 - 10:28:52 - 15/6/2004 - 10:28:52 + 4/5/2005 - 14:6:2 + 4/5/2005 - 14:6:2 2.0 ? ? @@ -1046,7 +1046,7 @@ 4 EndOffori -Initfori +fori long @@ -1079,8 +1079,8 @@ - 15/6/2004 - 10:28:52 - 15/6/2004 - 10:28:52 + 4/5/2005 - 14:6:2 + 4/5/2005 - 14:6:2 2.0 ? ? @@ -1094,7 +1094,7 @@ 5 fori -EndInitfori +EndOffori long @@ -1114,8 +1114,8 @@ ? - 15/6/2004 - 10:28:52 - 15/6/2004 - 10:28:52 + 4/5/2005 - 14:6:2 + 4/5/2005 - 14:6:2 2.0 ? ? @@ -1129,7 +1129,7 @@ 4 EndOfwhileEven -InitEven +whileEven objref @@ -1168,8 +1168,8 @@ - 15/6/2004 - 10:28:52 - 15/6/2004 - 10:28:52 + 4/5/2005 - 14:6:2 + 4/5/2005 - 14:6:2 2.0 ? ? @@ -1183,7 +1183,7 @@ 5 whileEven -EndInitEven +EndOfwhileEven objref @@ -1209,8 +1209,8 @@ ? - 15/6/2004 - 10:28:52 - 15/6/2004 - 10:28:52 + 4/5/2005 - 14:6:2 + 4/5/2005 - 14:6:2 2.0 ? ? @@ -1260,8 +1260,8 @@ - 15/6/2004 - 10:28:52 - 15/6/2004 - 10:28:52 + 4/5/2005 - 14:6:2 + 4/5/2005 - 14:6:2 2.0 ? ? @@ -1275,7 +1275,7 @@ 7 ifNotEven -EndifNotEven +EndOfifNotEven long @@ -1295,8 +1295,8 @@ ? - 15/6/2004 - 10:28:52 - 15/6/2004 - 10:28:52 + 4/5/2005 - 14:6:2 + 4/5/2005 - 14:6:2 2.0 ? ? @@ -1746,7 +1746,7 @@ 15/6/2004 - 10:28:52 - 15/6/2004 - 10:28:54 + 4/5/2005 - 14:6:2 2.0 JR ? @@ -1772,8 +1772,8 @@ anInteger - 15/6/2004 - 10:28:53 - 15/6/2004 - 10:28:53 + 4/5/2005 - 14:6:2 + 4/5/2005 - 14:6:2 2.0 ? localhost/FactoryServer @@ -1798,8 +1798,8 @@ aNewCount - 15/6/2004 - 10:28:53 - 15/6/2004 - 10:28:53 + 4/5/2005 - 14:6:2 + 4/5/2005 - 14:6:2 2.0 ? localhost/FactoryServer @@ -1824,8 +1824,8 @@ aNewCount - 15/6/2004 - 10:28:53 - 15/6/2004 - 10:28:53 + 4/5/2005 - 14:6:2 + 4/5/2005 - 14:6:2 2.0 ? localhost/FactoryServer @@ -1850,8 +1850,8 @@ anInteger - 15/6/2004 - 10:28:53 - 15/6/2004 - 10:28:53 + 4/5/2005 - 14:6:2 + 4/5/2005 - 14:6:2 2.0 ? localhost/FactoryServer @@ -1876,8 +1876,8 @@ aNewCount - 15/6/2004 - 10:28:53 - 15/6/2004 - 10:28:53 + 4/5/2005 - 14:6:2 + 4/5/2005 - 14:6:2 2.0 ? localhost/FactoryServer @@ -1913,8 +1913,8 @@ - 15/6/2004 - 10:28:53 - 15/6/2004 - 10:28:53 + 4/5/2005 - 14:6:2 + 4/5/2005 - 14:6:2 2.0 ? ? @@ -1928,7 +1928,7 @@ 4 EndOfforN -InitN +forN long @@ -1985,8 +1985,8 @@ - 15/6/2004 - 10:28:53 - 15/6/2004 - 10:28:53 + 4/5/2005 - 14:6:2 + 4/5/2005 - 14:6:2 2.0 ? ? @@ -2000,7 +2000,7 @@ 5 forN -EndInitN +EndOfforN long @@ -2038,8 +2038,8 @@ ? - 15/6/2004 - 10:28:53 - 15/6/2004 - 10:28:53 + 4/5/2005 - 14:6:2 + 4/5/2005 - 14:6:2 2.0 ? ? @@ -2053,7 +2053,7 @@ 4 EndOfwhileNotOne -InitNotOne +whileNotOne objref @@ -2093,8 +2093,8 @@ - 15/6/2004 - 10:28:53 - 15/6/2004 - 10:28:53 + 4/5/2005 - 14:6:2 + 4/5/2005 - 14:6:2 2.0 ? ? @@ -2108,7 +2108,7 @@ 5 whileNotOne -EndInitNotOne +EndOfwhileNotOne objref @@ -2134,8 +2134,8 @@ ? - 15/6/2004 - 10:28:53 - 15/6/2004 - 10:28:53 + 4/5/2005 - 14:6:2 + 4/5/2005 - 14:6:2 2.0 ? ? @@ -2149,7 +2149,7 @@ 4 EndOffori -Initfori +fori long @@ -2182,8 +2182,8 @@ - 15/6/2004 - 10:28:53 - 15/6/2004 - 10:28:53 + 4/5/2005 - 14:6:2 + 4/5/2005 - 14:6:2 2.0 ? ? @@ -2197,7 +2197,7 @@ 5 fori -EndInitfori +EndOffori long @@ -2217,8 +2217,8 @@ ? - 15/6/2004 - 10:28:53 - 15/6/2004 - 10:28:53 + 4/5/2005 - 14:6:2 + 4/5/2005 - 14:6:2 2.0 ? ? @@ -2232,7 +2232,7 @@ 4 EndOfwhileEven -InitEven +whileEven objref @@ -2271,8 +2271,8 @@ - 15/6/2004 - 10:28:53 - 15/6/2004 - 10:28:53 + 4/5/2005 - 14:6:2 + 4/5/2005 - 14:6:2 2.0 ? ? @@ -2286,7 +2286,7 @@ 5 whileEven -EndInitEven +EndOfwhileEven objref @@ -2312,8 +2312,8 @@ ? - 15/6/2004 - 10:28:53 - 15/6/2004 - 10:28:53 + 4/5/2005 - 14:6:2 + 4/5/2005 - 14:6:2 2.0 ? ? @@ -2363,8 +2363,8 @@ - 15/6/2004 - 10:28:54 - 15/6/2004 - 10:28:54 + 4/5/2005 - 14:6:2 + 4/5/2005 - 14:6:2 2.0 ? ? @@ -2378,7 +2378,7 @@ 7 ifNotEven -EndifNotEven +EndOfifNotEven long @@ -2398,8 +2398,8 @@ ? - 15/6/2004 - 10:28:54 - 15/6/2004 - 10:28:54 + 4/5/2005 - 14:6:2 + 4/5/2005 - 14:6:2 2.0 ? ? diff --git a/examples/GraphObjRef.py b/examples/GraphObjRef.py index 8a2c2d7..5886ba4 100755 --- a/examples/GraphObjRef.py +++ b/examples/GraphObjRef.py @@ -2,109 +2,127 @@ # Generated python file of Graph GraphObjRef from SuperV import * -# Graph creation -GraphObjRef = Graph( 'GraphObjRef' ) -GraphObjRef.SetName( 'GraphObjRef' ) -GraphObjRef.SetAuthor( '' ) -GraphObjRef.SetComment( '' ) -GraphObjRef.Coords( 0 , 0 ) -# Creation of Factory Nodes +# Graph creation of GraphObjRef +def DefGraphObjRef() : + GraphObjRef = Graph( 'GraphObjRef' ) + GraphObjRef.SetName( 'GraphObjRef' ) + GraphObjRef.SetAuthor( '' ) + GraphObjRef.SetComment( '' ) + GraphObjRef.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + Addition = GraphObjRef.FNode( 'AddComponent' , 'AddComponent' , 'Addition' ) + Addition.SetName( 'Addition' ) + Addition.SetAuthor( '' ) + Addition.SetContainer( 'localhost/AdditionServer' ) + Addition.SetComment( 'Addition from AddComponent' ) + Addition.Coords( 10 , 15 ) + IAdditionGate = Addition.GetInPort( 'Gate' ) + OAdditionAdder = Addition.GetOutPort( 'Adder' ) + OAdditionGate = Addition.GetOutPort( 'Gate' ) + + # Creation of InLine Nodes + PySyrComponent = [] + PySyrComponent.append( 'from LifeCycleCORBA import * ' ) + PySyrComponent.append( 'def SyrComponent( aContainer , aComponent ) : ' ) + PySyrComponent.append( ' print "SyrComponent(",aContainer,",",aComponent,")" ' ) + PySyrComponent.append( ' orb = CORBA.ORB_init([], CORBA.ORB_ID) ' ) + PySyrComponent.append( ' print "SyrComponent orb",orb ' ) + PySyrComponent.append( ' lcc = LifeCycleCORBA(orb) ' ) + PySyrComponent.append( ' print "SyrComponent lcc",lcc ' ) + PySyrComponent.append( ' print "SyrComponent(",aContainer,",",aComponent,")" ' ) + PySyrComponent.append( ' ComponentRef = lcc.FindOrLoadComponent( aContainer , aComponent ) ' ) + PySyrComponent.append( ' print "SyrComponent(",aContainer,",",aComponent,") --> ",ComponentRef ' ) + PySyrComponent.append( ' return ComponentRef ' ) + PySyrComponent.append( '' ) + SyrComponent = GraphObjRef.INode( 'SyrComponent' , PySyrComponent ) + SyrComponent.SetName( 'SyrComponent' ) + SyrComponent.SetAuthor( '' ) + SyrComponent.SetComment( 'Compute Node' ) + SyrComponent.Coords( 26 , 209 ) + ISyrComponentaContainer = SyrComponent.InPort( 'aContainer' , 'string' ) + ISyrComponentaComponent = SyrComponent.InPort( 'aComponent' , 'string' ) + ISyrComponentGate = SyrComponent.GetInPort( 'Gate' ) + OSyrComponentanObjRef = SyrComponent.OutPort( 'anObjRef' , 'objref' ) + OSyrComponentGate = SyrComponent.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyInit = [] + PyInit.append( 'from time import * ' ) + PyInit.append( 'def Init( Adder , anObjRef , Index ) : ' ) + PyInit.append( ' sleep( 1 ) ' ) + PyInit.append( ' return Adder,anObjRef,0 ' ) + PyInit.append( ' ' ) + PyMoreInit = [] + PyMoreInit.append( 'def More( Adder , anObjRef , Index ) : ' ) + PyMoreInit.append( ' OutLoop = 0 ' ) + PyMoreInit.append( ' if 10 > Index : ' ) + PyMoreInit.append( ' OutLoop = 1 ' ) + PyMoreInit.append( ' return OutLoop,Adder,anObjRef,Index ' ) + PyMoreInit.append( ' ' ) + PyNextInit = [] + PyNextInit.append( 'def Nextfori( Adder , anObjRef , Index ) : ' ) + PyNextInit.append( ' Index = Index + 1 ' ) + PyNextInit.append( ' return Adder,anObjRef,Index ' ) + PyNextInit.append( ' ' ) + Init,EndInit = GraphObjRef.LNode( 'Init' , PyInit , 'More' , PyMoreInit , 'Nextfori' , PyNextInit ) + EndInit.SetName( 'EndInit' ) + EndInit.SetAuthor( '' ) + EndInit.SetComment( 'Compute Node' ) + EndInit.Coords( 449 , 165 ) + PyEndInit = [] + EndInit.SetPyFunction( '' , PyEndInit ) + IInitDoLoop = Init.GetInPort( 'DoLoop' ) + IInitAddder = Init.InPort( 'Addder' , 'objref' ) + IInitanObjRef = Init.InPort( 'anObjRef' , 'objref' ) + IInitIndex = Init.InPort( 'Index' , 'long' ) + IInitGate = Init.GetInPort( 'Gate' ) + OInitDoLoop = Init.GetOutPort( 'DoLoop' ) + OInitAddder = Init.GetOutPort( 'Addder' ) + OInitanObjRef = Init.GetOutPort( 'anObjRef' ) + OInitIndex = Init.GetOutPort( 'Index' ) + IEndInitDoLoop = EndInit.GetInPort( 'DoLoop' ) + IEndInitAddder = EndInit.GetInPort( 'Addder' ) + IEndInitanObjRef = EndInit.GetInPort( 'anObjRef' ) + IEndInitIndex = EndInit.GetInPort( 'Index' ) + IEndInitGate = EndInit.GetInPort( 'Gate' ) + OEndInitDoLoop = EndInit.GetOutPort( 'DoLoop' ) + OEndInitAddder = EndInit.GetOutPort( 'Addder' ) + OEndInitanObjRef = EndInit.GetOutPort( 'anObjRef' ) + OEndInitIndex = EndInit.GetOutPort( 'Index' ) + OEndInitGate = EndInit.GetOutPort( 'Gate' ) + Init.SetName( 'Init' ) + Init.SetAuthor( '' ) + Init.SetComment( 'Compute Node' ) + Init.Coords( 236 , 161 ) + + # Creation of Links + LAdditionAdderInitAddder = GraphObjRef.Link( OAdditionAdder , IInitAddder ) + LAdditionAdderInitAddder.AddCoord( 1 , 202 , 194 ) + LAdditionAdderInitAddder.AddCoord( 2 , 201 , 95 ) + + LSyrComponentanObjRefInitanObjRef = GraphObjRef.Link( OSyrComponentanObjRef , IInitanObjRef ) + LSyrComponentanObjRefInitanObjRef.AddCoord( 1 , 209 , 224 ) + LSyrComponentanObjRefInitanObjRef.AddCoord( 2 , 208 , 289 ) + + LInitAddderEndInitAddder = GraphObjRef.Link( OInitAddder , IEndInitAddder ) + + LInitanObjRefEndInitanObjRef = GraphObjRef.Link( OInitanObjRef , IEndInitanObjRef ) + + LInitIndexEndInitIndex = GraphObjRef.Link( OInitIndex , IEndInitIndex ) + + # Input datas + ISyrComponentaContainer.Input( 'FactoryServer' ) + ISyrComponentaComponent.Input( 'SyrComponent' ) + IInitIndex.Input( 0 ) + + # Output Ports of the graph + #OEndInitAddder = EndInit.GetOutPort( 'Addder' ) + #OEndInitanObjRef = EndInit.GetOutPort( 'anObjRef' ) + #OEndInitIndex = EndInit.GetOutPort( 'Index' ) + return GraphObjRef -Addition = GraphObjRef.FNode( 'AddComponent' , 'AddComponent' , 'Addition' ) -Addition.SetName( 'Addition' ) -Addition.SetAuthor( '' ) -Addition.SetContainer( 'localhost/AdditionServer' ) -Addition.SetComment( 'Addition from AddComponent' ) -Addition.Coords( 10 , 15 ) -# Creation of InLine Nodes -PySyrComponent = [] -PySyrComponent.append( 'from LifeCycleCORBA import * ' ) -PySyrComponent.append( 'def SyrComponent( aContainer , aComponent ) : ' ) -PySyrComponent.append( ' print "SyrComponent(",aContainer,",",aComponent,")" ' ) -PySyrComponent.append( ' orb = CORBA.ORB_init([], CORBA.ORB_ID) ' ) -PySyrComponent.append( ' print "SyrComponent orb",orb ' ) -PySyrComponent.append( ' lcc = LifeCycleCORBA(orb) ' ) -PySyrComponent.append( ' print "SyrComponent lcc",lcc ' ) -PySyrComponent.append( ' print "SyrComponent(",aContainer,",",aComponent,")" ' ) -PySyrComponent.append( ' ComponentRef = lcc.FindOrLoadComponent( aContainer , aComponent ) ' ) -PySyrComponent.append( ' print "SyrComponent(",aContainer,",",aComponent,") --> ",ComponentRef ' ) -PySyrComponent.append( ' return ComponentRef ' ) -PySyrComponent.append( '' ) -SyrComponent = GraphObjRef.INode( 'SyrComponent' , PySyrComponent ) -SyrComponent.InPort( 'aContainer' , 'string' ) -SyrComponent.InPort( 'aComponent' , 'string' ) -SyrComponent.OutPort( 'anObjRef' , 'objref' ) -SyrComponent.SetName( 'SyrComponent' ) -SyrComponent.SetAuthor( '' ) -SyrComponent.SetComment( 'Compute Node' ) -SyrComponent.Coords( 26 , 209 ) - -# Creation of Loop Nodes -PyInit = [] -PyInit.append( 'def Init( Adder , anObjRef , Index ) : ' ) -PyInit.append( ' return Adder,anObjRef,0 ' ) -PyInit.append( '' ) -PyMoreInit = [] -PyMoreInit.append( 'def More( Adder , anObjRef , Index ) : ' ) -PyMoreInit.append( ' OutLoop = 0 ' ) -PyMoreInit.append( ' if 10 > Index : ' ) -PyMoreInit.append( ' OutLoop = 1 ' ) -PyMoreInit.append( ' return OutLoop,Adder,anObjRef,Index ' ) -PyMoreInit.append( '' ) -PyNextInit = [] -PyNextInit.append( 'def Nextfori( Adder , anObjRef , Index ) : ' ) -PyNextInit.append( ' Index = Index + 1 ' ) -PyNextInit.append( ' return Adder,anObjRef,Index ' ) -PyNextInit.append( '' ) -Init,EndInit = GraphObjRef.LNode( 'Init' , PyInit , 'More' , PyMoreInit , 'Nextfori' , PyNextInit ) -EndInit.SetName( 'EndInit' ) -EndInit.SetAuthor( '' ) -EndInit.SetComment( '' ) -EndInit.Coords( 441 , 177 ) -Init.InPort( 'Addder' , 'objref' ) -Init.InPort( 'anObjRef' , 'objref' ) -Init.InPort( 'Index' , 'long' ) -Init.OutPort( 'Addder' , 'objref' ) -Init.OutPort( 'anObjRef' , 'objref' ) -Init.OutPort( 'Index' , 'long' ) -Init.SetName( 'Init' ) -Init.SetAuthor( '' ) -Init.SetComment( '' ) -Init.Coords( 236 , 161 ) - -# Creation of Links -AdditionAdder = Addition.Port( 'Adder' ) -InitAddder = GraphObjRef.Link( AdditionAdder , Init.Port( 'Addder' ) ) -InitAddder.AddCoord( 1 , 202 , 194 ) -InitAddder.AddCoord( 2 , 201 , 95 ) - -SyrComponentanObjRef = SyrComponent.Port( 'anObjRef' ) -InitanObjRef = GraphObjRef.Link( SyrComponentanObjRef , Init.Port( 'anObjRef' ) ) -InitanObjRef.AddCoord( 1 , 209 , 224 ) -InitanObjRef.AddCoord( 2 , 208 , 289 ) - -InitAddder = Init.Port( 'Addder' ) -EndInitAddder = GraphObjRef.Link( InitAddder , EndInit.Port( 'Addder' ) ) - -InitanObjRef = Init.Port( 'anObjRef' ) -EndInitanObjRef = GraphObjRef.Link( InitanObjRef , EndInit.Port( 'anObjRef' ) ) - -InitIndex = Init.Port( 'Index' ) -EndInitIndex = GraphObjRef.Link( InitIndex , EndInit.Port( 'Index' ) ) - -# Creation of Input datas -SyrComponentaContainer = SyrComponent.Input( 'aContainer' , 'FactoryServer') -SyrComponentaComponent = SyrComponent.Input( 'aComponent' , 'SyrComponent') -InitIndex = Init.Input( 'Index' , 0) - -# Creation of Output variables -EndInitAddder = EndInit.Port( 'Addder' ) -EndInitanObjRef = EndInit.Port( 'anObjRef' ) -EndInitIndex = EndInit.Port( 'Index' ) - -GraphObjRef.Run() -GraphObjRef.DoneW() -GraphObjRef.State() -GraphObjRef.PrintPorts() +GraphObjRef = DefGraphObjRef() diff --git a/examples/GraphObjRef.xml b/examples/GraphObjRef.xml index ec02fa8..752d0a0 100755 --- a/examples/GraphObjRef.xml +++ b/examples/GraphObjRef.xml @@ -1,287 +1,367 @@ - - - - -? - ? - GraphObjRef - 1 - ? - -GraphObjRef - - -string - SyrComponent\aContainer - -string - SyrComponent\aComponent - -long - Init\Index - - -objref - EndInit\Addder - -objref - EndInit\anObjRef - -long - EndInit\Index - - - 1/7/2003 - 19:4:59 - 18/9/2003 - 17:38:33 - 1.04 - ? - ? - ? - 0 - 0 - - -AddComponent - AddComponent - Addition - 0 - ? - -Addition - - - -Adder - Adder - - - 18/9/2003 - 17:38:33 - 18/9/2003 - 17:38:33 - 1.04 - ? - localhost/AdditionServer - Addition from AddComponent - 10 - 15 - -? - ? - SyrComponent - 3 - ? - -SyrComponent - - -string - aContainer - -string - aComponent - - -objref - anObjRef - - - -SyrComponent - - - - - - - - - - ",ComponentRef ]]> - - - 18/9/2003 - 17:38:33 - 18/9/2003 - 17:38:33 - 1.04 - ? - ? - Compute Node - 26 - 209 - -? - ? - Init - 4 - EndInit - -Init - - -objref - Addder - -objref - anObjRef - -long - Index - - -objref - Addder - -objref - anObjRef - -long - Index - - - -Init - - - - -More - - - Index : ]]> - - - - -Nextfori - - - - - 18/9/2003 - 17:38:33 - 18/9/2003 - 17:38:33 - 1.04 - ? - ? - ? - 236 - 161 - -? - ? - EndInit - 5 - Init - -EndInit - - -objref - Addder - -objref - anObjRef - -long - Index - - -objref - Addder - -objref - anObjRef - -long - Index - - - - 18/9/2003 - 17:38:33 - 18/9/2003 - 17:38:33 - 1.04 - ? - ? - ? - 441 - 177 - - -Addition - Adder - Init - Addder - - -202 - 194 - -201 - 95 - -SyrComponent - anObjRef - Init - anObjRef - - -209 - 224 - -208 - 289 - -Init - DoLoop - EndInit - DoLoop - - -Init - Addder - EndInit - Addder - - -Init - anObjRef - EndInit - anObjRef - - -Init - Index - EndInit - Index - - -EndInit - DoLoop - Init - DoLoop - - - -GraphObjRef - SyrComponent\aContainer - SyrComponent - aContainer - -18 - FactoryServer - - -GraphObjRef - SyrComponent\aComponent - SyrComponent - aComponent - -18 - SyrComponent - - -GraphObjRef - Init\Index - Init - Index - -3 - 0 - + + + + + + ? + ? + GraphObjRef + 1 + ? + + GraphObjRef + + + string + SyrComponent__aContainer + + + string + SyrComponent__aComponent + + + long + Init__Index + + + + + objref + EndInit__Addder + + + objref + EndInit__anObjRef + + + long + EndInit__Index + + + + + + 1/7/2003 - 19:4:59 + 25/8/2005 - 11:24:44 + 1.04 + ? + ? + ? + 0 + 0 + + + + + AddComponent + AddComponent + Addition + 0 + ? + + Addition + + + + Adder + Adder + + + + + + 25/8/2005 - 11:24:44 + 25/8/2005 - 11:24:44 + 1.04 + ? + localhost/AdditionServer + Addition from AddComponent + 10 + 15 + + + ? + ? + SyrComponent + 3 + ? + + SyrComponent + + + string + aContainer + + + string + aComponent + + + + + objref + anObjRef + + + + + + + SyrComponent + + + + + + + + + + ",ComponentRef ]]> + + + + + 25/8/2005 - 11:24:44 + 25/8/2005 - 11:24:44 + 1.04 + ? + ? + Compute Node + 26 + 209 + + + ? + ? + Init + 4 + EndInit + + Init + + + objref + Addder + + + objref + anObjRef + + + long + Index + + + + + objref + Addder + + + objref + anObjRef + + + long + Index + + + + + + + Init + + + + + + + + More + + + Index : ]]> + + + + + + Nextfori + + + + + + + 25/8/2005 - 11:24:44 + 25/8/2005 - 11:24:44 + 1.04 + ? + ? + Compute Node + 236 + 161 + + + ? + ? + EndInit + 5 + Init + + EndInit + + + objref + Addder + + + objref + anObjRef + + + long + Index + + + + + objref + Addder + + + objref + anObjRef + + + long + Index + + + + + + + ? + + + + 25/8/2005 - 11:24:44 + 25/8/2005 - 11:24:44 + 1.04 + ? + ? + Compute Node + 449 + 165 + + + + + Addition + Adder + Init + Addder + + + 202 + 194 + + + 201 + 95 + + + + + SyrComponent + anObjRef + Init + anObjRef + + + 209 + 224 + + + 208 + 289 + + + + + Init + DoLoop + EndInit + DoLoop + + + + Init + Addder + EndInit + Addder + + + + Init + anObjRef + EndInit + anObjRef + + + + Init + Index + EndInit + Index + + + + EndInit + DoLoop + Init + DoLoop + + + + + + GraphObjRef + SyrComponent__aContainer + SyrComponent + aContainer + + 18 + + + + + + GraphObjRef + SyrComponent__aComponent + SyrComponent + aComponent + + 18 + + + + + + GraphObjRef + Init__Index + Init + Index + + 3 + 0 + + + + + + + diff --git a/examples/GraphObjRefOMNIORB4.py b/examples/GraphObjRefOMNIORB4.py new file mode 100644 index 0000000..aec7e71 --- /dev/null +++ b/examples/GraphObjRefOMNIORB4.py @@ -0,0 +1,229 @@ + +# Generated python file of Graph GraphObjRefOMNIORB4 + +from SuperV import * + +# Graph creation of GraphObjRefOMNIORB4 +def DefGraphObjRefOMNIORB4() : + GraphObjRefOMNIORB4 = Graph( 'GraphObjRefOMNIORB4' ) + GraphObjRefOMNIORB4.SetName( 'GraphObjRefOMNIORB4' ) + GraphObjRefOMNIORB4.SetAuthor( '' ) + GraphObjRefOMNIORB4.SetComment( '' ) + GraphObjRefOMNIORB4.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + Addition = GraphObjRefOMNIORB4.FNode( 'AddComponent' , 'AddComponent' , 'Addition' ) + Addition.SetName( 'Addition' ) + Addition.SetAuthor( '' ) + Addition.SetContainer( 'localhost/FactoryServer' ) + Addition.SetComment( 'Addition from AddComponent' ) + Addition.Coords( 13 , 185 ) + IAdditionGate = Addition.GetInPort( 'Gate' ) + OAdditionAdder = Addition.GetOutPort( 'Adder' ) + OAdditionGate = Addition.GetOutPort( 'Gate' ) + + EmbeddedAddition = GraphObjRefOMNIORB4.FNode( 'AddComponent' , 'AddComponent' , 'Addition' ) + EmbeddedAddition.SetName( 'EmbeddedAddition' ) + EmbeddedAddition.SetAuthor( '' ) + EmbeddedAddition.SetContainer( 'localhost/SuperVisionContainer' ) + EmbeddedAddition.SetComment( 'Addition from AddComponent' ) + EmbeddedAddition.Coords( 17 , 347 ) + IEmbeddedAdditionGate = EmbeddedAddition.GetInPort( 'Gate' ) + OEmbeddedAdditionAdder = EmbeddedAddition.GetOutPort( 'Adder' ) + OEmbeddedAdditionGate = EmbeddedAddition.GetOutPort( 'Gate' ) + + AdditionObjRefs = GraphObjRefOMNIORB4.FNode( 'AddComponent' , 'AddComponent' , 'AdditionObjRefs' ) + AdditionObjRefs.SetName( 'AdditionObjRefs' ) + AdditionObjRefs.SetAuthor( '' ) + AdditionObjRefs.SetContainer( 'localhost/FactoryServer' ) + AdditionObjRefs.SetComment( 'AdditionObjRefs from AddComponent' ) + AdditionObjRefs.Coords( 453 , 164 ) + IAdditionObjRefsAddComponent1 = AdditionObjRefs.GetInPort( 'AddComponent1' ) + IAdditionObjRefsAdder2 = AdditionObjRefs.GetInPort( 'Adder2' ) + IAdditionObjRefsAdder3 = AdditionObjRefs.GetInPort( 'Adder3' ) + IAdditionObjRefsGate = AdditionObjRefs.GetInPort( 'Gate' ) + OAdditionObjRefsreturn = AdditionObjRefs.GetOutPort( 'return' ) + OAdditionObjRefsRetAddComponent1 = AdditionObjRefs.GetOutPort( 'RetAddComponent1' ) + OAdditionObjRefsRetAdder2 = AdditionObjRefs.GetOutPort( 'RetAdder2' ) + OAdditionObjRefsRetAdder3 = AdditionObjRefs.GetOutPort( 'RetAdder3' ) + OAdditionObjRefsGate = AdditionObjRefs.GetOutPort( 'Gate' ) + + AdditionObjRefs_1 = GraphObjRefOMNIORB4.FNode( 'AddComponent' , 'AddComponent' , 'AdditionObjRefs' ) + AdditionObjRefs_1.SetName( 'AdditionObjRefs_1' ) + AdditionObjRefs_1.SetAuthor( '' ) + AdditionObjRefs_1.SetContainer( 'localhost/AdditionObjRefsServer' ) + AdditionObjRefs_1.SetComment( 'AdditionObjRefs from AddComponent' ) + AdditionObjRefs_1.Coords( 457 , 345 ) + IAdditionObjRefs_1AddComponent1 = AdditionObjRefs_1.GetInPort( 'AddComponent1' ) + IAdditionObjRefs_1Adder2 = AdditionObjRefs_1.GetInPort( 'Adder2' ) + IAdditionObjRefs_1Adder3 = AdditionObjRefs_1.GetInPort( 'Adder3' ) + IAdditionObjRefs_1Gate = AdditionObjRefs_1.GetInPort( 'Gate' ) + OAdditionObjRefs_1return = AdditionObjRefs_1.GetOutPort( 'return' ) + OAdditionObjRefs_1RetAddComponent1 = AdditionObjRefs_1.GetOutPort( 'RetAddComponent1' ) + OAdditionObjRefs_1RetAdder2 = AdditionObjRefs_1.GetOutPort( 'RetAdder2' ) + OAdditionObjRefs_1RetAdder3 = AdditionObjRefs_1.GetOutPort( 'RetAdder3' ) + OAdditionObjRefs_1Gate = AdditionObjRefs_1.GetOutPort( 'Gate' ) + + # Creation of Computing Nodes + LccAddComponent_ServiceinParameter = [] + LccAddComponent_ServiceinParameter.append( SALOME_ModuleCatalog.ServicesParameter( 'SuperVisionTest::Adder' , 'Adder' ) ) + LccAddComponent_ServiceinParameter.append( SALOME_ModuleCatalog.ServicesParameter( 'string' , 'aContainer' ) ) + LccAddComponent_ServiceinParameter.append( SALOME_ModuleCatalog.ServicesParameter( 'string' , 'aComponentName' ) ) + LccAddComponent_ServiceoutParameter = [] + LccAddComponent_ServiceoutParameter.append( SALOME_ModuleCatalog.ServicesParameter( 'Component' , 'return' ) ) + LccAddComponent_ServiceinStreamParameter = [] + LccAddComponent_ServiceoutStreamParameter = [] + LccAddComponent_Service = SALOME_ModuleCatalog.Service( 'LccAddComponent' , LccAddComponent_ServiceinParameter , LccAddComponent_ServiceoutParameter , LccAddComponent_ServiceinStreamParameter , LccAddComponent_ServiceoutStreamParameter , 0 , 0 ) + LccAddComponent = GraphObjRefOMNIORB4.CNode( LccAddComponent_Service ) + LccAddComponent.SetName( 'LccAddComponent' ) + LccAddComponent.SetAuthor( '' ) + LccAddComponent.SetComment( 'Compute Node' ) + LccAddComponent.Coords( 235 , 184 ) + ILccAddComponentAdder = LccAddComponent.GetInPort( 'Adder' ) + ILccAddComponentaContainer = LccAddComponent.GetInPort( 'aContainer' ) + ILccAddComponentaComponentName = LccAddComponent.GetInPort( 'aComponentName' ) + ILccAddComponentGate = LccAddComponent.GetInPort( 'Gate' ) + OLccAddComponentreturn = LccAddComponent.GetOutPort( 'return' ) + OLccAddComponentGate = LccAddComponent.GetOutPort( 'Gate' ) + + EmbeddedLccAddComponent_ServiceinParameter = [] + EmbeddedLccAddComponent_ServiceinParameter.append( SALOME_ModuleCatalog.ServicesParameter( 'SuperVisionTest::Adder' , 'Adder' ) ) + EmbeddedLccAddComponent_ServiceinParameter.append( SALOME_ModuleCatalog.ServicesParameter( 'string' , 'aContainer' ) ) + EmbeddedLccAddComponent_ServiceinParameter.append( SALOME_ModuleCatalog.ServicesParameter( 'string' , 'aComponentName' ) ) + EmbeddedLccAddComponent_ServiceoutParameter = [] + EmbeddedLccAddComponent_ServiceoutParameter.append( SALOME_ModuleCatalog.ServicesParameter( 'Component' , 'return' ) ) + EmbeddedLccAddComponent_ServiceinStreamParameter = [] + EmbeddedLccAddComponent_ServiceoutStreamParameter = [] + EmbeddedLccAddComponent_Service = SALOME_ModuleCatalog.Service( 'LccAddComponent' , EmbeddedLccAddComponent_ServiceinParameter , EmbeddedLccAddComponent_ServiceoutParameter , EmbeddedLccAddComponent_ServiceinStreamParameter , EmbeddedLccAddComponent_ServiceoutStreamParameter , 0 , 0 ) + EmbeddedLccAddComponent = GraphObjRefOMNIORB4.CNode( EmbeddedLccAddComponent_Service ) + EmbeddedLccAddComponent.SetName( 'EmbeddedLccAddComponent' ) + EmbeddedLccAddComponent.SetAuthor( '' ) + EmbeddedLccAddComponent.SetComment( 'Compute Node' ) + EmbeddedLccAddComponent.Coords( 235 , 347 ) + IEmbeddedLccAddComponentAdder = EmbeddedLccAddComponent.GetInPort( 'Adder' ) + IEmbeddedLccAddComponentaContainer = EmbeddedLccAddComponent.GetInPort( 'aContainer' ) + IEmbeddedLccAddComponentaComponentName = EmbeddedLccAddComponent.GetInPort( 'aComponentName' ) + IEmbeddedLccAddComponentGate = EmbeddedLccAddComponent.GetInPort( 'Gate' ) + OEmbeddedLccAddComponentreturn = EmbeddedLccAddComponent.GetOutPort( 'return' ) + OEmbeddedLccAddComponentGate = EmbeddedLccAddComponent.GetOutPort( 'Gate' ) + + # Creation of InLine Nodes + PyAddComponent = [] + PyAddComponent.append( 'import CORBA ' ) + PyAddComponent.append( 'from LifeCycleCORBA import * ' ) + PyAddComponent.append( 'import SuperVisionTest ' ) + PyAddComponent.append( 'def defAddComponent( aContainer , aComponent ) : ' ) + PyAddComponent.append( ' orb = CORBA.ORB_init([], CORBA.ORB_ID) ' ) + PyAddComponent.append( ' lcc = LifeCycleCORBA(orb) ' ) + PyAddComponent.append( ' ComponentRef = lcc.FindOrLoadComponent( aContainer , aComponent ) ' ) + PyAddComponent.append( ' ComponentObjRef = ComponentRef._narrow( SuperVisionTest.AddComponent ) ' ) + PyAddComponent.append( ' return ComponentObjRef._duplicate( SuperVisionTest.AddComponent ) ' ) + AddComponent = GraphObjRefOMNIORB4.INode( 'defAddComponent' , PyAddComponent ) + AddComponent.SetName( 'AddComponent' ) + AddComponent.SetAuthor( '' ) + AddComponent.SetComment( 'Compute Node' ) + AddComponent.Coords( 240 , 31 ) + IAddComponentaContainer = AddComponent.InPort( 'aContainer' , 'string' ) + IAddComponentaComponent = AddComponent.InPort( 'aComponent' , 'string' ) + IAddComponentGate = AddComponent.GetInPort( 'Gate' ) + OAddComponentAddComponentobjref = AddComponent.OutPort( 'AddComponentobjref' , 'objref' ) + OAddComponentGate = AddComponent.GetOutPort( 'Gate' ) + + PyFindComponentInstance = [] + PyFindComponentInstance.append( 'from salome import * ' ) + PyFindComponentInstance.append( 'def FindComponentInstance( ComponentRef ) : ' ) + PyFindComponentInstance.append( ' MESSAGE("FindComponentInstance "+ str( ComponentRef )) ' ) + PyFindComponentInstance.append( ' print "FindComponentInstance",ComponentRef ' ) + PyFindComponentInstance.append( ' AddComponentObjRef = ComponentRef._narrow(Engines.Component) ' ) + PyFindComponentInstance.append( ' MESSAGE("FindComponentInstance") ' ) + PyFindComponentInstance.append( ' print "FindComponentInstance",AddComponentObjRef ' ) + PyFindComponentInstance.append( ' TheContainer = AddComponentObjRef.GetContainerRef() ' ) + PyFindComponentInstance.append( ' MESSAGE("FindComponentInstance") ' ) + PyFindComponentInstance.append( ' print "FindComponentInstance",TheContainer ' ) + PyFindComponentInstance.append( ' TheAddComponentObjRef=TheContainer.find_component_instance( "AddComponent" ,0 ) ' ) + PyFindComponentInstance.append( ' MESSAGE("FindComponentInstance "+ str( TheAddComponentObjRef )) ' ) + PyFindComponentInstance.append( ' print "FindComponentInstance",TheAddComponentObjRef ' ) + PyFindComponentInstance.append( ' return TheAddComponentObjRef ' ) + FindComponentInstance = GraphObjRefOMNIORB4.INode( 'FindComponentInstance' , PyFindComponentInstance ) + FindComponentInstance.SetName( 'FindComponentInstance' ) + FindComponentInstance.SetAuthor( '' ) + FindComponentInstance.SetComment( 'Compute Node' ) + FindComponentInstance.Coords( 648 , 184 ) + IFindComponentInstanceAddComponentObjRef = FindComponentInstance.InPort( 'AddComponentObjRef' , 'objref' ) + IFindComponentInstanceGate = FindComponentInstance.GetInPort( 'Gate' ) + OFindComponentInstanceAddComponentObjRef = FindComponentInstance.OutPort( 'AddComponentObjRef' , 'objref' ) + OFindComponentInstanceGate = FindComponentInstance.GetOutPort( 'Gate' ) + + PyFindComponentInstance_1 = [] + PyFindComponentInstance_1.append( 'from salome import * ' ) + PyFindComponentInstance_1.append( 'def FindComponentInstance_1( ComponentRef ) : ' ) + PyFindComponentInstance_1.append( ' print "FindComponentInstance_1 beginning" ' ) + PyFindComponentInstance_1.append( ' MESSAGE("FindComponentInstance_1 "+ str( ComponentRef ) ) ' ) + PyFindComponentInstance_1.append( ' print "FindComponentInstance_1",ComponentRef ' ) + PyFindComponentInstance_1.append( ' AddComponentObjRef = ComponentRef._narrow(Engines.Component) ' ) + PyFindComponentInstance_1.append( ' MESSAGE("FindComponentInstance_1") ' ) + PyFindComponentInstance_1.append( ' print "FindComponentInstance_1",AddComponentObjRef ' ) + PyFindComponentInstance_1.append( ' TheContainer = AddComponentObjRef.GetContainerRef() ' ) + PyFindComponentInstance_1.append( ' MESSAGE("FindComponentInstance_1") ' ) + PyFindComponentInstance_1.append( ' print "FindComponentInstance_1",TheContainer ' ) + PyFindComponentInstance_1.append( ' TheAddComponentObjRef=TheContainer.find_component_instance( "AddComponent" ,0 ) ' ) + PyFindComponentInstance_1.append( ' if TheAddComponentObjRef == None : ' ) + PyFindComponentInstance_1.append( ' MESSAGE("FindComponentInstance_1 None") ' ) + PyFindComponentInstance_1.append( ' else : ' ) + PyFindComponentInstance_1.append( ' MESSAGE("FindComponentInstance_1") ' ) + PyFindComponentInstance_1.append( ' print "FindComponentInstance_1",TheAddComponentObjRef ' ) + PyFindComponentInstance_1.append( ' return TheAddComponentObjRef ' ) + FindComponentInstance_1 = GraphObjRefOMNIORB4.INode( 'FindComponentInstance_1' , PyFindComponentInstance_1 ) + FindComponentInstance_1.SetName( 'FindComponentInstance_1' ) + FindComponentInstance_1.SetAuthor( '' ) + FindComponentInstance_1.SetComment( 'Compute Node' ) + FindComponentInstance_1.Coords( 647 , 31 ) + IFindComponentInstance_1AddComponentRef = FindComponentInstance_1.InPort( 'AddComponentRef' , 'objref' ) + IFindComponentInstance_1Gate = FindComponentInstance_1.GetInPort( 'Gate' ) + OFindComponentInstance_1AddComponentRef = FindComponentInstance_1.OutPort( 'AddComponentRef' , 'objref' ) + OFindComponentInstance_1Gate = FindComponentInstance_1.GetOutPort( 'Gate' ) + + # Creation of Links + LAddComponentAddComponentobjrefAdditionObjRefsAddComponent1 = GraphObjRefOMNIORB4.Link( OAddComponentAddComponentobjref , IAdditionObjRefsAddComponent1 ) + + LAddComponentAddComponentobjrefFindComponentInstance_1AddComponentRef = GraphObjRefOMNIORB4.Link( OAddComponentAddComponentobjref , IFindComponentInstance_1AddComponentRef ) + + LAddComponentAddComponentobjrefAdditionObjRefs_1AddComponent1 = GraphObjRefOMNIORB4.Link( OAddComponentAddComponentobjref , IAdditionObjRefs_1AddComponent1 ) + + LAdditionAdderLccAddComponentAdder = GraphObjRefOMNIORB4.Link( OAdditionAdder , ILccAddComponentAdder ) + + LEmbeddedAdditionAdderEmbeddedLccAddComponentAdder = GraphObjRefOMNIORB4.Link( OEmbeddedAdditionAdder , IEmbeddedLccAddComponentAdder ) + + LLccAddComponentreturnAdditionObjRefsAdder2 = GraphObjRefOMNIORB4.Link( OLccAddComponentreturn , IAdditionObjRefsAdder2 ) + + LLccAddComponentreturnAdditionObjRefs_1Adder2 = GraphObjRefOMNIORB4.Link( OLccAddComponentreturn , IAdditionObjRefs_1Adder2 ) + + LEmbeddedLccAddComponentreturnAdditionObjRefsAdder3 = GraphObjRefOMNIORB4.Link( OEmbeddedLccAddComponentreturn , IAdditionObjRefsAdder3 ) + + LEmbeddedLccAddComponentreturnAdditionObjRefs_1Adder3 = GraphObjRefOMNIORB4.Link( OEmbeddedLccAddComponentreturn , IAdditionObjRefs_1Adder3 ) + + LAdditionObjRefsRetAddComponent1FindComponentInstanceAddComponentObjRef = GraphObjRefOMNIORB4.Link( OAdditionObjRefsRetAddComponent1 , IFindComponentInstanceAddComponentObjRef ) + + # Input datas + IAddComponentaContainer.Input( 'FactoryServer' ) + IAddComponentaComponent.Input( 'AddComponent' ) + ILccAddComponentaContainer.Input( 'FactoryServer' ) + ILccAddComponentaComponentName.Input( 'AddComponent' ) + IEmbeddedLccAddComponentaContainer.Input( 'SuperVisionContainer' ) + IEmbeddedLccAddComponentaComponentName.Input( 'AddComponent' ) + + # Output Ports of the graph + #OAdditionObjRefsreturn = AdditionObjRefs.GetOutPort( 'return' ) + #OAdditionObjRefsRetAdder2 = AdditionObjRefs.GetOutPort( 'RetAdder2' ) + #OAdditionObjRefsRetAdder3 = AdditionObjRefs.GetOutPort( 'RetAdder3' ) + #OFindComponentInstanceAddComponentObjRef = FindComponentInstance.GetOutPort( 'AddComponentObjRef' ) + #OFindComponentInstance_1AddComponentRef = FindComponentInstance_1.GetOutPort( 'AddComponentRef' ) + #OAdditionObjRefs_1return = AdditionObjRefs_1.GetOutPort( 'return' ) + #OAdditionObjRefs_1RetAddComponent1 = AdditionObjRefs_1.GetOutPort( 'RetAddComponent1' ) + #OAdditionObjRefs_1RetAdder2 = AdditionObjRefs_1.GetOutPort( 'RetAdder2' ) + #OAdditionObjRefs_1RetAdder3 = AdditionObjRefs_1.GetOutPort( 'RetAdder3' ) + return GraphObjRefOMNIORB4 + + +GraphObjRefOMNIORB4 = DefGraphObjRefOMNIORB4() diff --git a/examples/GraphObjRefOMNIORB4.xml b/examples/GraphObjRefOMNIORB4.xml new file mode 100644 index 0000000..8194e8e --- /dev/null +++ b/examples/GraphObjRefOMNIORB4.xml @@ -0,0 +1,625 @@ + + + + + + ? + ? + GraphObjRefOMNIORB4 + 1 + ? + + GraphObjRefOMNIORB4 + + + string + AddComponent__aContainer + + + string + AddComponent__aComponent + + + string + LccAddComponent__aContainer + + + string + LccAddComponent__aComponentName + + + string + EmbeddedLccAddComponent__aContainer + + + string + EmbeddedLccAddComponent__aComponentName + + + + + boolean + AdditionObjRefs__return + + + Adder + AdditionObjRefs__RetAdder2 + + + Adder + AdditionObjRefs__RetAdder3 + + + objref + FindComponentInstance__AddComponentObjRef + + + objref + FindComponentInstance_1__AddComponentRef + + + boolean + AdditionObjRefs_1__return + + + AddComponent + AdditionObjRefs_1__RetAddComponent1 + + + Adder + AdditionObjRefs_1__RetAdder2 + + + Adder + AdditionObjRefs_1__RetAdder3 + + + + + + 8/8/2005 - 12:45:3 + 25/8/2005 - 11:29:11 + 2.0 + ? + ? + ? + 0 + 0 + + + + + ? + ? + AddComponent + 3 + ? + + AddComponent + + + string + aContainer + + + string + aComponent + + + + + objref + AddComponentobjref + + + + + + + defAddComponent + + + + + + + + + + + + 25/8/2005 - 11:29:11 + 25/8/2005 - 11:29:11 + 2.0 + ? + ? + Compute Node + 240 + 31 + + + AddComponent + AddComponent + Addition + 0 + ? + + Addition + + + + Adder + Adder + + + + + + 25/8/2005 - 11:29:11 + 25/8/2005 - 11:29:11 + 2.0 + ? + localhost/FactoryServer + Addition from AddComponent + 13 + 185 + + + AddComponent + AddComponent + EmbeddedAddition + 0 + ? + + Addition + + + + Adder + Adder + + + + + + 25/8/2005 - 11:29:11 + 25/8/2005 - 11:29:11 + 2.0 + ? + localhost/SuperVisionContainer + Addition from AddComponent + 17 + 347 + + + ? + ? + LccAddComponent + 2 + ? + + LccAddComponent + + + SuperVisionTest::Adder + Adder + + + string + aContainer + + + string + aComponentName + + + + + Component + return + + + + + + 25/8/2005 - 11:29:11 + 25/8/2005 - 11:29:11 + 2.0 + ? + ? + Compute Node + 235 + 184 + + + ? + ? + EmbeddedLccAddComponent + 2 + ? + + LccAddComponent + + + SuperVisionTest::Adder + Adder + + + string + aContainer + + + string + aComponentName + + + + + Component + return + + + + + + 25/8/2005 - 11:29:11 + 25/8/2005 - 11:29:11 + 2.0 + ? + ? + Compute Node + 235 + 347 + + + AddComponent + AddComponent + AdditionObjRefs + 0 + ? + + AdditionObjRefs + + + AddComponent + AddComponent1 + + + Adder + Adder2 + + + Adder + Adder3 + + + + + boolean + return + + + AddComponent + RetAddComponent1 + + + Adder + RetAdder2 + + + Adder + RetAdder3 + + + + + + 25/8/2005 - 11:29:11 + 25/8/2005 - 11:29:11 + 2.0 + ? + localhost/FactoryServer + AdditionObjRefs from AddComponent + 453 + 164 + + + ? + ? + FindComponentInstance + 3 + ? + + FindComponentInstance + + + objref + AddComponentObjRef + + + + + objref + AddComponentObjRef + + + + + + + FindComponentInstance + + + + + + + + + + + + + + + + + 25/8/2005 - 11:29:11 + 25/8/2005 - 11:29:11 + 2.0 + ? + ? + Compute Node + 648 + 184 + + + ? + ? + FindComponentInstance_1 + 3 + ? + + FindComponentInstance_1 + + + objref + AddComponentRef + + + + + objref + AddComponentRef + + + + + + + FindComponentInstance_1 + + + + + + + + + + + + + + + + + + + + + 25/8/2005 - 11:29:11 + 25/8/2005 - 11:29:11 + 3.0 + ? + ? + Compute Node + 647 + 31 + + + AddComponent + AddComponent + AdditionObjRefs_1 + 0 + ? + + AdditionObjRefs + + + AddComponent + AddComponent1 + + + Adder + Adder2 + + + Adder + Adder3 + + + + + boolean + return + + + AddComponent + RetAddComponent1 + + + Adder + RetAdder2 + + + Adder + RetAdder3 + + + + + + 25/8/2005 - 11:29:11 + 25/8/2005 - 11:29:11 + 3.0 + ? + localhost/AdditionObjRefsServer + AdditionObjRefs from AddComponent + 457 + 345 + + + + + AddComponent + AddComponentobjref + AdditionObjRefs + AddComponent1 + + + + AddComponent + AddComponentobjref + FindComponentInstance_1 + AddComponentRef + + + + AddComponent + AddComponentobjref + AdditionObjRefs_1 + AddComponent1 + + + + Addition + Adder + LccAddComponent + Adder + + + + EmbeddedAddition + Adder + EmbeddedLccAddComponent + Adder + + + + LccAddComponent + return + AdditionObjRefs + Adder2 + + + + LccAddComponent + return + AdditionObjRefs_1 + Adder2 + + + + EmbeddedLccAddComponent + return + AdditionObjRefs + Adder3 + + + + EmbeddedLccAddComponent + return + AdditionObjRefs_1 + Adder3 + + + + AdditionObjRefs + RetAddComponent1 + FindComponentInstance + AddComponentObjRef + + + + + + GraphObjRefOMNIORB4 + AddComponent__aContainer + AddComponent + aContainer + + 18 + + + + + + GraphObjRefOMNIORB4 + AddComponent__aComponent + AddComponent + aComponent + + 18 + + + + + + GraphObjRefOMNIORB4 + LccAddComponent__aContainer + LccAddComponent + aContainer + + 18 + + + + + + GraphObjRefOMNIORB4 + LccAddComponent__aComponentName + LccAddComponent + aComponentName + + 18 + + + + + + GraphObjRefOMNIORB4 + EmbeddedLccAddComponent__aContainer + EmbeddedLccAddComponent + aContainer + + 18 + + + + + + GraphObjRefOMNIORB4 + EmbeddedLccAddComponent__aComponentName + EmbeddedLccAddComponent + aComponentName + + 18 + + + + + + + + diff --git a/examples/GraphObjRefOMNIORB4_StandAlone.py b/examples/GraphObjRefOMNIORB4_StandAlone.py new file mode 100644 index 0000000..3b151a6 --- /dev/null +++ b/examples/GraphObjRefOMNIORB4_StandAlone.py @@ -0,0 +1,27 @@ +from SuperV import * +import Engines +def FindComponentInstance( ComponentRef ) : + print "FindComponentInstance",ComponentRef + AddComponentObjRef = ComponentRef._narrow(Engines.Component) + print "FindComponentInstance",AddComponentObjRef + TheContainer = AddComponentObjRef.GetContainerRef() + print "FindComponentInstance",TheContainer + TheAddComponentObjRef=TheContainer.find_component_instance( "AddComponent" , 0 ) + print "FindComponentInstance",TheAddComponentObjRef + return TheAddComponentObjRef + +from LifeCycleCORBA import * +def defAddComponent( aContainer , aComponent ) : + orb = CORBA.ORB_init([], CORBA.ORB_ID) + lcc = LifeCycleCORBA(orb) + ComponentRef = lcc.FindOrLoadComponent( aContainer , aComponent ) + return ComponentRef + +AddComponent = defAddComponent( 'FactoryServer' , 'AddComponent' ) +AddComponent._narrow( Engines.Component ).ping() + +ComponentRef = FindComponentInstance( AddComponent ) +ComponentRef.ping() + + + diff --git a/examples/GraphPyFunctions.py b/examples/GraphPyFunctions.py index ddd184e..91c5de5 100755 --- a/examples/GraphPyFunctions.py +++ b/examples/GraphPyFunctions.py @@ -1,217 +1,241 @@ -# Generated python file of Graph GraphSwitch +# Generated python file of Graph GraphPyFunctions_1 from SuperV import * -# Graph creation -GraphPyFunctions = Graph( 'GraphPyFunctions' ) -GraphPyFunctions.SetName( 'GraphPyFunctions' ) -GraphPyFunctions.SetAuthor( '' ) -GraphPyFunctions.SetComment( '' ) -GraphPyFunctions.Coords( 0 , 0 ) -# Creation of Factory Nodes - -# Creation of InLine Nodes -PyIsOdd = [] -IsOdd = GraphPyFunctions.INode( 'IsOdd' , PyIsOdd ) -IsOdd.SetName( 'IsOdd' ) -IsOdd.SetAuthor( '' ) -IsOdd.SetComment( 'Python function' ) -IsOdd.Coords( 388 , 50 ) -IsOdd.InPort( 'a' , 'long' ) -IsOdd.OutPort( 'a' , 'long' ) - -PyIsOdd_1 = [] -PyIsOdd_1.append( 'from time import * ' ) -PyIsOdd_1.append( 'def IsOdd(a) : ' ) -PyIsOdd_1.append( ' print a,"IsOdd" ' ) -PyIsOdd_1.append( ' sleep( 1 ) ' ) -PyIsOdd_1.append( ' return a ' ) -IsOdd_1 = GraphPyFunctions.INode( 'IsOdd' , PyIsOdd_1 ) -IsOdd_1.SetName( 'IsOdd_1' ) -IsOdd_1.SetAuthor( '' ) -IsOdd_1.SetComment( 'Python function' ) -IsOdd_1.Coords( 391 , 288 ) -IsOdd_1.InPort( 'a' , 'long' ) -IsOdd_1.OutPort( 'a' , 'long' ) - -# Creation of Loop Nodes -PyInitLoop = [] -PyInitLoop.append( 'def InitLoop(Index,Min,Max) : ' ) -PyInitLoop.append( ' return Index,Min,Max ' ) -PyMoreInitLoop = [] -PyMoreInitLoop.append( 'def MoreLoop(Index,Min,Max) : ' ) -PyMoreInitLoop.append( ' if Index <= Max : ' ) -PyMoreInitLoop.append( ' DoLoop = 1 ' ) -PyMoreInitLoop.append( ' else : ' ) -PyMoreInitLoop.append( ' DoLoop = 0 ' ) -PyMoreInitLoop.append( ' return DoLoop,Index,Min,Max ' ) -PyNextInitLoop = [] -PyNextInitLoop.append( 'def NextLoop(Index,Min,Max) : ' ) -PyNextInitLoop.append( ' Index = Index + 1 ' ) -PyNextInitLoop.append( ' return Index,Min,Max ' ) -InitLoop,EndOfInitLoop = GraphPyFunctions.LNode( 'InitLoop' , PyInitLoop , 'MoreLoop' , PyMoreInitLoop , 'NextLoop' , PyNextInitLoop ) -EndOfInitLoop.SetName( 'EndOfInitLoop' ) -EndOfInitLoop.SetAuthor( '' ) -EndOfInitLoop.SetComment( '' ) -EndOfInitLoop.Coords( 766 , 127 ) -PyEndOfInitLoop = [] -EndOfInitLoop.SetPyFunction( 'EndInitLoop' , PyEndOfInitLoop ) -InitLoop.SetName( 'InitLoop' ) -InitLoop.SetAuthor( '' ) -InitLoop.SetComment( '' ) -InitLoop.Coords( 10 , 129 ) -InitLoop.InPort( 'Index' , 'long' ) -InitLoop.InPort( 'Min' , 'long' ) -InitLoop.InPort( 'Max' , 'long' ) -InitLoop.OutPort( 'Index' , 'long' ) -InitLoop.OutPort( 'Min' , 'long' ) -InitLoop.OutPort( 'Max' , 'long' ) - -PyInitLoop_1 = [] -PyMoreInitLoop_1 = [] -PyMoreInitLoop_1.append( '' ) -PyNextInitLoop_1 = [] -PyNextInitLoop_1.append( '' ) -InitLoop_1,EndOfInitLoop_1 = GraphPyFunctions.LNode( 'InitLoop' , PyInitLoop_1 , 'MoreLoop' , PyMoreInitLoop_1 , 'NextLoop' , PyNextInitLoop_1 ) -EndOfInitLoop_1.SetName( 'EndOfInitLoop_1' ) -EndOfInitLoop_1.SetAuthor( '' ) -EndOfInitLoop_1.SetComment( '' ) -EndOfInitLoop_1.Coords( 784 , 361 ) -PyEndOfInitLoop_1 = [] -EndOfInitLoop_1.SetPyFunction( 'EndInitLoop' , PyEndOfInitLoop_1 ) -InitLoop_1.SetName( 'InitLoop_1' ) -InitLoop_1.SetAuthor( '' ) -InitLoop_1.SetComment( '' ) -InitLoop_1.Coords( 12 , 369 ) -InitLoop_1.InPort( 'Index' , 'long' ) -InitLoop_1.InPort( 'Min' , 'long' ) -InitLoop_1.InPort( 'Max' , 'long' ) -InitLoop_1.OutPort( 'Index' , 'long' ) -InitLoop_1.OutPort( 'Min' , 'long' ) -InitLoop_1.OutPort( 'Max' , 'long' ) - -# Creation of Switch Nodes -PySwitch = [] -Switch,EndOfSwitch = GraphPyFunctions.SNode( 'Switch' , PySwitch ) -EndOfSwitch.SetName( 'EndOfSwitch' ) -EndOfSwitch.SetAuthor( '' ) -EndOfSwitch.SetComment( '' ) -EndOfSwitch.Coords( 587 , 126 ) -PyEndOfSwitch = [] -EndOfSwitch.SetPyFunction( 'EndOfSwitch_1' , PyEndOfSwitch ) -EndOfSwitch.InPort( 'a' , 'long' ) -EndOfSwitch.OutPort( 'a' , 'long' ) -Switch.SetName( 'Switch' ) -Switch.SetAuthor( '' ) -Switch.SetComment( '' ) -Switch.Coords( 186 , 130 ) -Switch.InPort( 'a' , 'long' ) -Switch.OutPort( 'Odd' , 'long' ) -Switch.OutPort( 'Even' , 'int' ) -Switch.OutPort( 'a' , 'int' ) - -PySwitch_1 = [] -PySwitch_1.append( 'from time import * ' ) -PySwitch_1.append( 'def Switch(a) : ' ) -PySwitch_1.append( ' if ( a & 1 ) == 0 : ' ) -PySwitch_1.append( ' sleep(1) ' ) -PySwitch_1.append( ' return a & 1,1-(a&1),a ' ) -Switch_1,EndOfSwitch_1 = GraphPyFunctions.SNode( 'Switch' , PySwitch_1 ) -EndOfSwitch_1.SetName( 'EndOfSwitch_1' ) -EndOfSwitch_1.SetAuthor( '' ) -EndOfSwitch_1.SetComment( '' ) -EndOfSwitch_1.Coords( 594 , 362 ) -PyEndOfSwitch_1 = [] -EndOfSwitch_1.SetPyFunction( 'EndOfSwitch_1' , PyEndOfSwitch_1 ) -EndOfSwitch_1.InPort( 'a' , 'long' ) -EndOfSwitch_1.OutPort( 'a' , 'long' ) -Switch_1.SetName( 'Switch_1' ) -Switch_1.SetAuthor( '' ) -Switch_1.SetComment( '' ) -Switch_1.Coords( 185 , 368 ) -Switch_1.InPort( 'a' , 'long' ) -Switch_1.OutPort( 'Odd' , 'long' ) -Switch_1.OutPort( 'Even' , 'int' ) -Switch_1.OutPort( 'a' , 'int' ) - -# Creation of Links -IsOdda = IsOdd.Port( 'a' ) -EndOfSwitcha = GraphPyFunctions.Link( IsOdda , EndOfSwitch.Port( 'a' ) ) -EndOfSwitcha.AddCoord( 1 , 571 , 160 ) -EndOfSwitcha.AddCoord( 2 , 571 , 129 ) - -InitLoopIndex = InitLoop.Port( 'Index' ) -Switcha = GraphPyFunctions.Link( InitLoopIndex , Switch.Port( 'a' ) ) - -InitLoopMin = InitLoop.Port( 'Min' ) -EndOfInitLoopMin = GraphPyFunctions.Link( InitLoopMin , EndOfInitLoop.Port( 'Min' ) ) - -InitLoopMax = InitLoop.Port( 'Max' ) -EndOfInitLoopMax = GraphPyFunctions.Link( InitLoopMax , EndOfInitLoop.Port( 'Max' ) ) - -SwitchOdd = Switch.Port( 'Odd' ) -IsOddInGate = GraphPyFunctions.Link( SwitchOdd , IsOdd.Port( 'InGate' ) ) - -Switcha = Switch.Port( 'a' ) -IsOdda = GraphPyFunctions.Link( Switcha , IsOdd.Port( 'a' ) ) -IsOdda.AddCoord( 1 , 366 , 131 ) -IsOdda.AddCoord( 2 , 365 , 223 ) - -SwitchDefault = Switch.Port( 'Default' ) -EndOfSwitchDefault = GraphPyFunctions.Link( SwitchDefault , EndOfSwitch.Port( 'Default' ) ) -EndOfSwitchDefault.AddCoord( 1 , 572 , 194 ) -EndOfSwitchDefault.AddCoord( 2 , 571 , 257 ) - -EndOfSwitcha = EndOfSwitch.Port( 'a' ) -EndOfInitLoopIndex = GraphPyFunctions.Link( EndOfSwitcha , EndOfInitLoop.Port( 'Index' ) ) - -IsOdd_1a = IsOdd_1.Port( 'a' ) -EndOfSwitch_1a = GraphPyFunctions.Link( IsOdd_1a , EndOfSwitch_1.Port( 'a' ) ) -EndOfSwitch_1a.AddCoord( 1 , 580 , 396 ) -EndOfSwitch_1a.AddCoord( 2 , 580 , 368 ) - -InitLoop_1Index = InitLoop_1.Port( 'Index' ) -Switch_1a = GraphPyFunctions.Link( InitLoop_1Index , Switch_1.Port( 'a' ) ) - -InitLoop_1Min = InitLoop_1.Port( 'Min' ) -EndOfInitLoop_1Min = GraphPyFunctions.Link( InitLoop_1Min , EndOfInitLoop_1.Port( 'Min' ) ) - -InitLoop_1Max = InitLoop_1.Port( 'Max' ) -EndOfInitLoop_1Max = GraphPyFunctions.Link( InitLoop_1Max , EndOfInitLoop_1.Port( 'Max' ) ) - -Switch_1Odd = Switch_1.Port( 'Odd' ) -IsOdd_1InGate = GraphPyFunctions.Link( Switch_1Odd , IsOdd_1.Port( 'InGate' ) ) - -Switch_1Even = Switch_1.Port( 'Even' ) -EndOfSwitch_1Default = GraphPyFunctions.Link( Switch_1Even , EndOfSwitch_1.Port( 'Default' ) ) - -Switch_1a = Switch_1.Port( 'a' ) -IsOdd_1a = GraphPyFunctions.Link( Switch_1a , IsOdd_1.Port( 'a' ) ) -IsOdd_1a.AddCoord( 1 , 368 , 368 ) -IsOdd_1a.AddCoord( 2 , 367 , 460 ) - -EndOfSwitch_1a = EndOfSwitch_1.Port( 'a' ) -EndOfInitLoop_1Index = GraphPyFunctions.Link( EndOfSwitch_1a , EndOfInitLoop_1.Port( 'Index' ) ) - -# Creation of Input datas -InitLoopIndex = InitLoop.Input( 'Index' , 0) -InitLoopMin = InitLoop.Input( 'Min' , 0) -InitLoopMax = InitLoop.Input( 'Max' , 100) -InitLoop_1Index = InitLoop_1.Input( 'Index' , 0) -InitLoop_1Min = InitLoop_1.Input( 'Min' , 0) -InitLoop_1Max = InitLoop_1.Input( 'Max' , 100) - -# Creation of Output variables -EndOfInitLoopIndex = EndOfInitLoop.Port( 'Index' ) -EndOfInitLoopMin = EndOfInitLoop.Port( 'Min' ) -EndOfInitLoopMax = EndOfInitLoop.Port( 'Max' ) -SwitchEven = Switch.Port( 'Even' ) -EndOfInitLoop_1Index = EndOfInitLoop_1.Port( 'Index' ) -EndOfInitLoop_1Min = EndOfInitLoop_1.Port( 'Min' ) -EndOfInitLoop_1Max = EndOfInitLoop_1.Port( 'Max' ) - -GraphPyFunctions.Run() -GraphPyFunctions.DoneW() -GraphPyFunctions.State() -GraphPyFunctions.PrintPorts() +# Graph creation of GraphPyFunctions_1 +def DefGraphPyFunctions_1() : + GraphPyFunctions_1 = Graph( 'GraphPyFunctions_1' ) + GraphPyFunctions_1.SetName( 'GraphPyFunctions_1' ) + GraphPyFunctions_1.SetAuthor( '' ) + GraphPyFunctions_1.SetComment( '' ) + GraphPyFunctions_1.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsOdd = [] + IsOdd = GraphPyFunctions_1.INode( 'IsOdd' , PyIsOdd ) + IsOdd.SetName( 'IsOdd' ) + IsOdd.SetAuthor( '' ) + IsOdd.SetComment( 'Python function' ) + IsOdd.Coords( 388 , 50 ) + IIsOdda = IsOdd.InPort( 'a' , 'long' ) + IIsOddGate = IsOdd.GetInPort( 'Gate' ) + OIsOdda = IsOdd.OutPort( 'a' , 'long' ) + OIsOddGate = IsOdd.GetOutPort( 'Gate' ) + + PyIsOdd_1 = [] + PyIsOdd_1.append( 'from time import * ' ) + PyIsOdd_1.append( 'def IsOdd(a) : ' ) + PyIsOdd_1.append( ' print a,"IsOdd" ' ) + PyIsOdd_1.append( ' sleep( 1 ) ' ) + PyIsOdd_1.append( ' return a ' ) + IsOdd_1 = GraphPyFunctions_1.INode( 'IsOdd' , PyIsOdd_1 ) + IsOdd_1.SetName( 'IsOdd_1' ) + IsOdd_1.SetAuthor( '' ) + IsOdd_1.SetComment( 'Python function' ) + IsOdd_1.Coords( 391 , 288 ) + IIsOdd_1a = IsOdd_1.InPort( 'a' , 'long' ) + IIsOdd_1Gate = IsOdd_1.GetInPort( 'Gate' ) + OIsOdd_1a = IsOdd_1.OutPort( 'a' , 'long' ) + OIsOdd_1Gate = IsOdd_1.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyInitLoop = [] + PyInitLoop.append( 'def InitLoop(Index,Min,Max) : ' ) + PyInitLoop.append( ' return Index,Min,Max ' ) + PyMoreInitLoop = [] + PyMoreInitLoop.append( 'def MoreLoop(Index,Min,Max) : ' ) + PyMoreInitLoop.append( ' if Index <= Max : ' ) + PyMoreInitLoop.append( ' DoLoop = 1 ' ) + PyMoreInitLoop.append( ' else : ' ) + PyMoreInitLoop.append( ' DoLoop = 0 ' ) + PyMoreInitLoop.append( ' return DoLoop,Index,Min,Max ' ) + PyNextInitLoop = [] + PyNextInitLoop.append( 'def NextLoop(Index,Min,Max) : ' ) + PyNextInitLoop.append( ' Index = Index + 1 ' ) + PyNextInitLoop.append( ' return Index,Min,Max ' ) + InitLoop,EndOfInitLoop = GraphPyFunctions_1.LNode( 'InitLoop' , PyInitLoop , 'MoreLoop' , PyMoreInitLoop , 'NextLoop' , PyNextInitLoop ) + EndOfInitLoop.SetName( 'EndOfInitLoop' ) + EndOfInitLoop.SetAuthor( '' ) + EndOfInitLoop.SetComment( 'Compute Node' ) + EndOfInitLoop.Coords( 766 , 127 ) + PyEndOfInitLoop = [] + EndOfInitLoop.SetPyFunction( 'EndInitLoop' , PyEndOfInitLoop ) + IInitLoopDoLoop = InitLoop.GetInPort( 'DoLoop' ) + IInitLoopIndex = InitLoop.InPort( 'Index' , 'long' ) + IInitLoopMin = InitLoop.InPort( 'Min' , 'long' ) + IInitLoopMax = InitLoop.InPort( 'Max' , 'long' ) + IInitLoopGate = InitLoop.GetInPort( 'Gate' ) + OInitLoopDoLoop = InitLoop.GetOutPort( 'DoLoop' ) + OInitLoopIndex = InitLoop.GetOutPort( 'Index' ) + OInitLoopMin = InitLoop.GetOutPort( 'Min' ) + OInitLoopMax = InitLoop.GetOutPort( 'Max' ) + IEndOfInitLoopDoLoop = EndOfInitLoop.GetInPort( 'DoLoop' ) + IEndOfInitLoopIndex = EndOfInitLoop.GetInPort( 'Index' ) + IEndOfInitLoopMin = EndOfInitLoop.GetInPort( 'Min' ) + IEndOfInitLoopMax = EndOfInitLoop.GetInPort( 'Max' ) + IEndOfInitLoopGate = EndOfInitLoop.GetInPort( 'Gate' ) + OEndOfInitLoopDoLoop = EndOfInitLoop.GetOutPort( 'DoLoop' ) + OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) + OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) + OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) + OEndOfInitLoopGate = EndOfInitLoop.GetOutPort( 'Gate' ) + InitLoop.SetName( 'InitLoop' ) + InitLoop.SetAuthor( '' ) + InitLoop.SetComment( 'Compute Node' ) + InitLoop.Coords( 10 , 129 ) + + PyInitLoop_1 = [] + PyMoreInitLoop_1 = [] + PyMoreInitLoop_1.append( '' ) + PyNextInitLoop_1 = [] + PyNextInitLoop_1.append( '' ) + InitLoop_1,EndOfInitLoop_1 = GraphPyFunctions_1.LNode( 'InitLoop' , PyInitLoop_1 , 'MoreLoop' , PyMoreInitLoop_1 , 'NextLoop' , PyNextInitLoop_1 ) + EndOfInitLoop_1.SetName( 'EndOfInitLoop_1' ) + EndOfInitLoop_1.SetAuthor( '' ) + EndOfInitLoop_1.SetComment( 'Compute Node' ) + EndOfInitLoop_1.Coords( 784 , 361 ) + PyEndOfInitLoop_1 = [] + EndOfInitLoop_1.SetPyFunction( 'EndInitLoop' , PyEndOfInitLoop_1 ) + IInitLoop_1DoLoop = InitLoop_1.GetInPort( 'DoLoop' ) + IInitLoop_1Index = InitLoop_1.InPort( 'Index' , 'long' ) + IInitLoop_1Min = InitLoop_1.InPort( 'Min' , 'long' ) + IInitLoop_1Max = InitLoop_1.InPort( 'Max' , 'long' ) + IInitLoop_1Gate = InitLoop_1.GetInPort( 'Gate' ) + OInitLoop_1DoLoop = InitLoop_1.GetOutPort( 'DoLoop' ) + OInitLoop_1Index = InitLoop_1.GetOutPort( 'Index' ) + OInitLoop_1Min = InitLoop_1.GetOutPort( 'Min' ) + OInitLoop_1Max = InitLoop_1.GetOutPort( 'Max' ) + IEndOfInitLoop_1DoLoop = EndOfInitLoop_1.GetInPort( 'DoLoop' ) + IEndOfInitLoop_1Index = EndOfInitLoop_1.GetInPort( 'Index' ) + IEndOfInitLoop_1Min = EndOfInitLoop_1.GetInPort( 'Min' ) + IEndOfInitLoop_1Max = EndOfInitLoop_1.GetInPort( 'Max' ) + IEndOfInitLoop_1Gate = EndOfInitLoop_1.GetInPort( 'Gate' ) + OEndOfInitLoop_1DoLoop = EndOfInitLoop_1.GetOutPort( 'DoLoop' ) + OEndOfInitLoop_1Index = EndOfInitLoop_1.GetOutPort( 'Index' ) + OEndOfInitLoop_1Min = EndOfInitLoop_1.GetOutPort( 'Min' ) + OEndOfInitLoop_1Max = EndOfInitLoop_1.GetOutPort( 'Max' ) + OEndOfInitLoop_1Gate = EndOfInitLoop_1.GetOutPort( 'Gate' ) + InitLoop_1.SetName( 'InitLoop_1' ) + InitLoop_1.SetAuthor( '' ) + InitLoop_1.SetComment( 'Compute Node' ) + InitLoop_1.Coords( 12 , 369 ) + + # Creation of Switch Nodes + PySwitch = [] + Switch,EndOfSwitch = GraphPyFunctions_1.SNode( 'Switch' , PySwitch ) + EndOfSwitch.SetName( 'EndOfSwitch' ) + EndOfSwitch.SetAuthor( '' ) + EndOfSwitch.SetComment( 'Compute Node' ) + EndOfSwitch.Coords( 587 , 126 ) + PyEndOfSwitch = [] + EndOfSwitch.SetPyFunction( 'EndOfSwitch_1' , PyEndOfSwitch ) + IEndOfSwitcha = EndOfSwitch.InPort( 'a' , 'long' ) + IEndOfSwitchDefault = EndOfSwitch.GetInPort( 'Default' ) + OEndOfSwitcha = EndOfSwitch.OutPort( 'a' , 'long' ) + OEndOfSwitchGate = EndOfSwitch.GetOutPort( 'Gate' ) + Switch.SetName( 'Switch' ) + Switch.SetAuthor( '' ) + Switch.SetComment( 'Compute Node' ) + Switch.Coords( 186 , 130 ) + ISwitcha = Switch.InPort( 'a' , 'long' ) + ISwitchGate = Switch.GetInPort( 'Gate' ) + OSwitchOdd = Switch.OutPort( 'Odd' , 'long' ) + OSwitchEven = Switch.OutPort( 'Even' , 'int' ) + OSwitcha = Switch.OutPort( 'a' , 'int' ) + OSwitchDefault = Switch.GetOutPort( 'Default' ) + + PySwitch_1 = [] + PySwitch_1.append( 'from time import * ' ) + PySwitch_1.append( 'def Switch(a) : ' ) + PySwitch_1.append( ' if ( a & 1 ) == 0 : ' ) + PySwitch_1.append( ' sleep(1) ' ) + PySwitch_1.append( ' return a & 1,1-(a&1),a ' ) + Switch_1,EndOfSwitch_1 = GraphPyFunctions_1.SNode( 'Switch' , PySwitch_1 ) + EndOfSwitch_1.SetName( 'EndOfSwitch_1' ) + EndOfSwitch_1.SetAuthor( '' ) + EndOfSwitch_1.SetComment( 'Compute Node' ) + EndOfSwitch_1.Coords( 594 , 362 ) + PyEndOfSwitch_1 = [] + EndOfSwitch_1.SetPyFunction( 'EndOfSwitch_1' , PyEndOfSwitch_1 ) + IEndOfSwitch_1a = EndOfSwitch_1.InPort( 'a' , 'long' ) + IEndOfSwitch_1Default = EndOfSwitch_1.GetInPort( 'Default' ) + OEndOfSwitch_1a = EndOfSwitch_1.OutPort( 'a' , 'long' ) + OEndOfSwitch_1Gate = EndOfSwitch_1.GetOutPort( 'Gate' ) + Switch_1.SetName( 'Switch_1' ) + Switch_1.SetAuthor( '' ) + Switch_1.SetComment( 'Compute Node' ) + Switch_1.Coords( 185 , 368 ) + ISwitch_1a = Switch_1.InPort( 'a' , 'long' ) + ISwitch_1Gate = Switch_1.GetInPort( 'Gate' ) + OSwitch_1Odd = Switch_1.OutPort( 'Odd' , 'long' ) + OSwitch_1Even = Switch_1.OutPort( 'Even' , 'int' ) + OSwitch_1a = Switch_1.OutPort( 'a' , 'int' ) + OSwitch_1Default = Switch_1.GetOutPort( 'Default' ) + + # Creation of Links + LIsOddaEndOfSwitcha = GraphPyFunctions_1.Link( OIsOdda , IEndOfSwitcha ) + LIsOddaEndOfSwitcha.AddCoord( 1 , 571 , 160 ) + LIsOddaEndOfSwitcha.AddCoord( 2 , 571 , 129 ) + + LIsOdd_1aEndOfSwitch_1a = GraphPyFunctions_1.Link( OIsOdd_1a , IEndOfSwitch_1a ) + LIsOdd_1aEndOfSwitch_1a.AddCoord( 1 , 580 , 396 ) + LIsOdd_1aEndOfSwitch_1a.AddCoord( 2 , 580 , 368 ) + + LInitLoopIndexSwitcha = GraphPyFunctions_1.Link( OInitLoopIndex , ISwitcha ) + + LInitLoopMinEndOfInitLoopMin = GraphPyFunctions_1.Link( OInitLoopMin , IEndOfInitLoopMin ) + + LInitLoopMaxEndOfInitLoopMax = GraphPyFunctions_1.Link( OInitLoopMax , IEndOfInitLoopMax ) + + LInitLoop_1IndexSwitch_1a = GraphPyFunctions_1.Link( OInitLoop_1Index , ISwitch_1a ) + + LInitLoop_1MinEndOfInitLoop_1Min = GraphPyFunctions_1.Link( OInitLoop_1Min , IEndOfInitLoop_1Min ) + + LInitLoop_1MaxEndOfInitLoop_1Max = GraphPyFunctions_1.Link( OInitLoop_1Max , IEndOfInitLoop_1Max ) + + LSwitchOddIsOddGate = GraphPyFunctions_1.Link( OSwitchOdd , IIsOddGate ) + + LSwitchaIsOdda = GraphPyFunctions_1.Link( OSwitcha , IIsOdda ) + LSwitchaIsOdda.AddCoord( 1 , 366 , 131 ) + LSwitchaIsOdda.AddCoord( 2 , 365 , 223 ) + + LSwitchDefaultEndOfSwitchDefault = GraphPyFunctions_1.Link( OSwitchDefault , IEndOfSwitchDefault ) + LSwitchDefaultEndOfSwitchDefault.AddCoord( 1 , 572 , 194 ) + LSwitchDefaultEndOfSwitchDefault.AddCoord( 2 , 571 , 257 ) + + LEndOfSwitchaEndOfInitLoopIndex = GraphPyFunctions_1.Link( OEndOfSwitcha , IEndOfInitLoopIndex ) + + LSwitch_1OddIsOdd_1Gate = GraphPyFunctions_1.Link( OSwitch_1Odd , IIsOdd_1Gate ) + + LSwitch_1aIsOdd_1a = GraphPyFunctions_1.Link( OSwitch_1a , IIsOdd_1a ) + LSwitch_1aIsOdd_1a.AddCoord( 1 , 368 , 368 ) + LSwitch_1aIsOdd_1a.AddCoord( 2 , 367 , 460 ) + + LSwitch_1DefaultEndOfSwitch_1Default = GraphPyFunctions_1.Link( OSwitch_1Default , IEndOfSwitch_1Default ) + + LEndOfSwitch_1aEndOfInitLoop_1Index = GraphPyFunctions_1.Link( OEndOfSwitch_1a , IEndOfInitLoop_1Index ) + + # Input datas + IInitLoopIndex.Input( 0 ) + IInitLoopMin.Input( 0 ) + IInitLoopMax.Input( 25 ) + IInitLoop_1Index.Input( 0 ) + IInitLoop_1Min.Input( 0 ) + IInitLoop_1Max.Input( 35 ) + + # Output Ports of the graph + #OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) + #OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) + #OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) + #OEndOfInitLoop_1Index = EndOfInitLoop_1.GetOutPort( 'Index' ) + #OEndOfInitLoop_1Min = EndOfInitLoop_1.GetOutPort( 'Min' ) + #OEndOfInitLoop_1Max = EndOfInitLoop_1.GetOutPort( 'Max' ) + #OSwitchEven = Switch.GetOutPort( 'Even' ) + #OSwitch_1Even = Switch_1.GetOutPort( 'Even' ) + return GraphPyFunctions_1 + + +GraphPyFunctions_1 = DefGraphPyFunctions_1() diff --git a/examples/GraphPyFunctions.xml b/examples/GraphPyFunctions.xml index 91826b5..477b68f 100755 --- a/examples/GraphPyFunctions.xml +++ b/examples/GraphPyFunctions.xml @@ -1,647 +1,651 @@ - + + ? - ? - GraphPyFunctions - 1 - ? - -GraphPyFunctions - + ? + GraphPyFunctions_1 + 1 + ? + +GraphPyFunctions_1 + long - InitLoop\Index - + InitLoop__Index + long - InitLoop\Min - + InitLoop__Min + long - InitLoop\Max - + InitLoop__Max + long - InitLoop_1\Index - + InitLoop_1__Index + long - InitLoop_1\Min - + InitLoop_1__Min + long - InitLoop_1\Max - + InitLoop_1__Max + long - EndOfInitLoop\Index - + EndOfInitLoop__Index + long - EndOfInitLoop\Min - + EndOfInitLoop__Min + long - EndOfInitLoop\Max - + EndOfInitLoop__Max + long - EndOfInitLoop_1\Index - + EndOfInitLoop_1__Index + long - EndOfInitLoop_1\Min - + EndOfInitLoop_1__Min + long - EndOfInitLoop_1\Max - + EndOfInitLoop_1__Max + int - Switch\Even - - - 23/10/2003 - 17:46:20 - 23/10/2003 - 17:47:28 - 1.05 - ? - ? - ? - 0 - 0 - + Switch__Even + +int + Switch_1__Even + + + 23/10/2003 - 17:46:20 + 8/7/2005 - 11:22:37 + 1.05 + ? + ? + ? + 0 + 0 + ? - ? - IsOdd - 3 - ? - + ? + IsOdd + 3 + ? + IsOdd - + long - a - + a + long - a - - + a + + IsOdd - - 23/10/2003 - 17:46:20 - 23/10/2003 - 17:46:20 - 1.05 - ? - ? - Python function - 388 - 50 - + + 8/7/2005 - 11:22:37 + 8/7/2005 - 11:22:37 + 1.05 + ? + ? + Python function + 388 + 50 + ? - ? - IsOdd_1 - 3 - ? - + ? + IsOdd_1 + 3 + ? + IsOdd_1 - + long - a - + a + long - a - - + a + + IsOdd - - - - - - 23/10/2003 - 17:46:21 - 23/10/2003 - 17:46:21 - 1.05 - ? - ? - Python function - 391 - 288 - + + + + + + 8/7/2005 - 11:22:37 + 8/7/2005 - 11:22:37 + 1.05 + ? + ? + Python function + 391 + 288 + ? - ? - InitLoop - 4 - EndOfInitLoop - + ? + InitLoop + 4 + EndOfInitLoop + InitLoop - + long - Index - + Index + long - Min - + Min + long - Max - + Max + long - Index - + Index + long - Min - + Min + long - Max - - + Max + + InitLoop - - - + + + MoreLoop - - - - - - - + + + + + + + NextLoop - - - - 23/10/2003 - 17:46:23 - 23/10/2003 - 17:46:23 - 1.05 - ? - ? - ? - 10 - 129 - + + + + 8/7/2005 - 11:22:37 + 8/7/2005 - 11:22:37 + 1.05 + ? + ? + Compute Node + 10 + 129 + ? - ? - EndOfInitLoop - 5 - InitLoop - -EndInitLoop - + ? + EndOfInitLoop + 5 + InitLoop + +EndOfInitLoop + long - Index - + Index + long - Min - + Min + long - Max - + Max + long - Index - + Index + long - Min - + Min + long - Max - - + Max + + EndInitLoop - - 23/10/2003 - 17:46:23 - 23/10/2003 - 17:46:23 - 1.05 - ? - ? - ? - 766 - 127 - + + 8/7/2005 - 11:22:37 + 8/7/2005 - 11:22:37 + 1.05 + ? + ? + Compute Node + 766 + 127 + ? - ? - InitLoop_1 - 4 - EndOfInitLoop_1 - + ? + InitLoop_1 + 4 + EndOfInitLoop_1 + InitLoop_1 - + long - Index - + Index + long - Min - + Min + long - Max - + Max + long - Index - + Index + long - Min - + Min + long - Max - - + Max + + InitLoop - - + + MoreLoop - - + + NextLoop - - 23/10/2003 - 17:46:24 - 23/10/2003 - 17:46:24 - 1.05 - ? - ? - ? - 12 - 369 - + + 8/7/2005 - 11:22:37 + 8/7/2005 - 11:22:37 + 1.05 + ? + ? + Compute Node + 12 + 369 + ? - ? - EndOfInitLoop_1 - 5 - InitLoop_1 - -EndInitLoop - + ? + EndOfInitLoop_1 + 5 + InitLoop_1 + +EndOfInitLoop_1 + long - Index - + Index + long - Min - + Min + long - Max - + Max + long - Index - + Index + long - Min - + Min + long - Max - - + Max + + EndInitLoop - - 23/10/2003 - 17:46:24 - 23/10/2003 - 17:46:24 - 1.05 - ? - ? - ? - 784 - 361 - + + 8/7/2005 - 11:22:37 + 8/7/2005 - 11:22:37 + 1.05 + ? + ? + Compute Node + 784 + 361 + ? - ? - Switch - 6 - EndOfSwitch - + ? + Switch + 6 + EndOfSwitch + Switch - + long - a - + a + long - Odd - + Odd + int - Even - + Even + int - a - - + a + + Switch - - 23/10/2003 - 17:46:26 - 23/10/2003 - 17:46:26 - 1.05 - ? - ? - ? - 186 - 130 - + + 8/7/2005 - 11:22:37 + 8/7/2005 - 11:22:37 + 1.05 + ? + ? + Compute Node + 186 + 130 + ? - ? - EndOfSwitch - 7 - Switch - -EndSwitch - + ? + EndOfSwitch + 7 + Switch + +EndOfSwitch + long - a - + a + long - a - - + a + + EndOfSwitch_1 - - 23/10/2003 - 17:46:26 - 23/10/2003 - 17:46:26 - 1.05 - ? - ? - ? - 587 - 126 - + + 8/7/2005 - 11:22:37 + 8/7/2005 - 11:22:37 + 1.05 + ? + ? + Compute Node + 587 + 126 + ? - ? - Switch_1 - 6 - EndOfSwitch_1 - + ? + Switch_1 + 6 + EndOfSwitch_1 + Switch_1 - + long - a - + a + long - Odd - + Odd + int - Even - + Even + int - a - - + a + + Switch - - - - - - 23/10/2003 - 17:46:27 - 23/10/2003 - 17:46:27 - 1.05 - ? - ? - ? - 185 - 368 - + + + + + + 8/7/2005 - 11:22:37 + 8/7/2005 - 11:22:37 + 1.05 + ? + ? + Compute Node + 185 + 368 + ? - ? - EndOfSwitch_1 - 7 - Switch_1 - -EndSwitch - + ? + EndOfSwitch_1 + 7 + Switch_1 + +EndOfSwitch_1 + long - a - + a + long - a - - + a + + EndOfSwitch_1 - - 23/10/2003 - 17:46:27 - 23/10/2003 - 17:46:27 - 1.05 - ? - ? - ? - 594 - 362 - + + 8/7/2005 - 11:22:37 + 8/7/2005 - 11:22:37 + 1.05 + ? + ? + Compute Node + 594 + 362 + IsOdd - a - EndOfSwitch - a - + a + EndOfSwitch + a + 571 - 160 - + 160 + 571 - 129 - + 129 + IsOdd_1 - a - EndOfSwitch_1 - a - + a + EndOfSwitch_1 + a + 580 - 396 - + 396 + 580 - 368 - + 368 + InitLoop - DoLoop - EndOfInitLoop - DoLoop - - + DoLoop + EndOfInitLoop + DoLoop + + InitLoop - Index - Switch - a - - + Index + Switch + a + + InitLoop - Min - EndOfInitLoop - Min - - + Min + EndOfInitLoop + Min + + InitLoop - Max - EndOfInitLoop - Max - - + Max + EndOfInitLoop + Max + + EndOfInitLoop - DoLoop - InitLoop - DoLoop - - + DoLoop + InitLoop + DoLoop + + InitLoop_1 - DoLoop - EndOfInitLoop_1 - DoLoop - - + DoLoop + EndOfInitLoop_1 + DoLoop + + InitLoop_1 - Index - Switch_1 - a - - + Index + Switch_1 + a + + InitLoop_1 - Min - EndOfInitLoop_1 - Min - - + Min + EndOfInitLoop_1 + Min + + InitLoop_1 - Max - EndOfInitLoop_1 - Max - - + Max + EndOfInitLoop_1 + Max + + EndOfInitLoop_1 - DoLoop - InitLoop_1 - DoLoop - - + DoLoop + InitLoop_1 + DoLoop + + Switch - Odd - IsOdd - InGate - - + Odd + IsOdd + Gate + + Switch - a - IsOdd - a - + a + IsOdd + a + 366 - 131 - + 131 + 365 - 223 - + 223 + Switch - Default - EndOfSwitch - Default - + Default + EndOfSwitch + Default + 572 - 194 - + 194 + 571 - 257 - + 257 + EndOfSwitch - a - EndOfInitLoop - Index - - -Switch_1 - Odd - IsOdd_1 - InGate - - + a + EndOfInitLoop + Index + + Switch_1 - Even - EndOfSwitch_1 - Default - - + Odd + IsOdd_1 + Gate + + Switch_1 - a - IsOdd_1 - a - + a + IsOdd_1 + a + 368 - 368 - + 368 + 367 - 460 - + 460 + +Switch_1 + Default + EndOfSwitch_1 + Default + + EndOfSwitch_1 - a - EndOfInitLoop_1 - Index - - + a + EndOfInitLoop_1 + Index + + -GraphPyFunctions - InitLoop\Index - InitLoop - Index - +GraphPyFunctions_1 + InitLoop__Index + InitLoop + Index + 3 - 0 - - -GraphPyFunctions - InitLoop\Min - InitLoop - Min - + 0 + + +GraphPyFunctions_1 + InitLoop__Min + InitLoop + Min + 3 - 0 - - -GraphPyFunctions - InitLoop\Max - InitLoop - Max - + 0 + + +GraphPyFunctions_1 + InitLoop__Max + InitLoop + Max + 3 - 100 - - -GraphPyFunctions - InitLoop_1\Index - InitLoop_1 - Index - + 25 + + +GraphPyFunctions_1 + InitLoop_1__Index + InitLoop_1 + Index + 3 - 0 - - -GraphPyFunctions - InitLoop_1\Min - InitLoop_1 - Min - + 0 + + +GraphPyFunctions_1 + InitLoop_1__Min + InitLoop_1 + Min + 3 - 0 - - -GraphPyFunctions - InitLoop_1\Max - InitLoop_1 - Max - + 0 + + +GraphPyFunctions_1 + InitLoop_1__Max + InitLoop_1 + Max + 3 - 100 - + 35 + diff --git a/examples/GraphStreamInLines.py b/examples/GraphStreamInLines.py index 0f88773..4fe93a6 100644 --- a/examples/GraphStreamInLines.py +++ b/examples/GraphStreamInLines.py @@ -2,255 +2,200 @@ # Generated python file of Graph GraphStreamInLines from SuperV import * -# Graph creation -GraphStreamInLines = StreamGraph( 'GraphStreamInLines' ) -GraphStreamInLines.SetStreamParams( 300 , SUPERV.WithoutTrace , 0 ) -GraphStreamInLines.SetName( 'GraphStreamInLines' ) -GraphStreamInLines.SetAuthor( '' ) -GraphStreamInLines.SetComment( '' ) -GraphStreamInLines.Coords( 0 , 0 ) - -# Creation of Factory Nodes - -# Creation of InLine Nodes -PyIsOdd = [] -PyIsOdd.append( 'from time import * ' ) -PyIsOdd.append( 'def IsOdd(a,Even) : ' ) -PyIsOdd.append( ' print a,"IsOdd (GraphStreamInLines1)" ' ) -PyIsOdd.append( ' sleep( 1 ) ' ) -PyIsOdd.append( ' return a ' ) -IsOdd = GraphStreamInLines.INode( 'IsOdd' , PyIsOdd ) -IsOdd.SetName( 'IsOdd' ) -IsOdd.SetAuthor( '' ) -IsOdd.SetComment( 'Python function' ) -IsOdd.Coords( 394 , 59 ) -IIsOdda = IsOdd.InPort( 'a' , 'long' ) -IIsOddEven = IsOdd.InPort( 'Even' , 'boolean' ) -IIsOddGate = IsOdd.GetInPort( 'Gate' ) -OIsOdda = IsOdd.OutPort( 'a' , 'long' ) -OIsOddGate = IsOdd.GetOutPort( 'Gate' ) -IIsOddistream = IsOdd.InStreamPort( 'istream' , SALOME_ModuleCatalog.DATASTREAM_INTEGER , SALOME_ModuleCatalog.DATASTREAM_TEMPORAL ) -IIsOddistream.SetParams( SUPERV.TI , SUPERV.L1 , SUPERV.EXTRANULL ) -OIsOddostream = IsOdd.OutStreamPort( 'ostream' , SALOME_ModuleCatalog.DATASTREAM_INTEGER , SALOME_ModuleCatalog.DATASTREAM_ITERATIVE ) -OIsOddostream.SetNumberOfValues( 0 ) - -# Creation of Loop Nodes -PyInitLoop = [] -PyMoreInitLoop = [] -PyMoreInitLoop.append( '' ) -PyNextInitLoop = [] -PyNextInitLoop.append( '' ) -InitLoop,EndOfInitLoop = GraphStreamInLines.LNode( '' , PyInitLoop , '' , PyMoreInitLoop , '' , PyNextInitLoop ) -EndOfInitLoop.SetName( 'EndOfInitLoop' ) -EndOfInitLoop.SetAuthor( '' ) -EndOfInitLoop.SetComment( '' ) -EndOfInitLoop.Coords( 776 , 105 ) -PyEndOfInitLoop = [] -PyEndOfInitLoop.append( 'def EndOfInitLoop( DoLoop , Index , Min , Max ) :' ) -PyEndOfInitLoop.append( ' Index = Index + 1 ' ) -PyEndOfInitLoop.append( ' if Index <= Max : ' ) -PyEndOfInitLoop.append( ' DoLoop = 1 ' ) -PyEndOfInitLoop.append( ' else : ' ) -PyEndOfInitLoop.append( ' DoLoop = 0 ' ) -PyEndOfInitLoop.append( ' return DoLoop,Index,Min,Max ' ) -EndOfInitLoop.SetPyFunction( 'EndOfInitLoop' , PyEndOfInitLoop ) -IInitLoopInitLoop = InitLoop.GetInPort( 'DoLoop' ) -IInitLoopIndex = InitLoop.InPort( 'Index' , 'long' ) -IInitLoopMin = InitLoop.InPort( 'Min' , 'long' ) -IInitLoopMax = InitLoop.InPort( 'Max' , 'long' ) -IInitLoopistream = InitLoop.InStreamPort( 'istream' , SALOME_ModuleCatalog.DATASTREAM_INTEGER , SALOME_ModuleCatalog.DATASTREAM_TEMPORAL ) -IInitLoopistream.SetParams( SUPERV.TI , SUPERV.L1 , SUPERV.EXTRANULL ) -IInitLoopGate = InitLoop.GetInPort( 'Gate' ) -OInitLoopDoLoop = InitLoop.GetOutPort( 'DoLoop' ) -OInitLoopIndex = InitLoop.GetOutPort( 'Index' ) -OInitLoopMin = InitLoop.GetOutPort( 'Min' ) -OInitLoopMax = InitLoop.GetOutPort( 'Max' ) -OInitLoopostream = InitLoop.OutStreamPort( 'ostream' , SALOME_ModuleCatalog.DATASTREAM_INTEGER , SALOME_ModuleCatalog.DATASTREAM_ITERATIVE ) -OInitLoopostream.SetNumberOfValues( 0 ) -IEndOfInitLoopDoLoop = EndOfInitLoop.GetInPort( 'DoLoop' ) -IEndOfInitLoopIndex = EndOfInitLoop.GetInPort( 'Index' ) -IEndOfInitLoopMin = EndOfInitLoop.GetInPort( 'Min' ) -IEndOfInitLoopMax = EndOfInitLoop.GetInPort( 'Max' ) -IEndOfInitLoopistream = EndOfInitLoop.InStreamPort( 'istream' , SALOME_ModuleCatalog.DATASTREAM_INTEGER , SALOME_ModuleCatalog.DATASTREAM_ITERATIVE ) -IEndOfInitLoopistream.SetParams( SUPERV.SCHENULL , SUPERV.INTERNULL , SUPERV.EXTRANULL ) -IEndOfInitLoopGate = EndOfInitLoop.GetInPort( 'Gate' ) -OEndOfInitLoopDoLoop = EndOfInitLoop.GetOutPort( 'DoLoop' ) -OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) -OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) -OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) -OEndOfInitLoopostream = EndOfInitLoop.OutStreamPort( 'ostream' , SALOME_ModuleCatalog.DATASTREAM_INTEGER , SALOME_ModuleCatalog.DATASTREAM_TEMPORAL ) -OEndOfInitLoopostream.SetNumberOfValues( 0 ) -InitLoop.SetName( 'InitLoop' ) -InitLoop.SetAuthor( '' ) -InitLoop.SetComment( '' ) -InitLoop.Coords( 11 , 119 ) -IInitLoopistream = InitLoop.InStreamPort( 'istream' , SALOME_ModuleCatalog.DATASTREAM_INTEGER , SALOME_ModuleCatalog.DATASTREAM_TEMPORAL ) -IInitLoopistream.SetParams( SUPERV.TI , SUPERV.L1 , SUPERV.EXTRANULL ) -OInitLoopostream = InitLoop.OutStreamPort( 'ostream' , SALOME_ModuleCatalog.DATASTREAM_INTEGER , SALOME_ModuleCatalog.DATASTREAM_ITERATIVE ) -OInitLoopostream.SetNumberOfValues( 0 ) - -# Creation of Switch Nodes -PySwitch = [] -PySwitch.append( 'from time import * ' ) -PySwitch.append( 'def Switch(a) : ' ) -PySwitch.append( ' if ( a & 1 ) == 0 : ' ) -PySwitch.append( ' sleep(1) ' ) -PySwitch.append( ' return a & 1,1-(a&1),a ' ) -Switch,EndSwitch = GraphStreamInLines.SNode( 'Switch' , PySwitch ) -EndSwitch.SetName( 'EndSwitch' ) -EndSwitch.SetAuthor( '' ) -EndSwitch.SetComment( '' ) -EndSwitch.Coords( 587 , 104 ) -PyEndSwitch = [] -PyEndSwitch.append( 'def EndOfSwitch(a) : ' ) -PyEndSwitch.append( ' if ( a & 1 ) == 0 : ' ) -PyEndSwitch.append( ' sleep(1) ' ) -PyEndSwitch.append( ' return a ' ) -EndSwitch.SetPyFunction( 'EndOfSwitch' , PyEndSwitch ) -IEndSwitcha = EndSwitch.InPort( 'a' , 'long' ) -IEndSwitchistream = EndSwitch.InStreamPort( 'istream' , SALOME_ModuleCatalog.DATASTREAM_INTEGER , SALOME_ModuleCatalog.DATASTREAM_TEMPORAL ) -IEndSwitchistream.SetParams( SUPERV.TI , SUPERV.L1 , SUPERV.EXTRANULL ) -IEndSwitchDefault = EndSwitch.GetInPort( 'Default' ) -OEndSwitcha = EndSwitch.OutPort( 'a' , 'long' ) -OEndSwitchostream = EndSwitch.OutStreamPort( 'ostream' , SALOME_ModuleCatalog.DATASTREAM_INTEGER , SALOME_ModuleCatalog.DATASTREAM_TEMPORAL ) -OEndSwitchostream.SetNumberOfValues( 0 ) -OEndSwitchGate = EndSwitch.GetOutPort( 'Gate' ) -Switch.SetName( 'Switch' ) -Switch.SetAuthor( '' ) -Switch.SetComment( '' ) -Switch.Coords( 197 , 119 ) -ISwitcha = Switch.InPort( 'a' , 'long' ) -ISwitchGate = Switch.GetInPort( 'Gate' ) -OSwitchOdd = Switch.OutPort( 'Odd' , 'long' ) -OSwitchEven = Switch.OutPort( 'Even' , 'int' ) -OSwitcha = Switch.OutPort( 'a' , 'int' ) -OSwitchDefault = Switch.GetOutPort( 'Default' ) -ISwitchistream = Switch.InStreamPort( 'istream' , SALOME_ModuleCatalog.DATASTREAM_INTEGER , SALOME_ModuleCatalog.DATASTREAM_TEMPORAL ) -ISwitchistream.SetParams( SUPERV.TI , SUPERV.L1 , SUPERV.EXTRANULL ) -OSwitchostream = Switch.OutStreamPort( 'ostream' , SALOME_ModuleCatalog.DATASTREAM_INTEGER , SALOME_ModuleCatalog.DATASTREAM_ITERATIVE ) -OSwitchostream.SetNumberOfValues( 0 ) - -# Creation of Links -LIsOddaEndSwitcha = GraphStreamInLines.Link( OIsOdda , IEndSwitcha ) - -LIsOddostreamInitLoopistream = GraphStreamInLines.StreamLink( OIsOddostream , IInitLoopistream ) -LIsOddostreamInitLoopistream.AddCoord( 1 , 3 , 240 ) -LIsOddostreamInitLoopistream.AddCoord( 2 , 3 , 395 ) -LIsOddostreamInitLoopistream.AddCoord( 3 , 571 , 394 ) -LIsOddostreamInitLoopistream.AddCoord( 4 , 571 , 187 ) - -LInitLoopIndexSwitcha = GraphStreamInLines.Link( OInitLoopIndex , ISwitcha ) - -LInitLoopMinEndOfInitLoopMin = GraphStreamInLines.Link( OInitLoopMin , IEndOfInitLoopMin ) - -LInitLoopMaxEndOfInitLoopMax = GraphStreamInLines.Link( OInitLoopMax , IEndOfInitLoopMax ) - -LInitLoopostreamEndSwitchistream = GraphStreamInLines.StreamLink( OInitLoopostream , IEndSwitchistream ) -LInitLoopostreamEndSwitchistream.AddCoord( 1 , 584 , 167 ) -LInitLoopostreamEndSwitchistream.AddCoord( 2 , 584 , 369 ) -LInitLoopostreamEndSwitchistream.AddCoord( 3 , 184 , 368 ) -LInitLoopostreamEndSwitchistream.AddCoord( 4 , 185 , 240 ) - -LSwitchOddIsOddGate = GraphStreamInLines.Link( OSwitchOdd , IIsOddGate ) -LSwitchOddIsOddGate.AddCoord( 1 , 373 , 222 ) -LSwitchOddIsOddGate.AddCoord( 2 , 373 , 147 ) - -LSwitchEvenEndSwitchDefault = GraphStreamInLines.Link( OSwitchEven , IEndSwitchDefault ) - -LSwitchEvenIsOddEven = GraphStreamInLines.Link( OSwitchEven , IIsOddEven ) -LSwitchEvenIsOddEven.AddCoord( 1 , 363 , 154 ) -LSwitchEvenIsOddEven.AddCoord( 2 , 362 , 177 ) - -LSwitchaIsOdda = GraphStreamInLines.Link( OSwitcha , IIsOdda ) -LSwitchaIsOdda.AddCoord( 1 , 385 , 123 ) -LSwitchaIsOdda.AddCoord( 2 , 386 , 206 ) - -LSwitchostreamIsOddistream = GraphStreamInLines.StreamLink( OSwitchostream , IIsOddistream ) -LSwitchostreamIsOddistream.AddCoord( 1 , 360 , 185 ) -LSwitchostreamIsOddistream.AddCoord( 2 , 361 , 240 ) - -LSwitchostreamEndOfInitLoopistream = GraphStreamInLines.StreamLink( OSwitchostream , IEndOfInitLoopistream ) -LSwitchostreamEndOfInitLoopistream.AddCoord( 1 , 775 , 226 ) -LSwitchostreamEndOfInitLoopistream.AddCoord( 2 , 775 , 261 ) -LSwitchostreamEndOfInitLoopistream.AddCoord( 3 , 361 , 261 ) -LSwitchostreamEndOfInitLoopistream.AddCoord( 4 , 361 , 240 ) - -LEndSwitchaEndOfInitLoopIndex = GraphStreamInLines.Link( OEndSwitcha , IEndOfInitLoopIndex ) - -LEndSwitchostreamSwitchistream = GraphStreamInLines.StreamLink( OEndSwitchostream , ISwitchistream ) -LEndSwitchostreamSwitchistream.AddCoord( 1 , 186 , 240 ) -LEndSwitchostreamSwitchistream.AddCoord( 2 , 186 , 331 ) -LEndSwitchostreamSwitchistream.AddCoord( 3 , 766 , 330 ) -LEndSwitchostreamSwitchistream.AddCoord( 4 , 766 , 167 ) - -# Input datas -IInitLoopIndex.Input( 0 ) -IInitLoopMin.Input( 0 ) -IInitLoopMax.Input( 100 ) - -# Output Ports of the graph -#OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) -#OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) -#OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) - - - -GraphStreamInLines.Run() -GraphStreamInLines.DoneW() -print GraphStreamInLines.State() - -GraphStreamInLines.PrintPorts() - - -subgraphs = GraphStreamInLines.SubGraphsNumber() -i = 1 -while i <= subgraphs : - nodes = GraphStreamInLines.SubGraphsNodes( i ) - j = 0 - while j < len(nodes) : - print 'SubGraph',i,nodes[j].Name() - j = j + 1 - i = i + 1 - - -substreamgraphs = GraphStreamInLines.SubStreamGraphsNumber() -i = 1 -while i <= substreamgraphs : - nodes = GraphStreamInLines.SubStreamGraphsNodes( i ) - j = 0 - while j < len(nodes) : - print 'SubStreamGraph',i,nodes[j].Name() - j = j + 1 - i = i + 1 - -GraphStreamInLines.Export('/tmp/GraphStreamInLines.xml') - -from SuperV import * -GraphStreamInLines = StreamGraph('/tmp/GraphStreamInLines.xml') - - -GraphStreamInLines.Run() -GraphStreamInLines.DoneW() -print GraphStreamInLines.State() - -subgraphs = GraphStreamInLines.SubGraphsNumber() -i = 1 -while i <= subgraphs : - nodes = GraphStreamInLines.SubGraphsNodes( i ) - j = 0 - while j < len(nodes) : - print 'SubGraph',i,nodes[j].Name() - j = j + 1 - i = i + 1 - - -substreamgraphs = GraphStreamInLines.SubStreamGraphsNumber() -i = 1 -while i <= substreamgraphs : - nodes = GraphStreamInLines.SubStreamGraphsNodes( i ) - j = 0 - while j < len(nodes) : - print 'SubStreamGraph',i,nodes[j].Name() - j = j + 1 - i = i + 1 +# Graph creation of GraphStreamInLines +def DefGraphStreamInLines() : + GraphStreamInLines = StreamGraph( 'GraphStreamInLines' ) + GraphStreamInLines.SetStreamParams( 300 , SUPERV.WithoutTrace , 0 ) + GraphStreamInLines.SetName( 'GraphStreamInLines' ) + GraphStreamInLines.SetAuthor( '' ) + GraphStreamInLines.SetComment( '' ) + GraphStreamInLines.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsOdd = [] + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd(a,Even) : ' ) + PyIsOdd.append( ' print a,"IsOdd (GraphStreamInLines1)" ' ) + PyIsOdd.append( ' sleep( 1 ) ' ) + PyIsOdd.append( ' return a ' ) + IsOdd = GraphStreamInLines.INode( 'IsOdd' , PyIsOdd ) + IsOdd.SetName( 'IsOdd' ) + IsOdd.SetAuthor( '' ) + IsOdd.SetComment( 'Python function' ) + IsOdd.Coords( 404 , 7 ) + IIsOdda = IsOdd.InPort( 'a' , 'long' ) + IIsOddEven = IsOdd.InPort( 'Even' , 'boolean' ) + IIsOddGate = IsOdd.GetInPort( 'Gate' ) + OIsOdda = IsOdd.OutPort( 'a' , 'long' ) + OIsOddGate = IsOdd.GetOutPort( 'Gate' ) + IIsOddistream = IsOdd.InStreamPort( 'istream' , SALOME_ModuleCatalog.DATASTREAM_INTEGER , SALOME_ModuleCatalog.DATASTREAM_TEMPORAL ) + IIsOddistream.SetParams( SUPERV.TI , SUPERV.L1 , SUPERV.EXTRANULL ) + OIsOddostream = IsOdd.OutStreamPort( 'ostream' , SALOME_ModuleCatalog.DATASTREAM_INTEGER , SALOME_ModuleCatalog.DATASTREAM_ITERATIVE ) + OIsOddostream.SetNumberOfValues( 0 ) + + # Creation of Loop Nodes + PyInitLoop = [] + PyMoreInitLoop = [] + PyMoreInitLoop.append( '' ) + PyNextInitLoop = [] + PyNextInitLoop.append( '' ) + InitLoop,EndOfInitLoop = GraphStreamInLines.LNode( '' , PyInitLoop , '' , PyMoreInitLoop , '' , PyNextInitLoop ) + EndOfInitLoop.SetName( 'EndOfInitLoop' ) + EndOfInitLoop.SetAuthor( '' ) + EndOfInitLoop.SetComment( 'Compute Node' ) + EndOfInitLoop.Coords( 807 , 104 ) + PyEndOfInitLoop = [] + PyEndOfInitLoop.append( 'def EndOfInitLoop( DoLoop , Index , Min , Max ) :' ) + PyEndOfInitLoop.append( ' Index = Index + 1 ' ) + PyEndOfInitLoop.append( ' if Index <= Max : ' ) + PyEndOfInitLoop.append( ' DoLoop = 1 ' ) + PyEndOfInitLoop.append( ' else : ' ) + PyEndOfInitLoop.append( ' DoLoop = 0 ' ) + PyEndOfInitLoop.append( ' return DoLoop,Index,Min,Max ' ) + EndOfInitLoop.SetPyFunction( 'EndOfInitLoop' , PyEndOfInitLoop ) + IInitLoopDoLoop = InitLoop.GetInPort( 'DoLoop' ) + IInitLoopIndex = InitLoop.InPort( 'Index' , 'long' ) + IInitLoopMin = InitLoop.InPort( 'Min' , 'long' ) + IInitLoopMax = InitLoop.InPort( 'Max' , 'long' ) + IInitLoopistream = InitLoop.InStreamPort( 'istream' , SALOME_ModuleCatalog.DATASTREAM_INTEGER , SALOME_ModuleCatalog.DATASTREAM_TEMPORAL ) + IInitLoopistream.SetParams( SUPERV.TI , SUPERV.L1 , SUPERV.EXTRANULL ) + IInitLoopGate = InitLoop.GetInPort( 'Gate' ) + OInitLoopDoLoop = InitLoop.GetOutPort( 'DoLoop' ) + OInitLoopIndex = InitLoop.GetOutPort( 'Index' ) + OInitLoopMin = InitLoop.GetOutPort( 'Min' ) + OInitLoopMax = InitLoop.GetOutPort( 'Max' ) + OInitLoopostream = InitLoop.OutStreamPort( 'ostream' , SALOME_ModuleCatalog.DATASTREAM_INTEGER , SALOME_ModuleCatalog.DATASTREAM_ITERATIVE ) + OInitLoopostream.SetNumberOfValues( 0 ) + IEndOfInitLoopDoLoop = EndOfInitLoop.GetInPort( 'DoLoop' ) + IEndOfInitLoopIndex = EndOfInitLoop.GetInPort( 'Index' ) + IEndOfInitLoopMin = EndOfInitLoop.GetInPort( 'Min' ) + IEndOfInitLoopMax = EndOfInitLoop.GetInPort( 'Max' ) + IEndOfInitLoopistream = EndOfInitLoop.InStreamPort( 'istream' , SALOME_ModuleCatalog.DATASTREAM_INTEGER , SALOME_ModuleCatalog.DATASTREAM_ITERATIVE ) + IEndOfInitLoopistream.SetParams( SUPERV.SCHENULL , SUPERV.INTERNULL , SUPERV.EXTRANULL ) + IEndOfInitLoopGate = EndOfInitLoop.GetInPort( 'Gate' ) + OEndOfInitLoopDoLoop = EndOfInitLoop.GetOutPort( 'DoLoop' ) + OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) + OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) + OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) + OEndOfInitLoopGate = EndOfInitLoop.GetOutPort( 'Gate' ) + OEndOfInitLoopostream = EndOfInitLoop.OutStreamPort( 'ostream' , SALOME_ModuleCatalog.DATASTREAM_INTEGER , SALOME_ModuleCatalog.DATASTREAM_TEMPORAL ) + OEndOfInitLoopostream.SetNumberOfValues( 0 ) + InitLoop.SetName( 'InitLoop' ) + InitLoop.SetAuthor( '' ) + InitLoop.SetComment( 'Compute Node' ) + InitLoop.Coords( 11 , 119 ) + IInitLoopistream = InitLoop.InStreamPort( 'istream' , SALOME_ModuleCatalog.DATASTREAM_INTEGER , SALOME_ModuleCatalog.DATASTREAM_TEMPORAL ) + IInitLoopistream.SetParams( SUPERV.TI , SUPERV.L1 , SUPERV.EXTRANULL ) + OInitLoopostream = InitLoop.OutStreamPort( 'ostream' , SALOME_ModuleCatalog.DATASTREAM_INTEGER , SALOME_ModuleCatalog.DATASTREAM_ITERATIVE ) + OInitLoopostream.SetNumberOfValues( 0 ) + + # Creation of Switch Nodes + PySwitch = [] + PySwitch.append( 'from time import * ' ) + PySwitch.append( 'def Switch(a) : ' ) + PySwitch.append( ' if ( a & 1 ) == 0 : ' ) + PySwitch.append( ' sleep(1) ' ) + PySwitch.append( ' return a & 1,1-(a&1),a ' ) + Switch,EndSwitch = GraphStreamInLines.SNode( 'Switch' , PySwitch ) + EndSwitch.SetName( 'EndSwitch' ) + EndSwitch.SetAuthor( '' ) + EndSwitch.SetComment( 'Compute Node' ) + EndSwitch.Coords( 604 , 105 ) + PyEndSwitch = [] + PyEndSwitch.append( 'def EndOfSwitch(a) : ' ) + PyEndSwitch.append( ' if ( a & 1 ) == 0 : ' ) + PyEndSwitch.append( ' sleep(1) ' ) + PyEndSwitch.append( ' return a ' ) + EndSwitch.SetPyFunction( 'EndOfSwitch' , PyEndSwitch ) + IEndSwitcha = EndSwitch.InPort( 'a' , 'long' ) + IEndSwitchistream = EndSwitch.InStreamPort( 'istream' , SALOME_ModuleCatalog.DATASTREAM_INTEGER , SALOME_ModuleCatalog.DATASTREAM_TEMPORAL ) + IEndSwitchistream.SetParams( SUPERV.TI , SUPERV.L1 , SUPERV.EXTRANULL ) + IEndSwitchDefault = EndSwitch.GetInPort( 'Default' ) + OEndSwitcha = EndSwitch.OutPort( 'a' , 'long' ) + OEndSwitchostream = EndSwitch.OutStreamPort( 'ostream' , SALOME_ModuleCatalog.DATASTREAM_INTEGER , SALOME_ModuleCatalog.DATASTREAM_TEMPORAL ) + OEndSwitchostream.SetNumberOfValues( 0 ) + OEndSwitchGate = EndSwitch.GetOutPort( 'Gate' ) + Switch.SetName( 'Switch' ) + Switch.SetAuthor( '' ) + Switch.SetComment( 'Compute Node' ) + Switch.Coords( 198 , 115 ) + ISwitcha = Switch.InPort( 'a' , 'long' ) + ISwitchGate = Switch.GetInPort( 'Gate' ) + OSwitchOdd = Switch.OutPort( 'Odd' , 'long' ) + OSwitchEven = Switch.OutPort( 'Even' , 'int' ) + OSwitcha = Switch.OutPort( 'a' , 'int' ) + OSwitchDefault = Switch.GetOutPort( 'Default' ) + ISwitchistream = Switch.InStreamPort( 'istream' , SALOME_ModuleCatalog.DATASTREAM_INTEGER , SALOME_ModuleCatalog.DATASTREAM_TEMPORAL ) + ISwitchistream.SetParams( SUPERV.TI , SUPERV.L1 , SUPERV.EXTRANULL ) + OSwitchostream = Switch.OutStreamPort( 'ostream' , SALOME_ModuleCatalog.DATASTREAM_INTEGER , SALOME_ModuleCatalog.DATASTREAM_ITERATIVE ) + OSwitchostream.SetNumberOfValues( 0 ) + + # Creation of Links + LIsOddaEndSwitcha = GraphStreamInLines.Link( OIsOdda , IEndSwitcha ) + + LIsOddostreamInitLoopistream = GraphStreamInLines.StreamLink( OIsOddostream , IInitLoopistream ) + LIsOddostreamInitLoopistream.AddCoord( 1 , 3 , 240 ) + LIsOddostreamInitLoopistream.AddCoord( 2 , 3 , 395 ) + LIsOddostreamInitLoopistream.AddCoord( 3 , 571 , 394 ) + LIsOddostreamInitLoopistream.AddCoord( 4 , 577 , 122 ) + + LInitLoopIndexSwitcha = GraphStreamInLines.Link( OInitLoopIndex , ISwitcha ) + + LInitLoopMinEndOfInitLoopMin = GraphStreamInLines.Link( OInitLoopMin , IEndOfInitLoopMin ) + + LInitLoopMaxEndOfInitLoopMax = GraphStreamInLines.Link( OInitLoopMax , IEndOfInitLoopMax ) + + LInitLoopostreamEndSwitchistream = GraphStreamInLines.StreamLink( OInitLoopostream , IEndSwitchistream ) + LInitLoopostreamEndSwitchistream.AddCoord( 1 , 586 , 158 ) + LInitLoopostreamEndSwitchistream.AddCoord( 2 , 586 , 362 ) + LInitLoopostreamEndSwitchistream.AddCoord( 3 , 591 , 362 ) + LInitLoopostreamEndSwitchistream.AddCoord( 4 , 591 , 359 ) + LInitLoopostreamEndSwitchistream.AddCoord( 5 , 180 , 359 ) + LInitLoopostreamEndSwitchistream.AddCoord( 6 , 180 , 212 ) + LInitLoopostreamEndSwitchistream.AddCoord( 7 , 181 , 212 ) + LInitLoopostreamEndSwitchistream.AddCoord( 8 , 181 , 214 ) + LInitLoopostreamEndSwitchistream.AddCoord( 9 , 584 , 167 ) + LInitLoopostreamEndSwitchistream.AddCoord( 10 , 584 , 369 ) + LInitLoopostreamEndSwitchistream.AddCoord( 11 , 184 , 368 ) + LInitLoopostreamEndSwitchistream.AddCoord( 12 , 185 , 240 ) + + LSwitchOddIsOddGate = GraphStreamInLines.Link( OSwitchOdd , IIsOddGate ) + + LSwitchEvenIsOddEven = GraphStreamInLines.Link( OSwitchEven , IIsOddEven ) + + LSwitchaIsOdda = GraphStreamInLines.Link( OSwitcha , IIsOdda ) + + LSwitchostreamIsOddistream = GraphStreamInLines.StreamLink( OSwitchostream , IIsOddistream ) + + LSwitchostreamEndOfInitLoopistream = GraphStreamInLines.StreamLink( OSwitchostream , IEndOfInitLoopistream ) + LSwitchostreamEndOfInitLoopistream.AddCoord( 1 , 779 , 203 ) + LSwitchostreamEndOfInitLoopistream.AddCoord( 2 , 775 , 261 ) + LSwitchostreamEndOfInitLoopistream.AddCoord( 3 , 397 , 260 ) + LSwitchostreamEndOfInitLoopistream.AddCoord( 4 , 403 , 217 ) + + LSwitchDefaultEndSwitchDefault = GraphStreamInLines.Link( OSwitchDefault , IEndSwitchDefault ) + + LEndSwitchaEndOfInitLoopIndex = GraphStreamInLines.Link( OEndSwitcha , IEndOfInitLoopIndex ) + + LEndSwitchostreamSwitchistream = GraphStreamInLines.StreamLink( OEndSwitchostream , ISwitchistream ) + LEndSwitchostreamSwitchistream.AddCoord( 1 , 186 , 240 ) + LEndSwitchostreamSwitchistream.AddCoord( 2 , 186 , 331 ) + LEndSwitchostreamSwitchistream.AddCoord( 3 , 790 , 329 ) + LEndSwitchostreamSwitchistream.AddCoord( 4 , 786 , 161 ) + + # Input datas + IInitLoopIndex.Input( 0 ) + IInitLoopMin.Input( 0 ) + IInitLoopMax.Input( 35 ) + + # Output Ports of the graph + #OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) + #OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) + #OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) + return GraphStreamInLines + + +GraphStreamInLines = DefGraphStreamInLines() diff --git a/examples/GraphStreamInLines.xml b/examples/GraphStreamInLines.xml index 0af8182..b329a2e 100644 --- a/examples/GraphStreamInLines.xml +++ b/examples/GraphStreamInLines.xml @@ -1,508 +1,509 @@ - + + ? - ? - GraphStreamInLines - 9 - 300 - 0 - 0 - ? - + ? + GraphStreamInLines + 9 + 300 + 0 + 0 + ? + GraphStreamInLines - + long - InitLoop\Index - + InitLoop__Index + long - InitLoop\Min - + InitLoop__Min + long - InitLoop\Max - + InitLoop__Max + long - EndOfInitLoop\Index - + EndOfInitLoop__Index + long - EndOfInitLoop\Min - + EndOfInitLoop__Min + long - EndOfInitLoop\Max - + EndOfInitLoop__Max + 1 - EndOfInitLoop\ostream - 1 - 0 - - 27/4/2004 - 15:5:25 - 21/5/2004 - 10:45:38 - 2.0 - ? - ? - ? - 0 - 0 - + EndOfInitLoop__ostream + 1 + 0 + + 27/4/2004 - 15:5:25 + 8/7/2005 - 11:28:41 + 2.0 + ? + ? + ? + 0 + 0 + ? - ? - IsOdd - 3 - ? - + ? + IsOdd + 3 + ? + IsOdd - + long - a - + a + boolean - Even - + Even + long - a - + a + 1 - istream - 1 - 1 - 2 - 0 - + istream + 1 + 1 + 2 + 0 + 1 - ostream - 2 - 0 - + ostream + 2 + 0 + IsOdd - - - - - - 21/5/2004 - 10:45:38 - 21/5/2004 - 10:45:38 - 2.0 - ? - ? - Python function - 394 - 59 - + + + + + + 8/7/2005 - 11:28:41 + 8/7/2005 - 11:28:41 + 2.0 + ? + ? + Python function + 404 + 7 + ? - ? - InitLoop - 4 - EndOfInitLoop - + ? + InitLoop + 4 + EndOfInitLoop + InitLoop - + long - Index - + Index + long - Min - + Min + long - Max - + Max + long - Index - + Index + long - Min - + Min + long - Max - + Max + 1 - istream - 1 - 1 - 2 - 0 - + istream + 1 + 1 + 2 + 0 + 1 - ostream - 2 - 0 - + ostream + 2 + 0 + ? - - + + ? - - + + ? - - 21/5/2004 - 10:45:38 - 21/5/2004 - 10:45:38 - 2.0 - ? - ? - ? - 11 - 119 - + + 8/7/2005 - 11:28:41 + 8/7/2005 - 11:28:41 + 2.0 + ? + ? + Compute Node + 11 + 119 + ? - ? - EndOfInitLoop - 5 - InitLoop - + ? + EndOfInitLoop + 5 + InitLoop + EndOfInitLoop - + long - Index - + Index + long - Min - + Min + long - Max - + Max + long - Index - + Index + long - Min - + Min + long - Max - + Max + 1 - istream - 2 - 0 - 0 - 0 - + istream + 2 + 0 + 0 + 0 + 1 - ostream - 1 - 0 - + ostream + 1 + 0 + EndOfInitLoop - - - - - - - - 21/5/2004 - 10:45:38 - 21/5/2004 - 10:45:38 - 2.0 - ? - ? - ? - 776 - 105 - + + + + + + + + 8/7/2005 - 11:28:41 + 8/7/2005 - 11:28:41 + 2.0 + ? + ? + Compute Node + 807 + 104 + ? - ? - Switch - 6 - EndSwitch - + ? + Switch + 6 + EndSwitch + Switch - + long - a - + a + long - Odd - + Odd + int - Even - + Even + int - a - + a + 1 - istream - 1 - 1 - 2 - 0 - + istream + 1 + 1 + 2 + 0 + 1 - ostream - 2 - 0 - + ostream + 2 + 0 + Switch - - - - - - 21/5/2004 - 10:45:38 - 21/5/2004 - 10:45:38 - 2.0 - ? - ? - ? - 197 - 119 - + + + + + + 8/7/2005 - 11:28:41 + 8/7/2005 - 11:28:41 + 2.0 + ? + ? + Compute Node + 198 + 115 + ? - ? - EndSwitch - 7 - Switch - + ? + EndSwitch + 7 + Switch + EndSwitch - + long - a - + a + long - a - + a + 1 - istream - 1 - 1 - 2 - 0 - + istream + 1 + 1 + 2 + 0 + 1 - ostream - 1 - 0 - + ostream + 1 + 0 + EndOfSwitch - - - - - 21/5/2004 - 10:45:38 - 21/5/2004 - 10:45:38 - 2.0 - ? - ? - ? - 587 - 104 - + + + + + 8/7/2005 - 11:28:41 + 8/7/2005 - 11:28:41 + 2.0 + ? + ? + Compute Node + 604 + 105 + IsOdd - a - EndSwitch - a - - + a + EndSwitch + a + + IsOdd - ostream - InitLoop - istream - + ostream + InitLoop + istream + 3 - 240 - + 240 + 3 - 395 - -571 - 394 - + 395 + 571 - 187 - + 394 + +577 + 122 + InitLoop - DoLoop - EndOfInitLoop - DoLoop - - + DoLoop + EndOfInitLoop + DoLoop + + InitLoop - Index - Switch - a - - + Index + Switch + a + + InitLoop - Min - EndOfInitLoop - Min - - + Min + EndOfInitLoop + Min + + InitLoop - Max - EndOfInitLoop - Max - - + Max + EndOfInitLoop + Max + + InitLoop - ostream - EndSwitch - istream - + ostream + EndSwitch + istream + +586 + 158 + +586 + 362 + +591 + 362 + +591 + 359 + +180 + 359 + +180 + 212 + +181 + 212 + +181 + 214 + 584 - 167 - + 167 + 584 - 369 - + 369 + 184 - 368 - + 368 + 185 - 240 - + 240 + EndOfInitLoop - DoLoop - InitLoop - DoLoop - - -Switch - Odd - IsOdd - Gate - - -373 - 222 - -373 - 147 - + DoLoop + InitLoop + DoLoop + + Switch - Even - EndSwitch - Default - - + Odd + IsOdd + Gate + + Switch - Even - IsOdd - Even - - -363 - 154 - -362 - 177 - + Even + IsOdd + Even + + Switch - a - IsOdd - a - - -385 - 123 - -386 - 206 - + a + IsOdd + a + + Switch - ostream - IsOdd - istream - - -360 - 185 - -361 - 240 - + ostream + IsOdd + istream + + Switch - ostream - EndOfInitLoop - istream - + ostream + EndOfInitLoop + istream + +779 + 203 + 775 - 226 - -775 - 261 - -361 - 261 - -361 - 240 - + 261 + +397 + 260 + +403 + 217 + +Switch + Default + EndSwitch + Default + + EndSwitch - a - EndOfInitLoop - Index - - + a + EndOfInitLoop + Index + + EndSwitch - ostream - Switch - istream - + ostream + Switch + istream + 186 - 240 - + 240 + 186 - 331 - -766 - 330 - -766 - 167 - + 331 + +790 + 329 + +786 + 161 + GraphStreamInLines - InitLoop\Index - InitLoop - Index - + InitLoop__Index + InitLoop + Index + 3 - 0 - - + 0 + + GraphStreamInLines - InitLoop\Min - InitLoop - Min - + InitLoop__Min + InitLoop + Min + 3 - 0 - - + 0 + + GraphStreamInLines - InitLoop\Max - InitLoop - Max - + InitLoop__Max + InitLoop + Max + 3 - 100 - + 35 + diff --git a/examples/GraphSwitch.py b/examples/GraphSwitch.py index 04c5ee6..a773c88 100644 --- a/examples/GraphSwitch.py +++ b/examples/GraphSwitch.py @@ -129,7 +129,7 @@ def DefGraphSwitch() : # Input datas IInitLoopSwitchIndex.Input( 0 ) IInitLoopSwitchMin.Input( 0 ) - IInitLoopSwitchMax.Input( 100 ) + IInitLoopSwitchMax.Input( 35 ) # Output Ports of the graph #OEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetOutPort( 'Index' ) diff --git a/examples/GraphSwitch.xml b/examples/GraphSwitch.xml index 770cffa..92735d0 100644 --- a/examples/GraphSwitch.xml +++ b/examples/GraphSwitch.xml @@ -36,7 +36,7 @@ 1/10/2003 - 17:23:54 - 19/1/2005 - 15:34:39 + 8/7/2005 - 11:33:23 1.05 ? ? @@ -69,8 +69,8 @@ - 19/1/2005 - 15:34:39 - 19/1/2005 - 15:34:39 + 8/7/2005 - 11:33:23 + 8/7/2005 - 11:33:23 1.05 ? ? @@ -124,8 +124,8 @@ - 19/1/2005 - 15:34:39 - 19/1/2005 - 15:34:39 + 8/7/2005 - 11:33:23 + 8/7/2005 - 11:33:23 1.05 ? ? @@ -165,8 +165,8 @@ ? - 19/1/2005 - 15:34:39 - 19/1/2005 - 15:34:39 + 8/7/2005 - 11:33:23 + 8/7/2005 - 11:33:23 1.05 ? ? @@ -204,8 +204,8 @@ - 19/1/2005 - 15:34:39 - 19/1/2005 - 15:34:39 + 8/7/2005 - 11:33:23 + 8/7/2005 - 11:33:23 1.05 ? ? @@ -233,8 +233,8 @@ ? - 19/1/2005 - 15:34:39 - 19/1/2005 - 15:34:39 + 8/7/2005 - 11:33:23 + 8/7/2005 - 11:33:23 1.05 ? ? @@ -340,5 +340,5 @@ Max 3 - 100 + 35 diff --git a/examples/GraphSwitchBranchGates.py b/examples/GraphSwitchBranchGates.py new file mode 100644 index 0000000..ee38905 --- /dev/null +++ b/examples/GraphSwitchBranchGates.py @@ -0,0 +1,147 @@ + +# Generated python file of Graph GraphSwitchBranchGates + +from SuperV import * + +# Graph creation of GraphSwitchBranchGates +def DefGraphSwitchBranchGates() : + GraphSwitchBranchGates = Graph( 'GraphSwitchBranchGates' ) + GraphSwitchBranchGates.SetName( 'GraphSwitchBranchGates' ) + GraphSwitchBranchGates.SetAuthor( 'JR' ) + GraphSwitchBranchGates.SetComment( '' ) + GraphSwitchBranchGates.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsOdd = [] + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd(a) : ' ) + PyIsOdd.append( ' print a,"IsOdd (GraphSwitch1)" ' ) + PyIsOdd.append( ' sleep( 1 ) ' ) + PyIsOdd.append( ' return a ' ) + IsOdd = GraphSwitchBranchGates.INode( 'IsOdd' , PyIsOdd ) + IsOdd.SetName( 'IsOdd' ) + IsOdd.SetAuthor( '' ) + IsOdd.SetComment( 'Python function' ) + IsOdd.Coords( 389 , 65 ) + IIsOdda = IsOdd.InPort( 'a' , 'long' ) + IIsOddGate = IsOdd.GetInPort( 'Gate' ) + OIsOdda = IsOdd.OutPort( 'a' , 'long' ) + OIsOddGate = IsOdd.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyInitLoop = [] + PyInitLoop.append( 'def InitLoop(Index,Min,Max) : ' ) + PyInitLoop.append( ' Index = Max ' ) + PyInitLoop.append( ' return Index,Min,Max ' ) + PyMoreInitLoop = [] + PyMoreInitLoop.append( 'def MoreLoop(Index,Min,Max) : ' ) + PyMoreInitLoop.append( ' if Index >= Min : ' ) + PyMoreInitLoop.append( ' DoLoop = 1 ' ) + PyMoreInitLoop.append( ' else : ' ) + PyMoreInitLoop.append( ' DoLoop = 0 ' ) + PyMoreInitLoop.append( ' return DoLoop,Index,Min,Max ' ) + PyNextInitLoop = [] + PyNextInitLoop.append( 'def NextLoop(Index,Min,Max) : ' ) + PyNextInitLoop.append( ' Index = Index - 1 ' ) + PyNextInitLoop.append( ' return Index,Min,Max ' ) + InitLoop,EndOfInitLoop = GraphSwitchBranchGates.LNode( 'InitLoop' , PyInitLoop , 'MoreLoop' , PyMoreInitLoop , 'NextLoop' , PyNextInitLoop ) + EndOfInitLoop.SetName( 'EndOfInitLoop' ) + EndOfInitLoop.SetAuthor( '' ) + EndOfInitLoop.SetComment( 'Compute Node' ) + EndOfInitLoop.Coords( 777 , 170 ) + PyEndOfInitLoop = [] + EndOfInitLoop.SetPyFunction( '' , PyEndOfInitLoop ) + IInitLoopDoLoop = InitLoop.GetInPort( 'DoLoop' ) + IInitLoopIndex = InitLoop.InPort( 'Index' , 'long' ) + IInitLoopMin = InitLoop.InPort( 'Min' , 'long' ) + IInitLoopMax = InitLoop.InPort( 'Max' , 'long' ) + IInitLoopGate = InitLoop.GetInPort( 'Gate' ) + OInitLoopDoLoop = InitLoop.GetOutPort( 'DoLoop' ) + OInitLoopIndex = InitLoop.GetOutPort( 'Index' ) + OInitLoopMin = InitLoop.GetOutPort( 'Min' ) + OInitLoopMax = InitLoop.GetOutPort( 'Max' ) + IEndOfInitLoopDoLoop = EndOfInitLoop.GetInPort( 'DoLoop' ) + IEndOfInitLoopIndex = EndOfInitLoop.GetInPort( 'Index' ) + IEndOfInitLoopMin = EndOfInitLoop.GetInPort( 'Min' ) + IEndOfInitLoopMax = EndOfInitLoop.GetInPort( 'Max' ) + IEndOfInitLoopGate = EndOfInitLoop.GetInPort( 'Gate' ) + OEndOfInitLoopDoLoop = EndOfInitLoop.GetOutPort( 'DoLoop' ) + OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) + OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) + OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) + OEndOfInitLoopGate = EndOfInitLoop.GetOutPort( 'Gate' ) + InitLoop.SetName( 'InitLoop' ) + InitLoop.SetAuthor( '' ) + InitLoop.SetComment( 'Compute Node' ) + InitLoop.Coords( 10 , 129 ) + + # Creation of Switch Nodes + PySwitch = [] + PySwitch.append( 'from time import * ' ) + PySwitch.append( 'def Switch(a) : ' ) + PySwitch.append( ' if a <= 0 : ' ) + PySwitch.append( ' sleep(1) ' ) + PySwitch.append( ' return 0,0,a ' ) + PySwitch.append( ' if ( a & 1 ) == 0 : ' ) + PySwitch.append( ' sleep(1) ' ) + PySwitch.append( ' return a & 1,1-(a&1),a ' ) + Switch,EndOfSwitch = GraphSwitchBranchGates.SNode( 'Switch' , PySwitch ) + EndOfSwitch.SetName( 'EndOfSwitch' ) + EndOfSwitch.SetAuthor( '' ) + EndOfSwitch.SetComment( 'Compute Node' ) + EndOfSwitch.Coords( 589 , 170 ) + PyEndOfSwitch = [] + EndOfSwitch.SetPyFunction( '' , PyEndOfSwitch ) + IEndOfSwitcha = EndOfSwitch.InPort( 'a' , 'long' ) + IEndOfSwitchDefault = EndOfSwitch.GetInPort( 'Default' ) + OEndOfSwitcha = EndOfSwitch.OutPort( 'a' , 'long' ) + OEndOfSwitchGate = EndOfSwitch.GetOutPort( 'Gate' ) + Switch.SetName( 'Switch' ) + Switch.SetAuthor( '' ) + Switch.SetComment( 'Compute Node' ) + Switch.Coords( 195 , 130 ) + ISwitcha = Switch.InPort( 'a' , 'long' ) + ISwitchGate = Switch.GetInPort( 'Gate' ) + OSwitchOdd = Switch.OutPort( 'Odd' , 'long' ) + OSwitchEven = Switch.OutPort( 'Even' , 'int' ) + OSwitcha = Switch.OutPort( 'a' , 'int' ) + OSwitchDefault = Switch.GetOutPort( 'Default' ) + + # Creation of Links + LIsOddaEndOfSwitcha = GraphSwitchBranchGates.Link( OIsOdda , IEndOfSwitcha ) + LIsOddaEndOfSwitcha.AddCoord( 1 , 571 , 201 ) + LIsOddaEndOfSwitcha.AddCoord( 2 , 571 , 136 ) + + LInitLoopIndexSwitcha = GraphSwitchBranchGates.Link( OInitLoopIndex , ISwitcha ) + + LInitLoopMinEndOfInitLoopMin = GraphSwitchBranchGates.Link( OInitLoopMin , IEndOfInitLoopMin ) + + LInitLoopMaxEndOfInitLoopMax = GraphSwitchBranchGates.Link( OInitLoopMax , IEndOfInitLoopMax ) + + LSwitchOddIsOddGate = GraphSwitchBranchGates.Link( OSwitchOdd , IIsOddGate ) + + LSwitchEvenEndOfSwitchDefault = GraphSwitchBranchGates.Link( OSwitchEven , IEndOfSwitchDefault ) + + LSwitchaIsOdda = GraphSwitchBranchGates.Link( OSwitcha , IIsOdda ) + LSwitchaIsOdda.AddCoord( 1 , 375 , 136 ) + LSwitchaIsOdda.AddCoord( 2 , 375 , 201 ) + + LSwitchDefaultEndOfSwitchDefault = GraphSwitchBranchGates.Link( OSwitchDefault , IEndOfSwitchDefault ) + + LEndOfSwitchaEndOfInitLoopIndex = GraphSwitchBranchGates.Link( OEndOfSwitcha , IEndOfInitLoopIndex ) + + # Input datas + IInitLoopIndex.Input( 0 ) + IInitLoopMin.Input( -5 ) + IInitLoopMax.Input( 23 ) + + # Output Ports of the graph + #OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) + #OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) + #OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) + return GraphSwitchBranchGates + + +GraphSwitchBranchGates = DefGraphSwitchBranchGates() diff --git a/examples/GraphSwitchBranchGates.xml b/examples/GraphSwitchBranchGates.xml new file mode 100644 index 0000000..407dbd5 --- /dev/null +++ b/examples/GraphSwitchBranchGates.xml @@ -0,0 +1,351 @@ + + + + + +? + ? + GraphSwitchBranchGates + 1 + ? + +GraphSwitchNOTValid_1 + + +long + InitLoop__Index + +long + InitLoop__Min + +long + InitLoop__Max + + +long + EndOfInitLoop__Index + +long + EndOfInitLoop__Min + +long + EndOfInitLoop__Max + + + 1/10/2003 - 17:12:48 + 8/4/2005 - 10:0:0 + 1.05 + JR + ? + ? + 0 + 0 + + +? + ? + IsOdd + 3 + ? + +IsOdd + + +long + a + + +long + a + + + +IsOdd + + + + + + 8/4/2005 - 10:0:0 + 8/4/2005 - 10:0:0 + 1.05 + ? + ? + Python function + 389 + 65 + +? + ? + InitLoop + 4 + EndOfInitLoop + +InitLoop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +InitLoop + + + + +MoreLoop + + = Min : ]]> + + + + + +NextLoop + + + + 8/4/2005 - 10:0:0 + 8/4/2005 - 10:0:0 + 1.05 + ? + ? + Compute Node + 10 + 129 + +? + ? + EndOfInitLoop + 5 + InitLoop + +EndOfInitLoop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +? + + 8/4/2005 - 10:0:0 + 8/4/2005 - 10:0:0 + 1.05 + ? + ? + Compute Node + 777 + 170 + +? + ? + Switch + 6 + EndOfSwitch + +Switch + + +long + a + + +long + Odd + +int + Even + +int + a + + + +Switch + + + + + + + + + 8/4/2005 - 10:0:0 + 8/4/2005 - 10:0:0 + 1.05 + ? + ? + Compute Node + 195 + 130 + +? + ? + EndOfSwitch + 7 + Switch + +EndOfSwitch + + +long + a + + +long + a + + + +? + + 8/4/2005 - 10:0:0 + 8/4/2005 - 10:0:0 + 1.05 + ? + ? + Compute Node + 589 + 170 + + +IsOdd + a + EndOfSwitch + a + + +571 + 201 + +571 + 136 + +InitLoop + DoLoop + EndOfInitLoop + DoLoop + + +InitLoop + Index + Switch + a + + +InitLoop + Min + EndOfInitLoop + Min + + +InitLoop + Max + EndOfInitLoop + Max + + +EndOfInitLoop + DoLoop + InitLoop + DoLoop + + +Switch + Odd + IsOdd + Gate + + +Switch + Even + EndOfSwitch + Default + + +Switch + a + IsOdd + a + + +375 + 136 + +375 + 201 + +Switch + Default + EndOfSwitch + Default + + +EndOfSwitch + a + EndOfInitLoop + Index + + + +GraphSwitchBranchGates + InitLoop__Index + InitLoop + Index + +3 + 0 + + +GraphSwitchBranchGates + InitLoop__Min + InitLoop + Min + +3 + -5 + + +GraphSwitchBranchGates + InitLoop__Max + InitLoop + Max + +3 + 23 + diff --git a/examples/GraphSwitchBranchGates1.py b/examples/GraphSwitchBranchGates1.py new file mode 100644 index 0000000..e5d129e --- /dev/null +++ b/examples/GraphSwitchBranchGates1.py @@ -0,0 +1,149 @@ + +# Generated python file of Graph GraphSwitchBranchGates1 + +from SuperV import * + +# Graph creation of GraphSwitchBranchGates1 +def DefGraphSwitchBranchGates1() : + GraphSwitchBranchGates1 = Graph( 'GraphSwitchBranchGates1' ) + GraphSwitchBranchGates1.SetName( 'GraphSwitchBranchGates1' ) + GraphSwitchBranchGates1.SetAuthor( 'JR' ) + GraphSwitchBranchGates1.SetComment( '' ) + GraphSwitchBranchGates1.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsOdd = [] + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd(a) : ' ) + PyIsOdd.append( ' print a,"IsOdd (GraphSwitch1)" ' ) + PyIsOdd.append( ' sleep( 1 ) ' ) + PyIsOdd.append( ' return a ' ) + IsOdd = GraphSwitchBranchGates1.INode( 'IsOdd' , PyIsOdd ) + IsOdd.SetName( 'IsOdd' ) + IsOdd.SetAuthor( '' ) + IsOdd.SetComment( 'Python function' ) + IsOdd.Coords( 389 , 65 ) + IIsOdda = IsOdd.InPort( 'a' , 'long' ) + IIsOddGate = IsOdd.GetInPort( 'Gate' ) + OIsOdda = IsOdd.OutPort( 'a' , 'long' ) + OIsOddGate = IsOdd.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyInitLoop = [] + PyInitLoop.append( 'def InitLoop(Index,Min,Max) : ' ) + PyInitLoop.append( ' Index = Max ' ) + PyInitLoop.append( ' return Index,Min,Max ' ) + PyMoreInitLoop = [] + PyMoreInitLoop.append( 'def MoreLoop(Index,Min,Max) : ' ) + PyMoreInitLoop.append( ' if Index >= Min : ' ) + PyMoreInitLoop.append( ' DoLoop = 1 ' ) + PyMoreInitLoop.append( ' else : ' ) + PyMoreInitLoop.append( ' DoLoop = 0 ' ) + PyMoreInitLoop.append( ' return DoLoop,Index,Min,Max ' ) + PyNextInitLoop = [] + PyNextInitLoop.append( 'def NextLoop(Index,Min,Max) : ' ) + PyNextInitLoop.append( ' Index = Index - 1 ' ) + PyNextInitLoop.append( ' return Index,Min,Max ' ) + InitLoop,EndOfInitLoop = GraphSwitchBranchGates1.LNode( 'InitLoop' , PyInitLoop , 'MoreLoop' , PyMoreInitLoop , 'NextLoop' , PyNextInitLoop ) + EndOfInitLoop.SetName( 'EndOfInitLoop' ) + EndOfInitLoop.SetAuthor( '' ) + EndOfInitLoop.SetComment( 'Compute Node' ) + EndOfInitLoop.Coords( 777 , 170 ) + PyEndOfInitLoop = [] + EndOfInitLoop.SetPyFunction( '' , PyEndOfInitLoop ) + IInitLoopDoLoop = InitLoop.GetInPort( 'DoLoop' ) + IInitLoopIndex = InitLoop.InPort( 'Index' , 'long' ) + IInitLoopMin = InitLoop.InPort( 'Min' , 'long' ) + IInitLoopMax = InitLoop.InPort( 'Max' , 'long' ) + IInitLoopGate = InitLoop.GetInPort( 'Gate' ) + OInitLoopDoLoop = InitLoop.GetOutPort( 'DoLoop' ) + OInitLoopIndex = InitLoop.GetOutPort( 'Index' ) + OInitLoopMin = InitLoop.GetOutPort( 'Min' ) + OInitLoopMax = InitLoop.GetOutPort( 'Max' ) + IEndOfInitLoopDoLoop = EndOfInitLoop.GetInPort( 'DoLoop' ) + IEndOfInitLoopIndex = EndOfInitLoop.GetInPort( 'Index' ) + IEndOfInitLoopMin = EndOfInitLoop.GetInPort( 'Min' ) + IEndOfInitLoopMax = EndOfInitLoop.GetInPort( 'Max' ) + IEndOfInitLoopGate = EndOfInitLoop.GetInPort( 'Gate' ) + OEndOfInitLoopDoLoop = EndOfInitLoop.GetOutPort( 'DoLoop' ) + OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) + OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) + OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) + OEndOfInitLoopGate = EndOfInitLoop.GetOutPort( 'Gate' ) + InitLoop.SetName( 'InitLoop' ) + InitLoop.SetAuthor( '' ) + InitLoop.SetComment( 'Compute Node' ) + InitLoop.Coords( 10 , 129 ) + + # Creation of Switch Nodes + PySwitch = [] + PySwitch.append( 'from time import * ' ) + PySwitch.append( 'def Switch(a) : ' ) + PySwitch.append( ' if a <= 0 : ' ) + PySwitch.append( ' sleep(1) ' ) + PySwitch.append( ' return 0,0,a ' ) + PySwitch.append( ' if ( a & 1 ) == 0 : ' ) + PySwitch.append( ' sleep(1) ' ) + PySwitch.append( ' return a & 1,1-(a&1),a ' ) + Switch,EndOfSwitch = GraphSwitchBranchGates1.SNode( 'Switch' , PySwitch ) + EndOfSwitch.SetName( 'EndOfSwitch' ) + EndOfSwitch.SetAuthor( '' ) + EndOfSwitch.SetComment( 'Compute Node' ) + EndOfSwitch.Coords( 589 , 170 ) + PyEndOfSwitch = [] + EndOfSwitch.SetPyFunction( '' , PyEndOfSwitch ) + IEndOfSwitcha = EndOfSwitch.InPort( 'a' , 'long' ) + IEndOfSwitchDefault = EndOfSwitch.GetInPort( 'Default' ) + OEndOfSwitcha = EndOfSwitch.OutPort( 'a' , 'long' ) + OEndOfSwitchGate = EndOfSwitch.GetOutPort( 'Gate' ) + Switch.SetName( 'Switch' ) + Switch.SetAuthor( '' ) + Switch.SetComment( 'Compute Node' ) + Switch.Coords( 195 , 130 ) + ISwitcha = Switch.InPort( 'a' , 'long' ) + ISwitchGate = Switch.GetInPort( 'Gate' ) + OSwitchOdd = Switch.OutPort( 'Odd' , 'long' ) + OSwitchEven = Switch.OutPort( 'Even' , 'int' ) + OSwitcha = Switch.OutPort( 'a' , 'int' ) + OSwitchDefault = Switch.GetOutPort( 'Default' ) + + # Creation of Links + LIsOddaEndOfSwitcha = GraphSwitchBranchGates1.Link( OIsOdda , IEndOfSwitcha ) + LIsOddaEndOfSwitcha.AddCoord( 1 , 571 , 201 ) + LIsOddaEndOfSwitcha.AddCoord( 2 , 571 , 136 ) + + LIsOddGateEndOfSwitchDefault = GraphSwitchBranchGates1.Link( OIsOddGate , IEndOfSwitchDefault ) + + LInitLoopIndexSwitcha = GraphSwitchBranchGates1.Link( OInitLoopIndex , ISwitcha ) + + LInitLoopMinEndOfInitLoopMin = GraphSwitchBranchGates1.Link( OInitLoopMin , IEndOfInitLoopMin ) + + LInitLoopMaxEndOfInitLoopMax = GraphSwitchBranchGates1.Link( OInitLoopMax , IEndOfInitLoopMax ) + + LSwitchOddIsOddGate = GraphSwitchBranchGates1.Link( OSwitchOdd , IIsOddGate ) + + LSwitchEvenEndOfSwitchDefault = GraphSwitchBranchGates1.Link( OSwitchEven , IEndOfSwitchDefault ) + + LSwitchaIsOdda = GraphSwitchBranchGates1.Link( OSwitcha , IIsOdda ) + LSwitchaIsOdda.AddCoord( 1 , 375 , 136 ) + LSwitchaIsOdda.AddCoord( 2 , 375 , 201 ) + + LSwitchDefaultEndOfSwitchDefault = GraphSwitchBranchGates1.Link( OSwitchDefault , IEndOfSwitchDefault ) + + LEndOfSwitchaEndOfInitLoopIndex = GraphSwitchBranchGates1.Link( OEndOfSwitcha , IEndOfInitLoopIndex ) + + # Input datas + IInitLoopIndex.Input( 0 ) + IInitLoopMin.Input( -5 ) + IInitLoopMax.Input( 23 ) + + # Output Ports of the graph + #OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) + #OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) + #OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) + return GraphSwitchBranchGates1 + + +GraphSwitchBranchGates1 = DefGraphSwitchBranchGates1() diff --git a/examples/GraphSwitchBranchGates1.xml b/examples/GraphSwitchBranchGates1.xml new file mode 100644 index 0000000..774e812 --- /dev/null +++ b/examples/GraphSwitchBranchGates1.xml @@ -0,0 +1,357 @@ + + + + + +? + ? + GraphSwitchBranchGates1 + 1 + ? + +GraphSwitchNOTValid + + +long + InitLoop__Index + +long + InitLoop__Min + +long + InitLoop__Max + + +long + EndOfInitLoop__Index + +long + EndOfInitLoop__Min + +long + EndOfInitLoop__Max + + + 1/10/2003 - 17:12:48 + 8/4/2005 - 9:55:15 + 1.05 + JR + ? + ? + 0 + 0 + + +? + ? + IsOdd + 3 + ? + +IsOdd + + +long + a + + +long + a + + + +IsOdd + + + + + + 8/4/2005 - 9:39:12 + 8/4/2005 - 9:39:12 + 1.05 + ? + ? + Python function + 389 + 65 + +? + ? + InitLoop + 4 + EndOfInitLoop + +InitLoop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +InitLoop + + + + +MoreLoop + + = Min : ]]> + + + + + +NextLoop + + + + 8/4/2005 - 9:39:12 + 8/4/2005 - 9:39:12 + 1.05 + ? + ? + Compute Node + 10 + 129 + +? + ? + EndOfInitLoop + 5 + InitLoop + +EndOfInitLoop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +? + + 8/4/2005 - 9:39:12 + 8/4/2005 - 9:39:12 + 1.05 + ? + ? + Compute Node + 777 + 170 + +? + ? + Switch + 6 + EndOfSwitch + +Switch + + +long + a + + +long + Odd + +int + Even + +int + a + + + +Switch + + + + + + + + + 8/4/2005 - 9:39:12 + 8/4/2005 - 9:39:12 + 1.05 + ? + ? + Compute Node + 195 + 130 + +? + ? + EndOfSwitch + 7 + Switch + +EndOfSwitch + + +long + a + + +long + a + + + +? + + 8/4/2005 - 9:39:12 + 8/4/2005 - 9:39:12 + 1.05 + ? + ? + Compute Node + 589 + 170 + + +IsOdd + a + EndOfSwitch + a + + +571 + 201 + +571 + 136 + +IsOdd + Gate + EndOfSwitch + Default + + +InitLoop + DoLoop + EndOfInitLoop + DoLoop + + +InitLoop + Index + Switch + a + + +InitLoop + Min + EndOfInitLoop + Min + + +InitLoop + Max + EndOfInitLoop + Max + + +EndOfInitLoop + DoLoop + InitLoop + DoLoop + + +Switch + Odd + IsOdd + Gate + + +Switch + Even + EndOfSwitch + Default + + +Switch + a + IsOdd + a + + +375 + 136 + +375 + 201 + +Switch + Default + EndOfSwitch + Default + + +EndOfSwitch + a + EndOfInitLoop + Index + + + +GraphSwitchBranchGates1 + InitLoop__Index + InitLoop + Index + +3 + 0 + + +GraphSwitchBranchGates1 + InitLoop__Min + InitLoop + Min + +3 + -5 + + +GraphSwitchBranchGates1 + InitLoop__Max + InitLoop + Max + +3 + 23 + diff --git a/examples/GraphSwitchBugAborted.py b/examples/GraphSwitchBugAborted.py new file mode 100644 index 0000000..2d3498f --- /dev/null +++ b/examples/GraphSwitchBugAborted.py @@ -0,0 +1,146 @@ + +# Generated python file of Graph GraphSwitchBugAborted + +from SuperV import * + +# Graph creation of GraphSwitchBugAborted +def DefGraphSwitchBugAborted() : + GraphSwitchBugAborted = Graph( 'GraphSwitchBugAborted' ) + GraphSwitchBugAborted.SetName( 'GraphSwitchBugAborted' ) + GraphSwitchBugAborted.SetAuthor( 'JR' ) + GraphSwitchBugAborted.SetComment( '' ) + GraphSwitchBugAborted.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsOdd = [] + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd(a) : ' ) + PyIsOdd.append( ' print a,"IsOdd (GraphSwitch)" ' ) + PyIsOdd.append( ' sleep( 1 ) ' ) + PyIsOdd.append( ' return a ' ) + IsOdd = GraphSwitchBugAborted.INode( 'IsOdd' , PyIsOdd ) + IsOdd.SetName( 'IsOdd' ) + IsOdd.SetAuthor( '' ) + IsOdd.SetComment( 'Python function' ) + IsOdd.Coords( 389 , 65 ) + IIsOdda = IsOdd.InPort( 'a' , 'long' ) + IIsOddGate = IsOdd.GetInPort( 'Gate' ) + OIsOdda = IsOdd.OutPort( 'a' , 'long' ) + OIsOddGate = IsOdd.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyInitLoopSwitch = [] + PyInitLoopSwitch.append( 'def InitLoop(Index,Min,Max) : ' ) + PyInitLoopSwitch.append( ' return Index,Min,Max ' ) + PyMoreInitLoopSwitch = [] + PyMoreInitLoopSwitch.append( 'def MoreLoop(Index,Min,Max) : ' ) + PyMoreInitLoopSwitch.append( ' if Index <= Max : ' ) + PyMoreInitLoopSwitch.append( ' DoLoop = 1 ' ) + PyMoreInitLoopSwitch.append( ' else : ' ) + PyMoreInitLoopSwitch.append( ' DoLoop = 0 ' ) + PyMoreInitLoopSwitch.append( ' return DoLoop,Index,Min,Max ' ) + PyNextInitLoopSwitch = [] + PyNextInitLoopSwitch.append( 'def NextLoop(Index,Min,Max) : ' ) + PyNextInitLoopSwitch.append( ' Index = Index + 1 ' ) + PyNextInitLoopSwitch.append( ' return Index,Min,Max ' ) + InitLoopSwitch,EndOfInitLoopSwitch = GraphSwitchBugAborted.LNode( 'InitLoop' , PyInitLoopSwitch , 'MoreLoop' , PyMoreInitLoopSwitch , 'NextLoop' , PyNextInitLoopSwitch ) + EndOfInitLoopSwitch.SetName( 'EndOfInitLoopSwitch' ) + EndOfInitLoopSwitch.SetAuthor( '' ) + EndOfInitLoopSwitch.SetComment( 'Compute Node' ) + EndOfInitLoopSwitch.Coords( 772 , 132 ) + PyEndOfInitLoopSwitch = [] + EndOfInitLoopSwitch.SetPyFunction( '' , PyEndOfInitLoopSwitch ) + IInitLoopSwitchDoLoop = InitLoopSwitch.GetInPort( 'DoLoop' ) + IInitLoopSwitchIndex = InitLoopSwitch.InPort( 'Index' , 'long' ) + IInitLoopSwitchMin = InitLoopSwitch.InPort( 'Min' , 'long' ) + IInitLoopSwitchMax = InitLoopSwitch.InPort( 'Max' , 'long' ) + IInitLoopSwitchGate = InitLoopSwitch.GetInPort( 'Gate' ) + OInitLoopSwitchDoLoop = InitLoopSwitch.GetOutPort( 'DoLoop' ) + OInitLoopSwitchIndex = InitLoopSwitch.GetOutPort( 'Index' ) + OInitLoopSwitchMin = InitLoopSwitch.GetOutPort( 'Min' ) + OInitLoopSwitchMax = InitLoopSwitch.GetOutPort( 'Max' ) + IEndOfInitLoopSwitchDoLoop = EndOfInitLoopSwitch.GetInPort( 'DoLoop' ) + IEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetInPort( 'Index' ) + IEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetInPort( 'Min' ) + IEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetInPort( 'Max' ) + IEndOfInitLoopSwitchGate = EndOfInitLoopSwitch.GetInPort( 'Gate' ) + OEndOfInitLoopSwitchDoLoop = EndOfInitLoopSwitch.GetOutPort( 'DoLoop' ) + OEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetOutPort( 'Index' ) + OEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetOutPort( 'Min' ) + OEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetOutPort( 'Max' ) + OEndOfInitLoopSwitchGate = EndOfInitLoopSwitch.GetOutPort( 'Gate' ) + InitLoopSwitch.SetName( 'InitLoopSwitch' ) + InitLoopSwitch.SetAuthor( '' ) + InitLoopSwitch.SetComment( 'Compute Node' ) + InitLoopSwitch.Coords( 10 , 129 ) + + # Creation of Switch Nodes + PySwitch = [] + PySwitch.append( 'from time import * ' ) + PySwitch.append( 'def Switch(a) : ' ) + PySwitch.append( ' if ( a & 1 ) == 0 : ' ) + PySwitch.append( ' sleep(1) ' ) + PySwitch.append( ' return a & 1,1-(a&1),a,a ' ) + Switch,EndOfSwitch = GraphSwitchBugAborted.SNode( 'Switch' , PySwitch ) + EndOfSwitch.SetName( 'EndOfSwitch' ) + EndOfSwitch.SetAuthor( '' ) + EndOfSwitch.SetComment( 'Compute Node' ) + EndOfSwitch.Coords( 581 , 132 ) + PyEndOfSwitch = [] + PyEndOfSwitch.append( 'def EndOfSwitch(a,Even,k) : ' ) + PyEndOfSwitch.append( ' return a ' ) + EndOfSwitch.SetPyFunction( 'EndOfSwitch' , PyEndOfSwitch ) + IEndOfSwitcha = EndOfSwitch.InPort( 'a' , 'long' ) + IEndOfSwitchEven = EndOfSwitch.InPort( 'Even' , 'long' ) + IEndOfSwitchk = EndOfSwitch.InPort( 'k' , 'long' ) + IEndOfSwitchDefault = EndOfSwitch.GetInPort( 'Default' ) + OEndOfSwitcha = EndOfSwitch.OutPort( 'a' , 'long' ) + OEndOfSwitchGate = EndOfSwitch.GetOutPort( 'Gate' ) + Switch.SetName( 'Switch' ) + Switch.SetAuthor( '' ) + Switch.SetComment( 'Compute Node' ) + Switch.Coords( 194 , 129 ) + ISwitcha = Switch.InPort( 'a' , 'long' ) + ISwitchGate = Switch.GetInPort( 'Gate' ) + OSwitchOdd = Switch.OutPort( 'Odd' , 'long' ) + OSwitchEven = Switch.OutPort( 'Even' , 'int' ) + OSwitcha = Switch.OutPort( 'a' , 'int' ) + OSwitchn = Switch.OutPort( 'n' , 'int' ) + OSwitchDefault = Switch.GetOutPort( 'Default' ) + + # Creation of Links + LIsOddaEndOfSwitcha = GraphSwitchBugAborted.Link( OIsOdda , IEndOfSwitcha ) + + LInitLoopSwitchIndexSwitcha = GraphSwitchBugAborted.Link( OInitLoopSwitchIndex , ISwitcha ) + + LInitLoopSwitchMinEndOfInitLoopSwitchMin = GraphSwitchBugAborted.Link( OInitLoopSwitchMin , IEndOfInitLoopSwitchMin ) + + LInitLoopSwitchMaxEndOfInitLoopSwitchMax = GraphSwitchBugAborted.Link( OInitLoopSwitchMax , IEndOfInitLoopSwitchMax ) + + LSwitchOddIsOddGate = GraphSwitchBugAborted.Link( OSwitchOdd , IIsOddGate ) + + LSwitchaIsOdda = GraphSwitchBugAborted.Link( OSwitcha , IIsOdda ) + + LSwitchnEndOfSwitchk = GraphSwitchBugAborted.Link( OSwitchn , IEndOfSwitchk ) + + LEndOfSwitchaEndOfInitLoopSwitchIndex = GraphSwitchBugAborted.Link( OEndOfSwitcha , IEndOfInitLoopSwitchIndex ) + + # Input datas + IInitLoopSwitchIndex.Input( 0 ) + IInitLoopSwitchMin.Input( 0 ) + IInitLoopSwitchMax.Input( 20 ) + + # Input Ports of the graph + #IEndOfSwitchEven = EndOfSwitch.GetInPort( 'Even' ) + + # Output Ports of the graph + #OEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetOutPort( 'Index' ) + #OEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetOutPort( 'Min' ) + #OEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetOutPort( 'Max' ) + #OSwitchEven = Switch.GetOutPort( 'Even' ) + return GraphSwitchBugAborted + + +GraphSwitchBugAborted = DefGraphSwitchBugAborted() diff --git a/examples/GraphSwitchBugAborted.xml b/examples/GraphSwitchBugAborted.xml new file mode 100644 index 0000000..0e2267f --- /dev/null +++ b/examples/GraphSwitchBugAborted.xml @@ -0,0 +1,345 @@ + + + + + +? + ? + GraphSwitchBugAborted + 1 + ? + +GraphSwitchBugNODefault_1 + + +long + InitLoopSwitch__Index + +long + InitLoopSwitch__Min + +long + InitLoopSwitch__Max + +long + EndOfSwitch__Even + + +long + EndOfInitLoopSwitch__Index + +long + EndOfInitLoopSwitch__Min + +long + EndOfInitLoopSwitch__Max + +int + Switch__Even + + + 1/10/2003 - 17:23:54 + 28/6/2005 - 10:56:46 + 1.05 + JR + ? + ? + 0 + 0 + + +? + ? + IsOdd + 3 + ? + +IsOdd + + +long + a + + +long + a + + + +IsOdd + + + + + + 28/6/2005 - 10:56:46 + 28/6/2005 - 10:56:46 + 1.05 + ? + ? + Python function + 389 + 65 + +? + ? + InitLoopSwitch + 4 + EndOfInitLoopSwitch + +InitLoopSwitch + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +InitLoop + + + +MoreLoop + + + + + + + +NextLoop + + + + 28/6/2005 - 10:56:46 + 28/6/2005 - 10:56:46 + 1.05 + ? + ? + Compute Node + 10 + 129 + +? + ? + EndOfInitLoopSwitch + 5 + InitLoopSwitch + +EndOfInitLoopSwitch + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +? + + 28/6/2005 - 10:56:46 + 28/6/2005 - 10:56:46 + 1.05 + ? + ? + Compute Node + 772 + 132 + +? + ? + Switch + 6 + EndOfSwitch + +Switch + + +long + a + + +long + Odd + +int + Even + +int + a + +int + n + + + +Switch + + + + + + 28/6/2005 - 10:56:46 + 28/6/2005 - 10:56:46 + 1.05 + ? + ? + Compute Node + 194 + 129 + +? + ? + EndOfSwitch + 7 + Switch + +EndOfSwitch + + +long + a + +long + Even + +long + k + + +long + a + + + +EndOfSwitch + + + 28/6/2005 - 10:56:46 + 28/6/2005 - 10:56:46 + 1.05 + ? + ? + Compute Node + 581 + 132 + + +IsOdd + a + EndOfSwitch + a + + +InitLoopSwitch + DoLoop + EndOfInitLoopSwitch + DoLoop + + +InitLoopSwitch + Index + Switch + a + + +InitLoopSwitch + Min + EndOfInitLoopSwitch + Min + + +InitLoopSwitch + Max + EndOfInitLoopSwitch + Max + + +EndOfInitLoopSwitch + DoLoop + InitLoopSwitch + DoLoop + + +Switch + Odd + IsOdd + Gate + + +Switch + a + IsOdd + a + + +Switch + n + EndOfSwitch + k + + +EndOfSwitch + a + EndOfInitLoopSwitch + Index + + + +GraphSwitchBugAborted + InitLoopSwitch__Index + InitLoopSwitch + Index + +3 + 0 + + +GraphSwitchBugAborted + InitLoopSwitch__Min + InitLoopSwitch + Min + +3 + 0 + + +GraphSwitchBugAborted + InitLoopSwitch__Max + InitLoopSwitch + Max + +3 + 20 + diff --git a/examples/GraphSwitchBugDefault.py b/examples/GraphSwitchBugDefault.py new file mode 100644 index 0000000..6773671 --- /dev/null +++ b/examples/GraphSwitchBugDefault.py @@ -0,0 +1,149 @@ + +# Generated python file of Graph GraphSwitchBugDefault + +from SuperV import * + +# Graph creation of GraphSwitchBugDefault +def DefGraphSwitchBugDefault() : + GraphSwitchBugDefault = Graph( 'GraphSwitchBugDefault' ) + GraphSwitchBugDefault.SetName( 'GraphSwitchBugDefault' ) + GraphSwitchBugDefault.SetAuthor( 'JR' ) + GraphSwitchBugDefault.SetComment( '' ) + GraphSwitchBugDefault.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsOdd = [] + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd(a) : ' ) + PyIsOdd.append( ' print a,"IsOdd (GraphSwitch)" ' ) + PyIsOdd.append( ' sleep( 1 ) ' ) + PyIsOdd.append( ' return a ' ) + IsOdd = GraphSwitchBugDefault.INode( 'IsOdd' , PyIsOdd ) + IsOdd.SetName( 'IsOdd' ) + IsOdd.SetAuthor( '' ) + IsOdd.SetComment( 'Python function' ) + IsOdd.Coords( 389 , 65 ) + IIsOdda = IsOdd.InPort( 'a' , 'long' ) + IIsOddGate = IsOdd.GetInPort( 'Gate' ) + OIsOdda = IsOdd.OutPort( 'a' , 'long' ) + OIsOddGate = IsOdd.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyInitLoopSwitch = [] + PyInitLoopSwitch.append( 'def InitLoop(Index,Min,Max) : ' ) + PyInitLoopSwitch.append( ' Index = Min ' ) + PyInitLoopSwitch.append( ' return Index,Min,Max ' ) + PyMoreInitLoopSwitch = [] + PyMoreInitLoopSwitch.append( 'def MoreLoop(Index,Min,Max) : ' ) + PyMoreInitLoopSwitch.append( ' if Index <= Max : ' ) + PyMoreInitLoopSwitch.append( ' DoLoop = 1 ' ) + PyMoreInitLoopSwitch.append( ' else : ' ) + PyMoreInitLoopSwitch.append( ' DoLoop = 0 ' ) + PyMoreInitLoopSwitch.append( ' return DoLoop,Index,Min,Max ' ) + PyNextInitLoopSwitch = [] + PyNextInitLoopSwitch.append( 'def NextLoop(Index,Min,Max) : ' ) + PyNextInitLoopSwitch.append( ' Index = Index + 1 ' ) + PyNextInitLoopSwitch.append( ' return Index,Min,Max ' ) + InitLoopSwitch,EndOfInitLoopSwitch = GraphSwitchBugDefault.LNode( 'InitLoop' , PyInitLoopSwitch , 'MoreLoop' , PyMoreInitLoopSwitch , 'NextLoop' , PyNextInitLoopSwitch ) + EndOfInitLoopSwitch.SetName( 'EndOfInitLoopSwitch' ) + EndOfInitLoopSwitch.SetAuthor( '' ) + EndOfInitLoopSwitch.SetComment( 'Compute Node' ) + EndOfInitLoopSwitch.Coords( 772 , 132 ) + PyEndOfInitLoopSwitch = [] + EndOfInitLoopSwitch.SetPyFunction( '' , PyEndOfInitLoopSwitch ) + IInitLoopSwitchDoLoop = InitLoopSwitch.GetInPort( 'DoLoop' ) + IInitLoopSwitchIndex = InitLoopSwitch.InPort( 'Index' , 'long' ) + IInitLoopSwitchMin = InitLoopSwitch.InPort( 'Min' , 'long' ) + IInitLoopSwitchMax = InitLoopSwitch.InPort( 'Max' , 'long' ) + IInitLoopSwitchGate = InitLoopSwitch.GetInPort( 'Gate' ) + OInitLoopSwitchDoLoop = InitLoopSwitch.GetOutPort( 'DoLoop' ) + OInitLoopSwitchIndex = InitLoopSwitch.GetOutPort( 'Index' ) + OInitLoopSwitchMin = InitLoopSwitch.GetOutPort( 'Min' ) + OInitLoopSwitchMax = InitLoopSwitch.GetOutPort( 'Max' ) + IEndOfInitLoopSwitchDoLoop = EndOfInitLoopSwitch.GetInPort( 'DoLoop' ) + IEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetInPort( 'Index' ) + IEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetInPort( 'Min' ) + IEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetInPort( 'Max' ) + IEndOfInitLoopSwitchGate = EndOfInitLoopSwitch.GetInPort( 'Gate' ) + OEndOfInitLoopSwitchDoLoop = EndOfInitLoopSwitch.GetOutPort( 'DoLoop' ) + OEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetOutPort( 'Index' ) + OEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetOutPort( 'Min' ) + OEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetOutPort( 'Max' ) + OEndOfInitLoopSwitchGate = EndOfInitLoopSwitch.GetOutPort( 'Gate' ) + InitLoopSwitch.SetName( 'InitLoopSwitch' ) + InitLoopSwitch.SetAuthor( '' ) + InitLoopSwitch.SetComment( 'Compute Node' ) + InitLoopSwitch.Coords( 10 , 129 ) + + # Creation of Switch Nodes + PySwitch = [] + PySwitch.append( 'from time import * ' ) + PySwitch.append( 'def Switch(a) : ' ) + PySwitch.append( ' if ( a & 1 ) == 0 : ' ) + PySwitch.append( ' sleep(1) ' ) + PySwitch.append( ' return a & 1,1-(a&1),a,a ' ) + Switch,EndOfSwitch = GraphSwitchBugDefault.SNode( 'Switch' , PySwitch ) + EndOfSwitch.SetName( 'EndOfSwitch' ) + EndOfSwitch.SetAuthor( '' ) + EndOfSwitch.SetComment( 'Compute Node' ) + EndOfSwitch.Coords( 581 , 132 ) + PyEndOfSwitch = [] + PyEndOfSwitch.append( 'def EndOfSwitch(a,Even,k) : ' ) + PyEndOfSwitch.append( ' return a ' ) + EndOfSwitch.SetPyFunction( 'EndOfSwitch' , PyEndOfSwitch ) + IEndOfSwitcha = EndOfSwitch.InPort( 'a' , 'long' ) + IEndOfSwitchEven = EndOfSwitch.InPort( 'Even' , 'long' ) + IEndOfSwitchk = EndOfSwitch.InPort( 'k' , 'long' ) + IEndOfSwitchDefault = EndOfSwitch.GetInPort( 'Default' ) + OEndOfSwitcha = EndOfSwitch.OutPort( 'a' , 'long' ) + OEndOfSwitchGate = EndOfSwitch.GetOutPort( 'Gate' ) + Switch.SetName( 'Switch' ) + Switch.SetAuthor( '' ) + Switch.SetComment( 'Compute Node' ) + Switch.Coords( 194 , 129 ) + ISwitcha = Switch.InPort( 'a' , 'long' ) + ISwitchGate = Switch.GetInPort( 'Gate' ) + OSwitchOdd = Switch.OutPort( 'Odd' , 'long' ) + OSwitchEven = Switch.OutPort( 'Even' , 'int' ) + OSwitcha = Switch.OutPort( 'a' , 'int' ) + OSwitchn = Switch.OutPort( 'n' , 'int' ) + OSwitchDefault = Switch.GetOutPort( 'Default' ) + + # Creation of Links + LIsOddaEndOfSwitcha = GraphSwitchBugDefault.Link( OIsOdda , IEndOfSwitcha ) + + LInitLoopSwitchIndexSwitcha = GraphSwitchBugDefault.Link( OInitLoopSwitchIndex , ISwitcha ) + + LInitLoopSwitchMinEndOfInitLoopSwitchMin = GraphSwitchBugDefault.Link( OInitLoopSwitchMin , IEndOfInitLoopSwitchMin ) + + LInitLoopSwitchMaxEndOfInitLoopSwitchMax = GraphSwitchBugDefault.Link( OInitLoopSwitchMax , IEndOfInitLoopSwitchMax ) + + LSwitchOddIsOddGate = GraphSwitchBugDefault.Link( OSwitchOdd , IIsOddGate ) + + LSwitchaIsOdda = GraphSwitchBugDefault.Link( OSwitcha , IIsOdda ) + + LSwitchnEndOfSwitchk = GraphSwitchBugDefault.Link( OSwitchn , IEndOfSwitchk ) + + LSwitchDefaultEndOfSwitchDefault = GraphSwitchBugDefault.Link( OSwitchDefault , IEndOfSwitchDefault ) + + LEndOfSwitchaEndOfInitLoopSwitchIndex = GraphSwitchBugDefault.Link( OEndOfSwitcha , IEndOfInitLoopSwitchIndex ) + + # Input datas + IInitLoopSwitchIndex.Input( 0 ) + IInitLoopSwitchMin.Input( 1 ) + IInitLoopSwitchMax.Input( 20 ) + + # Input Ports of the graph + #IEndOfSwitchEven = EndOfSwitch.GetInPort( 'Even' ) + + # Output Ports of the graph + #OEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetOutPort( 'Index' ) + #OEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetOutPort( 'Min' ) + #OEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetOutPort( 'Max' ) + #OSwitchEven = Switch.GetOutPort( 'Even' ) + return GraphSwitchBugDefault + + +GraphSwitchBugDefault = DefGraphSwitchBugDefault() diff --git a/examples/GraphSwitchBugDefault.xml b/examples/GraphSwitchBugDefault.xml new file mode 100644 index 0000000..6be3e3e --- /dev/null +++ b/examples/GraphSwitchBugDefault.xml @@ -0,0 +1,352 @@ + + + + + +? + ? + GraphSwitchBugDefault + 1 + ? + +GraphSwitchBugDefault + + +long + InitLoopSwitch__Index + +long + InitLoopSwitch__Min + +long + InitLoopSwitch__Max + +long + EndOfSwitch__Even + + +long + EndOfInitLoopSwitch__Index + +long + EndOfInitLoopSwitch__Min + +long + EndOfInitLoopSwitch__Max + +int + Switch__Even + + + 1/10/2003 - 17:23:54 + 30/6/2005 - 10:41:27 + 1.05 + JR + ? + ? + 0 + 0 + + +? + ? + IsOdd + 3 + ? + +IsOdd + + +long + a + + +long + a + + + +IsOdd + + + + + + 30/6/2005 - 10:41:27 + 30/6/2005 - 10:41:27 + 1.05 + ? + ? + Python function + 389 + 65 + +? + ? + InitLoopSwitch + 4 + EndOfInitLoopSwitch + +InitLoopSwitch + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +InitLoop + + + + +MoreLoop + + + + + + + +NextLoop + + + + 30/6/2005 - 10:41:27 + 30/6/2005 - 10:41:27 + 1.05 + ? + ? + Compute Node + 10 + 129 + +? + ? + EndOfInitLoopSwitch + 5 + InitLoopSwitch + +EndOfInitLoopSwitch + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +? + + 30/6/2005 - 10:41:27 + 30/6/2005 - 10:41:27 + 1.05 + ? + ? + Compute Node + 772 + 132 + +? + ? + Switch + 6 + EndOfSwitch + +Switch + + +long + a + + +long + Odd + +int + Even + +int + a + +int + n + + + +Switch + + + + + + 30/6/2005 - 10:41:27 + 30/6/2005 - 10:41:27 + 1.05 + ? + ? + Compute Node + 194 + 129 + +? + ? + EndOfSwitch + 7 + Switch + +EndOfSwitch + + +long + a + +long + Even + +long + k + + +long + a + + + +EndOfSwitch + + + 30/6/2005 - 10:41:27 + 30/6/2005 - 10:41:27 + 1.05 + ? + ? + Compute Node + 581 + 132 + + +IsOdd + a + EndOfSwitch + a + + +InitLoopSwitch + DoLoop + EndOfInitLoopSwitch + DoLoop + + +InitLoopSwitch + Index + Switch + a + + +InitLoopSwitch + Min + EndOfInitLoopSwitch + Min + + +InitLoopSwitch + Max + EndOfInitLoopSwitch + Max + + +EndOfInitLoopSwitch + DoLoop + InitLoopSwitch + DoLoop + + +Switch + Odd + IsOdd + Gate + + +Switch + a + IsOdd + a + + +Switch + n + EndOfSwitch + k + + +Switch + Default + EndOfSwitch + Default + + +EndOfSwitch + a + EndOfInitLoopSwitch + Index + + + +GraphSwitchBugDefault + InitLoopSwitch__Index + InitLoopSwitch + Index + +3 + 0 + + +GraphSwitchBugDefault + InitLoopSwitch__Min + InitLoopSwitch + Min + +3 + 1 + + +GraphSwitchBugDefault + InitLoopSwitch__Max + InitLoopSwitch + Max + +3 + 20 + diff --git a/examples/GraphSwitchCheckBranch1.py b/examples/GraphSwitchCheckBranch1.py index 9ee068c..c964a44 100644 --- a/examples/GraphSwitchCheckBranch1.py +++ b/examples/GraphSwitchCheckBranch1.py @@ -1,15 +1,15 @@ -# Generated python file of Graph GraphSwitchCheckBranch1 +# Generated python file of Graph GraphSwitchCheckBranch1_1 from SuperV import * -# Graph creation of GraphSwitchCheckBranch1 -def DefGraphSwitchCheckBranch1() : - GraphSwitchCheckBranch1 = Graph( 'GraphSwitchCheckBranch1' ) - GraphSwitchCheckBranch1.SetName( 'GraphSwitchCheckBranch1' ) - GraphSwitchCheckBranch1.SetAuthor( 'JR' ) - GraphSwitchCheckBranch1.SetComment( 'Switch with two SwitchBranches, One NotSwitchBranch and the DefaultBranch' ) - GraphSwitchCheckBranch1.Coords( 0 , 0 ) +# Graph creation of GraphSwitchCheckBranch1_1 +def DefGraphSwitchCheckBranch1_1() : + GraphSwitchCheckBranch1_1 = Graph( 'GraphSwitchCheckBranch1_1' ) + GraphSwitchCheckBranch1_1.SetName( 'GraphSwitchCheckBranch1_1' ) + GraphSwitchCheckBranch1_1.SetAuthor( 'JR' ) + GraphSwitchCheckBranch1_1.SetComment( 'Switch with two SwitchBranches, One NotSwitchBranch and the DefaultBranch' ) + GraphSwitchCheckBranch1_1.Coords( 0 , 0 ) # Creation of Factory Nodes @@ -20,7 +20,7 @@ def DefGraphSwitchCheckBranch1() : PyIsOdd.append( ' print a,"IsOdd (GraphSwitch)" ' ) PyIsOdd.append( ' sleep( 1 ) ' ) PyIsOdd.append( ' return a ' ) - IsOdd = GraphSwitchCheckBranch1.INode( 'IsOdd' , PyIsOdd ) + IsOdd = GraphSwitchCheckBranch1_1.INode( 'IsOdd' , PyIsOdd ) IsOdd.SetName( 'IsOdd' ) IsOdd.SetAuthor( '' ) IsOdd.SetComment( 'Python function' ) @@ -36,7 +36,7 @@ def DefGraphSwitchCheckBranch1() : PyIsEven.append( ' print a,"IsEven (GraphSwitch)" ' ) PyIsEven.append( ' sleep( 1 ) ' ) PyIsEven.append( ' return a ' ) - IsEven = GraphSwitchCheckBranch1.INode( 'IsEven' , PyIsEven ) + IsEven = GraphSwitchCheckBranch1_1.INode( 'IsEven' , PyIsEven ) IsEven.SetName( 'IsEven' ) IsEven.SetAuthor( '' ) IsEven.SetComment( 'Compute Node' ) @@ -52,16 +52,31 @@ def DefGraphSwitchCheckBranch1() : PyBranchNode.append( ' print "Print ",Branch ' ) PyBranchNode.append( ' sleep(1) ' ) PyBranchNode.append( ' return Branch ' ) - BranchNode = GraphSwitchCheckBranch1.INode( 'Print_1' , PyBranchNode ) + BranchNode = GraphSwitchCheckBranch1_1.INode( 'Print_1' , PyBranchNode ) BranchNode.SetName( 'BranchNode' ) BranchNode.SetAuthor( '' ) BranchNode.SetComment( 'Compute Node' ) - BranchNode.Coords( 604 , 149 ) + BranchNode.Coords( 529 , 177 ) IBranchNodeBranch = BranchNode.InPort( 'Branch' , 'string' ) IBranchNodeGate = BranchNode.GetInPort( 'Gate' ) OBranchNodeBranch = BranchNode.OutPort( 'Branch' , 'string' ) OBranchNodeGate = BranchNode.GetOutPort( 'Gate' ) + Pydefault = [] + Pydefault.append( 'from time import * ' ) + Pydefault.append( 'def default(a) : ' ) + Pydefault.append( ' sleep(1) ' ) + Pydefault.append( ' return a ' ) + default = GraphSwitchCheckBranch1_1.INode( 'default' , Pydefault ) + default.SetName( 'default' ) + default.SetAuthor( '' ) + default.SetComment( 'Compute Node' ) + default.Coords( 428 , 308 ) + Idefaulta = default.InPort( 'a' , 'long' ) + IdefaultGate = default.GetInPort( 'Gate' ) + Odefaulta = default.OutPort( 'a' , 'long' ) + OdefaultGate = default.GetOutPort( 'Gate' ) + # Creation of Loop Nodes PyInitLoopSwitch = [] PyInitLoopSwitch.append( 'def InitLoop(Index,Min,Max) : ' ) @@ -80,11 +95,11 @@ def DefGraphSwitchCheckBranch1() : PyNextInitLoopSwitch.append( 'def NextLoop(Index,Min,Max) : ' ) PyNextInitLoopSwitch.append( ' Index = Index - 1 ' ) PyNextInitLoopSwitch.append( ' return Index,Min,Max ' ) - InitLoopSwitch,EndOfInitLoopSwitch = GraphSwitchCheckBranch1.LNode( 'InitLoop' , PyInitLoopSwitch , 'MoreLoop' , PyMoreInitLoopSwitch , 'NextLoop' , PyNextInitLoopSwitch ) + InitLoopSwitch,EndOfInitLoopSwitch = GraphSwitchCheckBranch1_1.LNode( 'InitLoop' , PyInitLoopSwitch , 'MoreLoop' , PyMoreInitLoopSwitch , 'NextLoop' , PyNextInitLoopSwitch ) EndOfInitLoopSwitch.SetName( 'EndOfInitLoopSwitch' ) EndOfInitLoopSwitch.SetAuthor( '' ) EndOfInitLoopSwitch.SetComment( 'Compute Node' ) - EndOfInitLoopSwitch.Coords( 1074 , 194 ) + EndOfInitLoopSwitch.Coords( 1073 , 216 ) PyEndOfInitLoopSwitch = [] PyEndOfInitLoopSwitch.append( 'from time import * ' ) PyEndOfInitLoopSwitch.append( 'def EndOfInitLoopSwitch(DoLoop,Index,Min,Max) : ' ) @@ -128,11 +143,11 @@ def DefGraphSwitchCheckBranch1() : PySwitch.append( ' else : ' ) PySwitch.append( ' Branch = "Odd" ' ) PySwitch.append( ' return a & 1,1-(a&1),a,Branch,0 ' ) - Switch,EndOfSwitch = GraphSwitchCheckBranch1.SNode( 'Switch' , PySwitch ) + Switch,EndOfSwitch = GraphSwitchCheckBranch1_1.SNode( 'Switch' , PySwitch ) EndOfSwitch.SetName( 'EndOfSwitch' ) EndOfSwitch.SetAuthor( '' ) EndOfSwitch.SetComment( 'Compute Node' ) - EndOfSwitch.Coords( 882 , 194 ) + EndOfSwitch.Coords( 880 , 216 ) PyEndOfSwitch = [] PyEndOfSwitch.append( 'from time import * ' ) PyEndOfSwitch.append( 'def EndOfSwitch(a,Branch) : ' ) @@ -158,39 +173,50 @@ def DefGraphSwitchCheckBranch1() : OSwitchDefault = Switch.GetOutPort( 'Default' ) # Creation of Links - LIsOddaEndOfSwitcha = GraphSwitchCheckBranch1.Link( OIsOdda , IEndOfSwitcha ) + LIsOddaEndOfSwitcha = GraphSwitchCheckBranch1_1.Link( OIsOdda , IEndOfSwitcha ) - LIsEvenaEndOfSwitcha = GraphSwitchCheckBranch1.Link( OIsEvena , IEndOfSwitcha ) + LIsEvenaEndOfSwitcha = GraphSwitchCheckBranch1_1.Link( OIsEvena , IEndOfSwitcha ) - LBranchNodeBranchEndOfSwitchBranch = GraphSwitchCheckBranch1.Link( OBranchNodeBranch , IEndOfSwitchBranch ) + LBranchNodeBranchEndOfSwitchBranch = GraphSwitchCheckBranch1_1.Link( OBranchNodeBranch , IEndOfSwitchBranch ) - LInitLoopSwitchIndexSwitcha = GraphSwitchCheckBranch1.Link( OInitLoopSwitchIndex , ISwitcha ) + LInitLoopSwitchIndexSwitcha = GraphSwitchCheckBranch1_1.Link( OInitLoopSwitchIndex , ISwitcha ) - LInitLoopSwitchMinEndOfInitLoopSwitchMin = GraphSwitchCheckBranch1.Link( OInitLoopSwitchMin , IEndOfInitLoopSwitchMin ) + LInitLoopSwitchMinEndOfInitLoopSwitchMin = GraphSwitchCheckBranch1_1.Link( OInitLoopSwitchMin , IEndOfInitLoopSwitchMin ) - LInitLoopSwitchMaxEndOfInitLoopSwitchMax = GraphSwitchCheckBranch1.Link( OInitLoopSwitchMax , IEndOfInitLoopSwitchMax ) + LInitLoopSwitchMaxEndOfInitLoopSwitchMax = GraphSwitchCheckBranch1_1.Link( OInitLoopSwitchMax , IEndOfInitLoopSwitchMax ) - LSwitchOddIsOddGate = GraphSwitchCheckBranch1.Link( OSwitchOdd , IIsOddGate ) + LSwitchOddIsOddGate = GraphSwitchCheckBranch1_1.Link( OSwitchOdd , IIsOddGate ) LSwitchOddIsOddGate.AddCoord( 1 , 401 , 101 ) LSwitchOddIsOddGate.AddCoord( 2 , 401 , 188 ) - LSwitchEvenIsEvenGate = GraphSwitchCheckBranch1.Link( OSwitchEven , IIsEvenGate ) + LSwitchEvenIsEvenGate = GraphSwitchCheckBranch1_1.Link( OSwitchEven , IIsEvenGate ) LSwitchEvenIsEvenGate.AddCoord( 1 , 392 , 533 ) LSwitchEvenIsEvenGate.AddCoord( 2 , 392 , 208 ) - LSwitchaIsOdda = GraphSwitchCheckBranch1.Link( OSwitcha , IIsOdda ) + LSwitchaIsOdda = GraphSwitchCheckBranch1_1.Link( OSwitcha , IIsOdda ) LSwitchaIsOdda.AddCoord( 1 , 382 , 78 ) LSwitchaIsOdda.AddCoord( 2 , 382 , 229 ) - LSwitchaIsEvena = GraphSwitchCheckBranch1.Link( OSwitcha , IIsEvena ) + LSwitchaIsEvena = GraphSwitchCheckBranch1_1.Link( OSwitcha , IIsEvena ) LSwitchaIsEvena.AddCoord( 1 , 381 , 509 ) LSwitchaIsEvena.AddCoord( 2 , 381 , 229 ) - LSwitchBranchBranchNodeBranch = GraphSwitchCheckBranch1.Link( OSwitchBranch , IBranchNodeBranch ) + LSwitchadefaulta = GraphSwitchCheckBranch1_1.Link( OSwitcha , Idefaulta ) + LSwitchadefaulta.AddCoord( 1 , 382 , 377 ) + LSwitchadefaulta.AddCoord( 2 , 382 , 228 ) + + LSwitchBranchBranchNodeBranch = GraphSwitchCheckBranch1_1.Link( OSwitchBranch , IBranchNodeBranch ) + + LSwitchdefaultdefaultGate = GraphSwitchCheckBranch1_1.Link( OSwitchdefault , IdefaultGate ) + LSwitchdefaultdefaultGate.AddCoord( 1 , 410 , 403 ) + LSwitchdefaultdefaultGate.AddCoord( 2 , 410 , 269 ) + LSwitchdefaultdefaultGate.AddCoord( 3 , 410 , 268 ) + + LSwitchDefaultEndOfSwitchDefault = GraphSwitchCheckBranch1_1.Link( OSwitchDefault , IEndOfSwitchDefault ) - LSwitchdefaultEndOfSwitchDefault = GraphSwitchCheckBranch1.Link( OSwitchdefault , IEndOfSwitchDefault ) + LEndOfSwitchaEndOfInitLoopSwitchIndex = GraphSwitchCheckBranch1_1.Link( OEndOfSwitcha , IEndOfInitLoopSwitchIndex ) - LEndOfSwitchaEndOfInitLoopSwitchIndex = GraphSwitchCheckBranch1.Link( OEndOfSwitcha , IEndOfInitLoopSwitchIndex ) + LdefaultaEndOfSwitcha = GraphSwitchCheckBranch1_1.Link( Odefaulta , IEndOfSwitcha ) # Input datas IInitLoopSwitchIndex.Input( 0 ) @@ -201,7 +227,7 @@ def DefGraphSwitchCheckBranch1() : #OEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetOutPort( 'Index' ) #OEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetOutPort( 'Min' ) #OEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetOutPort( 'Max' ) - return GraphSwitchCheckBranch1 + return GraphSwitchCheckBranch1_1 -GraphSwitchCheckBranch1 = DefGraphSwitchCheckBranch1() +GraphSwitchCheckBranch1_1 = DefGraphSwitchCheckBranch1_1() diff --git a/examples/GraphSwitchCheckBranch1.xml b/examples/GraphSwitchCheckBranch1.xml index 98a2977..b851b50 100644 --- a/examples/GraphSwitchCheckBranch1.xml +++ b/examples/GraphSwitchCheckBranch1.xml @@ -5,11 +5,11 @@ ? ? - GraphSwitchCheckBranch1 + GraphSwitchCheckBranch1_1 1 ? -GraphSwitchCheckBranch1 +GraphSwitchCheckBranch1_1 long @@ -33,7 +33,7 @@ 13/1/2005 - 11:48:50 - 19/1/2005 - 17:18:17 + 8/3/2005 - 16:43:59 2.0 JR ? @@ -66,8 +66,8 @@ - 19/1/2005 - 17:7:48 - 19/1/2005 - 17:7:48 + 8/3/2005 - 16:43:59 + 8/3/2005 - 16:43:59 2.0 ? ? @@ -99,8 +99,8 @@ - 19/1/2005 - 17:7:48 - 19/1/2005 - 17:7:48 + 8/3/2005 - 16:43:59 + 8/3/2005 - 16:43:59 2.0 ? ? @@ -132,14 +132,14 @@ - 19/1/2005 - 17:7:48 - 19/1/2005 - 17:7:48 + 8/3/2005 - 16:43:59 + 8/3/2005 - 16:43:59 2.0 ? ? Compute Node - 604 - 149 + 529 + 177 ? ? @@ -190,8 +190,8 @@ - 19/1/2005 - 17:7:48 - 19/1/2005 - 17:7:48 + 8/3/2005 - 16:43:59 + 8/3/2005 - 16:43:59 2.0 ? ? @@ -234,14 +234,14 @@ - 19/1/2005 - 17:7:48 - 19/1/2005 - 17:7:48 + 8/3/2005 - 16:43:59 + 8/3/2005 - 16:43:59 2.0 ? ? Compute Node - 1074 - 194 + 1073 + 216 ? ? @@ -285,8 +285,8 @@ - 19/1/2005 - 17:7:48 - 19/1/2005 - 17:7:48 + 8/3/2005 - 16:43:59 + 8/3/2005 - 16:43:59 2.0 ? ? @@ -320,14 +320,46 @@ - 19/1/2005 - 17:7:48 - 19/1/2005 - 17:7:48 + 8/3/2005 - 16:43:59 + 8/3/2005 - 16:43:59 2.0 ? ? Compute Node - 882 - 194 + 880 + 216 + +? + ? + default + 3 + ? + +default + + +long + a + + +long + a + + + +default + + + + + 8/3/2005 - 16:43:59 + 8/3/2005 - 16:43:59 + 2.0 + ? + ? + Compute Node + 428 + 308 IsOdd @@ -426,6 +458,18 @@ 381 229 +Switch + a + default + a + + +382 + 377 + +382 + 228 + Switch Branch BranchNode @@ -434,6 +478,21 @@ Switch default + default + Gate + + +410 + 403 + +410 + 269 + +410 + 268 + +Switch + Default EndOfSwitch Default @@ -442,10 +501,16 @@ a EndOfInitLoopSwitch Index + + +default + a + EndOfSwitch + a -GraphSwitchCheckBranch1 +GraphSwitchCheckBranch1_1 InitLoopSwitch__Index InitLoopSwitch Index @@ -454,7 +519,7 @@ 0 -GraphSwitchCheckBranch1 +GraphSwitchCheckBranch1_1 InitLoopSwitch__Min InitLoopSwitch Min @@ -463,7 +528,7 @@ -5 -GraphSwitchCheckBranch1 +GraphSwitchCheckBranch1_1 InitLoopSwitch__Max InitLoopSwitch Max diff --git a/examples/GraphSwitchCheckBranch1Default.py b/examples/GraphSwitchCheckBranch1Default.py new file mode 100644 index 0000000..c6b7aac --- /dev/null +++ b/examples/GraphSwitchCheckBranch1Default.py @@ -0,0 +1,236 @@ + +# Generated python file of Graph GraphSwitchCheckBranch1Default + +from SuperV import * + +# Graph creation of GraphSwitchCheckBranch1Default +def DefGraphSwitchCheckBranch1Default() : + GraphSwitchCheckBranch1Default = Graph( 'GraphSwitchCheckBranch1Default' ) + GraphSwitchCheckBranch1Default.SetName( 'GraphSwitchCheckBranch1Default' ) + GraphSwitchCheckBranch1Default.SetAuthor( 'JR' ) + GraphSwitchCheckBranch1Default.SetComment( 'Switch with two SwitchBranches, One NotSwitchBranch and the DefaultBranch' ) + GraphSwitchCheckBranch1Default.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsOdd = [] + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd(a) : ' ) + PyIsOdd.append( ' print a,"IsOdd (GraphSwitch)" ' ) + PyIsOdd.append( ' sleep( 1 ) ' ) + PyIsOdd.append( ' return a ' ) + IsOdd = GraphSwitchCheckBranch1Default.INode( 'IsOdd' , PyIsOdd ) + IsOdd.SetName( 'IsOdd' ) + IsOdd.SetAuthor( '' ) + IsOdd.SetComment( 'Python function' ) + IsOdd.Coords( 415 , 7 ) + IIsOdda = IsOdd.InPort( 'a' , 'long' ) + IIsOddGate = IsOdd.GetInPort( 'Gate' ) + OIsOdda = IsOdd.OutPort( 'a' , 'long' ) + OIsOddGate = IsOdd.GetOutPort( 'Gate' ) + + PyIsEven = [] + PyIsEven.append( 'from time import * ' ) + PyIsEven.append( 'def IsEven(a) : ' ) + PyIsEven.append( ' print a,"IsEven (GraphSwitch)" ' ) + PyIsEven.append( ' sleep( 1 ) ' ) + PyIsEven.append( ' return a ' ) + IsEven = GraphSwitchCheckBranch1Default.INode( 'IsEven' , PyIsEven ) + IsEven.SetName( 'IsEven' ) + IsEven.SetAuthor( '' ) + IsEven.SetComment( 'Compute Node' ) + IsEven.Coords( 421 , 438 ) + IIsEvena = IsEven.InPort( 'a' , 'long' ) + IIsEvenGate = IsEven.GetInPort( 'Gate' ) + OIsEvena = IsEven.OutPort( 'a' , 'long' ) + OIsEvenGate = IsEven.GetOutPort( 'Gate' ) + + PyBranchNode = [] + PyBranchNode.append( 'from time import * ' ) + PyBranchNode.append( 'def Print_1(Branch) : ' ) + PyBranchNode.append( ' print "Print ",Branch ' ) + PyBranchNode.append( ' sleep(1) ' ) + PyBranchNode.append( ' return Branch ' ) + BranchNode = GraphSwitchCheckBranch1Default.INode( 'Print_1' , PyBranchNode ) + BranchNode.SetName( 'BranchNode' ) + BranchNode.SetAuthor( '' ) + BranchNode.SetComment( 'Compute Node' ) + BranchNode.Coords( 529 , 177 ) + IBranchNodeBranch = BranchNode.InPort( 'Branch' , 'string' ) + IBranchNodeGate = BranchNode.GetInPort( 'Gate' ) + OBranchNodeBranch = BranchNode.OutPort( 'Branch' , 'string' ) + OBranchNodeGate = BranchNode.GetOutPort( 'Gate' ) + + Pydefault = [] + Pydefault.append( 'from time import * ' ) + Pydefault.append( 'def default(a) : ' ) + Pydefault.append( ' sleep(1) ' ) + Pydefault.append( ' return a ' ) + default = GraphSwitchCheckBranch1Default.INode( 'default' , Pydefault ) + default.SetName( 'default' ) + default.SetAuthor( '' ) + default.SetComment( 'Compute Node' ) + default.Coords( 428 , 308 ) + Idefaulta = default.InPort( 'a' , 'long' ) + IdefaultGate = default.GetInPort( 'Gate' ) + Odefaulta = default.OutPort( 'a' , 'long' ) + OdefaultGate = default.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyInitLoopSwitch = [] + PyInitLoopSwitch.append( 'def InitLoop(Index,Min,Max) : ' ) + PyInitLoopSwitch.append( ' Index = Max ' ) + PyInitLoopSwitch.append( ' return Index,Min,Max ' ) + PyMoreInitLoopSwitch = [] + PyMoreInitLoopSwitch.append( 'from time import * ' ) + PyMoreInitLoopSwitch.append( 'def MoreLoop(Index,Min,Max) : ' ) + PyMoreInitLoopSwitch.append( ' sleep(1) ' ) + PyMoreInitLoopSwitch.append( ' if Index >= Min : ' ) + PyMoreInitLoopSwitch.append( ' DoLoop = 1 ' ) + PyMoreInitLoopSwitch.append( ' else : ' ) + PyMoreInitLoopSwitch.append( ' DoLoop = 0 ' ) + PyMoreInitLoopSwitch.append( ' return DoLoop,Index,Min,Max ' ) + PyNextInitLoopSwitch = [] + PyNextInitLoopSwitch.append( 'def NextLoop(Index,Min,Max) : ' ) + PyNextInitLoopSwitch.append( ' Index = Index - 1 ' ) + PyNextInitLoopSwitch.append( ' return Index,Min,Max ' ) + InitLoopSwitch,EndOfInitLoopSwitch = GraphSwitchCheckBranch1Default.LNode( 'InitLoop' , PyInitLoopSwitch , 'MoreLoop' , PyMoreInitLoopSwitch , 'NextLoop' , PyNextInitLoopSwitch ) + EndOfInitLoopSwitch.SetName( 'EndOfInitLoopSwitch' ) + EndOfInitLoopSwitch.SetAuthor( '' ) + EndOfInitLoopSwitch.SetComment( 'Compute Node' ) + EndOfInitLoopSwitch.Coords( 1073 , 216 ) + PyEndOfInitLoopSwitch = [] + PyEndOfInitLoopSwitch.append( 'from time import * ' ) + PyEndOfInitLoopSwitch.append( 'def EndOfInitLoopSwitch(DoLoop,Index,Min,Max) : ' ) + PyEndOfInitLoopSwitch.append( ' sleep(1) ' ) + PyEndOfInitLoopSwitch.append( ' return DoLoop,Index,Min,Max ' ) + EndOfInitLoopSwitch.SetPyFunction( 'EndOfInitLoopSwitch' , PyEndOfInitLoopSwitch ) + IInitLoopSwitchDoLoop = InitLoopSwitch.GetInPort( 'DoLoop' ) + IInitLoopSwitchIndex = InitLoopSwitch.InPort( 'Index' , 'long' ) + IInitLoopSwitchMin = InitLoopSwitch.InPort( 'Min' , 'long' ) + IInitLoopSwitchMax = InitLoopSwitch.InPort( 'Max' , 'long' ) + IInitLoopSwitchGate = InitLoopSwitch.GetInPort( 'Gate' ) + OInitLoopSwitchDoLoop = InitLoopSwitch.GetOutPort( 'DoLoop' ) + OInitLoopSwitchIndex = InitLoopSwitch.GetOutPort( 'Index' ) + OInitLoopSwitchMin = InitLoopSwitch.GetOutPort( 'Min' ) + OInitLoopSwitchMax = InitLoopSwitch.GetOutPort( 'Max' ) + IEndOfInitLoopSwitchDoLoop = EndOfInitLoopSwitch.GetInPort( 'DoLoop' ) + IEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetInPort( 'Index' ) + IEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetInPort( 'Min' ) + IEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetInPort( 'Max' ) + IEndOfInitLoopSwitchGate = EndOfInitLoopSwitch.GetInPort( 'Gate' ) + OEndOfInitLoopSwitchDoLoop = EndOfInitLoopSwitch.GetOutPort( 'DoLoop' ) + OEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetOutPort( 'Index' ) + OEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetOutPort( 'Min' ) + OEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetOutPort( 'Max' ) + OEndOfInitLoopSwitchGate = EndOfInitLoopSwitch.GetOutPort( 'Gate' ) + InitLoopSwitch.SetName( 'InitLoopSwitch' ) + InitLoopSwitch.SetAuthor( '' ) + InitLoopSwitch.SetComment( 'Compute Node' ) + InitLoopSwitch.Coords( 10 , 157 ) + + # Creation of Switch Nodes + PySwitch = [] + PySwitch.append( 'from time import * ' ) + PySwitch.append( 'def Switch(a) : ' ) + PySwitch.append( ' sleep(1) ' ) + PySwitch.append( ' Branch = "Negative or null" ' ) + PySwitch.append( ' if a <= 0 : ' ) + PySwitch.append( ' if ( a & 1 ) == 0 : ' ) + PySwitch.append( ' return 0,0,a,Branch,1 ' ) + PySwitch.append( ' else : ' ) + PySwitch.append( ' return 0,0,a,Branch,0 ' ) + PySwitch.append( ' if ( a & 1 ) == 0 : ' ) + PySwitch.append( ' Branch = "Even" ' ) + PySwitch.append( ' else : ' ) + PySwitch.append( ' Branch = "Odd" ' ) + PySwitch.append( ' return a & 1,1-(a&1),a,Branch,0 ' ) + Switch,EndOfSwitch = GraphSwitchCheckBranch1Default.SNode( 'Switch' , PySwitch ) + EndOfSwitch.SetName( 'EndOfSwitch' ) + EndOfSwitch.SetAuthor( '' ) + EndOfSwitch.SetComment( 'Compute Node' ) + EndOfSwitch.Coords( 880 , 216 ) + PyEndOfSwitch = [] + PyEndOfSwitch.append( 'from time import * ' ) + PyEndOfSwitch.append( 'def EndOfSwitch(a,Branch) : ' ) + PyEndOfSwitch.append( ' sleep(1) ' ) + PyEndOfSwitch.append( ' return a ' ) + EndOfSwitch.SetPyFunction( 'EndOfSwitch' , PyEndOfSwitch ) + IEndOfSwitcha = EndOfSwitch.InPort( 'a' , 'long' ) + IEndOfSwitchBranch = EndOfSwitch.InPort( 'Branch' , 'string' ) + IEndOfSwitchDefault = EndOfSwitch.GetInPort( 'Default' ) + OEndOfSwitcha = EndOfSwitch.OutPort( 'a' , 'long' ) + OEndOfSwitchGate = EndOfSwitch.GetOutPort( 'Gate' ) + Switch.SetName( 'Switch' ) + Switch.SetAuthor( '' ) + Switch.SetComment( 'Compute Node' ) + Switch.Coords( 194 , 157 ) + ISwitcha = Switch.InPort( 'a' , 'long' ) + ISwitchGate = Switch.GetInPort( 'Gate' ) + OSwitchOdd = Switch.OutPort( 'Odd' , 'long' ) + OSwitchEven = Switch.OutPort( 'Even' , 'int' ) + OSwitcha = Switch.OutPort( 'a' , 'int' ) + OSwitchBranch = Switch.OutPort( 'Branch' , 'string' ) + OSwitchdefault = Switch.OutPort( 'default' , 'boolean' ) + OSwitchDefault = Switch.GetOutPort( 'Default' ) + + # Creation of Links + LIsOddaEndOfSwitcha = GraphSwitchCheckBranch1Default.Link( OIsOdda , IEndOfSwitcha ) + + LIsEvenaEndOfSwitcha = GraphSwitchCheckBranch1Default.Link( OIsEvena , IEndOfSwitcha ) + + LBranchNodeBranchEndOfSwitchBranch = GraphSwitchCheckBranch1Default.Link( OBranchNodeBranch , IEndOfSwitchBranch ) + + LInitLoopSwitchIndexSwitcha = GraphSwitchCheckBranch1Default.Link( OInitLoopSwitchIndex , ISwitcha ) + + LInitLoopSwitchMinEndOfInitLoopSwitchMin = GraphSwitchCheckBranch1Default.Link( OInitLoopSwitchMin , IEndOfInitLoopSwitchMin ) + + LInitLoopSwitchMaxEndOfInitLoopSwitchMax = GraphSwitchCheckBranch1Default.Link( OInitLoopSwitchMax , IEndOfInitLoopSwitchMax ) + + LSwitchOddIsOddGate = GraphSwitchCheckBranch1Default.Link( OSwitchOdd , IIsOddGate ) + LSwitchOddIsOddGate.AddCoord( 1 , 401 , 101 ) + LSwitchOddIsOddGate.AddCoord( 2 , 401 , 188 ) + + LSwitchEvenIsEvenGate = GraphSwitchCheckBranch1Default.Link( OSwitchEven , IIsEvenGate ) + LSwitchEvenIsEvenGate.AddCoord( 1 , 392 , 533 ) + LSwitchEvenIsEvenGate.AddCoord( 2 , 392 , 208 ) + + LSwitchaIsOdda = GraphSwitchCheckBranch1Default.Link( OSwitcha , IIsOdda ) + LSwitchaIsOdda.AddCoord( 1 , 382 , 78 ) + LSwitchaIsOdda.AddCoord( 2 , 382 , 229 ) + + LSwitchaIsEvena = GraphSwitchCheckBranch1Default.Link( OSwitcha , IIsEvena ) + LSwitchaIsEvena.AddCoord( 1 , 381 , 509 ) + LSwitchaIsEvena.AddCoord( 2 , 381 , 229 ) + + LSwitchadefaulta = GraphSwitchCheckBranch1Default.Link( OSwitcha , Idefaulta ) + LSwitchadefaulta.AddCoord( 1 , 382 , 377 ) + LSwitchadefaulta.AddCoord( 2 , 382 , 228 ) + + LSwitchBranchBranchNodeBranch = GraphSwitchCheckBranch1Default.Link( OSwitchBranch , IBranchNodeBranch ) + + LSwitchdefaultdefaultGate = GraphSwitchCheckBranch1Default.Link( OSwitchdefault , IdefaultGate ) + LSwitchdefaultdefaultGate.AddCoord( 1 , 410 , 403 ) + LSwitchdefaultdefaultGate.AddCoord( 2 , 410 , 269 ) + LSwitchdefaultdefaultGate.AddCoord( 3 , 410 , 268 ) + + LSwitchDefaultEndOfSwitchDefault = GraphSwitchCheckBranch1Default.Link( OSwitchDefault , IEndOfSwitchDefault ) + + LEndOfSwitchaEndOfInitLoopSwitchIndex = GraphSwitchCheckBranch1Default.Link( OEndOfSwitcha , IEndOfInitLoopSwitchIndex ) + + LdefaultaEndOfSwitcha = GraphSwitchCheckBranch1Default.Link( Odefaulta , IEndOfSwitcha ) + + # Input datas + IInitLoopSwitchIndex.Input( 0 ) + IInitLoopSwitchMin.Input( -5 ) + IInitLoopSwitchMax.Input( 10 ) + + # Output Ports of the graph + #OEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetOutPort( 'Index' ) + #OEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetOutPort( 'Min' ) + #OEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetOutPort( 'Max' ) + return GraphSwitchCheckBranch1Default + + +GraphSwitchCheckBranch1Default = DefGraphSwitchCheckBranch1Default() diff --git a/examples/GraphSwitchCheckBranch1Default.xml b/examples/GraphSwitchCheckBranch1Default.xml new file mode 100644 index 0000000..106bb26 --- /dev/null +++ b/examples/GraphSwitchCheckBranch1Default.xml @@ -0,0 +1,541 @@ + + + + + +? + ? + GraphSwitchCheckBranch1Default + 1 + ? + +GraphSwitchCheckBranch1Default + + +long + InitLoopSwitch__Index + +long + InitLoopSwitch__Min + +long + InitLoopSwitch__Max + + +long + EndOfInitLoopSwitch__Index + +long + EndOfInitLoopSwitch__Min + +long + EndOfInitLoopSwitch__Max + + + 13/1/2005 - 11:48:50 + 8/7/2005 - 14:42:28 + 2.0 + JR + ? + Switch with two SwitchBranches, One NotSwitchBranch and the DefaultBranch + 0 + 0 + + +? + ? + IsOdd + 3 + ? + +IsOdd + + +long + a + + +long + a + + + +IsOdd + + + + + + 8/7/2005 - 14:41:7 + 8/7/2005 - 14:41:7 + 2.0 + ? + ? + Python function + 415 + 7 + +? + ? + IsEven + 3 + ? + +IsEven + + +long + a + + +long + a + + + +IsEven + + + + + + 8/7/2005 - 14:41:7 + 8/7/2005 - 14:41:7 + 2.0 + ? + ? + Compute Node + 421 + 438 + +? + ? + BranchNode + 3 + ? + +BranchNode + + +string + Branch + + +string + Branch + + + +Print_1 + + + + + + 8/7/2005 - 14:41:7 + 8/7/2005 - 14:41:7 + 2.0 + ? + ? + Compute Node + 529 + 177 + +? + ? + InitLoopSwitch + 4 + EndOfInitLoopSwitch + +InitLoopSwitch + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +InitLoop + + + + +MoreLoop + + + + = Min : ]]> + + + + + +NextLoop + + + + 8/7/2005 - 14:41:7 + 8/7/2005 - 14:41:7 + 2.0 + ? + ? + Compute Node + 10 + 157 + +? + ? + EndOfInitLoopSwitch + 5 + InitLoopSwitch + +EndOfInitLoopSwitch + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +EndOfInitLoopSwitch + + + + + 8/7/2005 - 14:41:7 + 8/7/2005 - 14:41:7 + 2.0 + ? + ? + Compute Node + 1073 + 216 + +? + ? + Switch + 6 + EndOfSwitch + +Switch + + +long + a + + +long + Odd + +int + Even + +int + a + +string + Branch + +boolean + default + + + +Switch + + + + + + + + + + + + + + + 8/7/2005 - 14:41:7 + 8/7/2005 - 14:41:7 + 2.0 + ? + ? + Compute Node + 194 + 157 + +? + ? + EndOfSwitch + 7 + Switch + +EndOfSwitch + + +long + a + +string + Branch + + +long + a + + + +EndOfSwitch + + + + + 8/7/2005 - 14:41:7 + 8/7/2005 - 14:41:7 + 2.0 + ? + ? + Compute Node + 880 + 216 + +? + ? + default + 3 + ? + +default + + +long + a + + +long + a + + + +default + + + + + 8/7/2005 - 14:41:7 + 8/7/2005 - 14:41:7 + 2.0 + ? + ? + Compute Node + 428 + 308 + + +IsOdd + a + EndOfSwitch + a + + +IsEven + a + EndOfSwitch + a + + +BranchNode + Branch + EndOfSwitch + Branch + + +InitLoopSwitch + DoLoop + EndOfInitLoopSwitch + DoLoop + + +InitLoopSwitch + Index + Switch + a + + +InitLoopSwitch + Min + EndOfInitLoopSwitch + Min + + +InitLoopSwitch + Max + EndOfInitLoopSwitch + Max + + +EndOfInitLoopSwitch + DoLoop + InitLoopSwitch + DoLoop + + +Switch + Odd + IsOdd + Gate + + +401 + 101 + +401 + 188 + +Switch + Even + IsEven + Gate + + +392 + 533 + +392 + 208 + +Switch + a + IsOdd + a + + +382 + 78 + +382 + 229 + +Switch + a + IsEven + a + + +381 + 509 + +381 + 229 + +Switch + a + default + a + + +382 + 377 + +382 + 228 + +Switch + Branch + BranchNode + Branch + + +Switch + default + default + Gate + + +410 + 403 + +410 + 269 + +410 + 268 + +Switch + Default + EndOfSwitch + Default + + +EndOfSwitch + a + EndOfInitLoopSwitch + Index + + +default + a + EndOfSwitch + a + + + +GraphSwitchCheckBranch1Default + InitLoopSwitch__Index + InitLoopSwitch + Index + +3 + 0 + + +GraphSwitchCheckBranch1Default + InitLoopSwitch__Min + InitLoopSwitch + Min + +3 + -5 + + +GraphSwitchCheckBranch1Default + InitLoopSwitch__Max + InitLoopSwitch + Max + +3 + 10 + diff --git a/examples/GraphSwitchCheckBranch1NoDefault.py b/examples/GraphSwitchCheckBranch1NoDefault.py new file mode 100644 index 0000000..ad682c6 --- /dev/null +++ b/examples/GraphSwitchCheckBranch1NoDefault.py @@ -0,0 +1,231 @@ + +# Generated python file of Graph GraphSwitchCheckBranch1NoDefault + +from SuperV import * + +# Graph creation of GraphSwitchCheckBranch1NoDefault +def DefGraphSwitchCheckBranch1NoDefault() : + GraphSwitchCheckBranch1NoDefault = Graph( 'GraphSwitchCheckBranch1NoDefault' ) + GraphSwitchCheckBranch1NoDefault.SetName( 'GraphSwitchCheckBranch1NoDefault' ) + GraphSwitchCheckBranch1NoDefault.SetAuthor( 'JR' ) + GraphSwitchCheckBranch1NoDefault.SetComment( 'Switch with two SwitchBranches, One NotSwitchBranch and the DefaultBranch' ) + GraphSwitchCheckBranch1NoDefault.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsOdd = [] + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd(a) : ' ) + PyIsOdd.append( ' print a,"IsOdd (GraphSwitch)" ' ) + PyIsOdd.append( ' sleep( 1 ) ' ) + PyIsOdd.append( ' return a ' ) + IsOdd = GraphSwitchCheckBranch1NoDefault.INode( 'IsOdd' , PyIsOdd ) + IsOdd.SetName( 'IsOdd' ) + IsOdd.SetAuthor( '' ) + IsOdd.SetComment( 'Python function' ) + IsOdd.Coords( 415 , 7 ) + IIsOdda = IsOdd.InPort( 'a' , 'long' ) + IIsOddGate = IsOdd.GetInPort( 'Gate' ) + OIsOdda = IsOdd.OutPort( 'a' , 'long' ) + OIsOddGate = IsOdd.GetOutPort( 'Gate' ) + + PyIsEven = [] + PyIsEven.append( 'from time import * ' ) + PyIsEven.append( 'def IsEven(a) : ' ) + PyIsEven.append( ' print a,"IsEven (GraphSwitch)" ' ) + PyIsEven.append( ' sleep( 1 ) ' ) + PyIsEven.append( ' return a ' ) + IsEven = GraphSwitchCheckBranch1NoDefault.INode( 'IsEven' , PyIsEven ) + IsEven.SetName( 'IsEven' ) + IsEven.SetAuthor( '' ) + IsEven.SetComment( 'Compute Node' ) + IsEven.Coords( 421 , 438 ) + IIsEvena = IsEven.InPort( 'a' , 'long' ) + IIsEvenGate = IsEven.GetInPort( 'Gate' ) + OIsEvena = IsEven.OutPort( 'a' , 'long' ) + OIsEvenGate = IsEven.GetOutPort( 'Gate' ) + + PyBranchNode = [] + PyBranchNode.append( 'from time import * ' ) + PyBranchNode.append( 'def Print_1(Branch) : ' ) + PyBranchNode.append( ' print "Print ",Branch ' ) + PyBranchNode.append( ' sleep(1) ' ) + PyBranchNode.append( ' return Branch ' ) + BranchNode = GraphSwitchCheckBranch1NoDefault.INode( 'Print_1' , PyBranchNode ) + BranchNode.SetName( 'BranchNode' ) + BranchNode.SetAuthor( '' ) + BranchNode.SetComment( 'Compute Node' ) + BranchNode.Coords( 529 , 177 ) + IBranchNodeBranch = BranchNode.InPort( 'Branch' , 'string' ) + IBranchNodeGate = BranchNode.GetInPort( 'Gate' ) + OBranchNodeBranch = BranchNode.OutPort( 'Branch' , 'string' ) + OBranchNodeGate = BranchNode.GetOutPort( 'Gate' ) + + Pydefault = [] + Pydefault.append( 'from time import * ' ) + Pydefault.append( 'def default(a) : ' ) + Pydefault.append( ' sleep(1) ' ) + Pydefault.append( ' return a ' ) + default = GraphSwitchCheckBranch1NoDefault.INode( 'default' , Pydefault ) + default.SetName( 'default' ) + default.SetAuthor( '' ) + default.SetComment( 'Compute Node' ) + default.Coords( 428 , 308 ) + Idefaulta = default.InPort( 'a' , 'long' ) + IdefaultGate = default.GetInPort( 'Gate' ) + Odefaulta = default.OutPort( 'a' , 'long' ) + OdefaultGate = default.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyInitLoopSwitch = [] + PyInitLoopSwitch.append( 'def InitLoop(Index,Min,Max) : ' ) + PyInitLoopSwitch.append( ' Index = Max ' ) + PyInitLoopSwitch.append( ' return Index,Min,Max ' ) + PyMoreInitLoopSwitch = [] + PyMoreInitLoopSwitch.append( 'from time import * ' ) + PyMoreInitLoopSwitch.append( 'def MoreLoop(Index,Min,Max) : ' ) + PyMoreInitLoopSwitch.append( ' sleep(1) ' ) + PyMoreInitLoopSwitch.append( ' if Index >= Min : ' ) + PyMoreInitLoopSwitch.append( ' DoLoop = 1 ' ) + PyMoreInitLoopSwitch.append( ' else : ' ) + PyMoreInitLoopSwitch.append( ' DoLoop = 0 ' ) + PyMoreInitLoopSwitch.append( ' return DoLoop,Index,Min,Max ' ) + PyNextInitLoopSwitch = [] + PyNextInitLoopSwitch.append( 'def NextLoop(Index,Min,Max) : ' ) + PyNextInitLoopSwitch.append( ' Index = Index - 1 ' ) + PyNextInitLoopSwitch.append( ' return Index,Min,Max ' ) + InitLoopSwitch,EndOfInitLoopSwitch = GraphSwitchCheckBranch1NoDefault.LNode( 'InitLoop' , PyInitLoopSwitch , 'MoreLoop' , PyMoreInitLoopSwitch , 'NextLoop' , PyNextInitLoopSwitch ) + EndOfInitLoopSwitch.SetName( 'EndOfInitLoopSwitch' ) + EndOfInitLoopSwitch.SetAuthor( '' ) + EndOfInitLoopSwitch.SetComment( 'Compute Node' ) + EndOfInitLoopSwitch.Coords( 1073 , 216 ) + PyEndOfInitLoopSwitch = [] + PyEndOfInitLoopSwitch.append( 'from time import * ' ) + PyEndOfInitLoopSwitch.append( 'def EndOfInitLoopSwitch(DoLoop,Index,Min,Max) : ' ) + PyEndOfInitLoopSwitch.append( ' sleep(1) ' ) + PyEndOfInitLoopSwitch.append( ' return DoLoop,Index,Min,Max ' ) + EndOfInitLoopSwitch.SetPyFunction( 'EndOfInitLoopSwitch' , PyEndOfInitLoopSwitch ) + IInitLoopSwitchDoLoop = InitLoopSwitch.GetInPort( 'DoLoop' ) + IInitLoopSwitchIndex = InitLoopSwitch.InPort( 'Index' , 'long' ) + IInitLoopSwitchMin = InitLoopSwitch.InPort( 'Min' , 'long' ) + IInitLoopSwitchMax = InitLoopSwitch.InPort( 'Max' , 'long' ) + IInitLoopSwitchGate = InitLoopSwitch.GetInPort( 'Gate' ) + OInitLoopSwitchDoLoop = InitLoopSwitch.GetOutPort( 'DoLoop' ) + OInitLoopSwitchIndex = InitLoopSwitch.GetOutPort( 'Index' ) + OInitLoopSwitchMin = InitLoopSwitch.GetOutPort( 'Min' ) + OInitLoopSwitchMax = InitLoopSwitch.GetOutPort( 'Max' ) + IEndOfInitLoopSwitchDoLoop = EndOfInitLoopSwitch.GetInPort( 'DoLoop' ) + IEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetInPort( 'Index' ) + IEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetInPort( 'Min' ) + IEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetInPort( 'Max' ) + IEndOfInitLoopSwitchGate = EndOfInitLoopSwitch.GetInPort( 'Gate' ) + OEndOfInitLoopSwitchDoLoop = EndOfInitLoopSwitch.GetOutPort( 'DoLoop' ) + OEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetOutPort( 'Index' ) + OEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetOutPort( 'Min' ) + OEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetOutPort( 'Max' ) + OEndOfInitLoopSwitchGate = EndOfInitLoopSwitch.GetOutPort( 'Gate' ) + InitLoopSwitch.SetName( 'InitLoopSwitch' ) + InitLoopSwitch.SetAuthor( '' ) + InitLoopSwitch.SetComment( 'Compute Node' ) + InitLoopSwitch.Coords( 10 , 157 ) + + # Creation of Switch Nodes + PySwitch = [] + PySwitch.append( 'from time import * ' ) + PySwitch.append( 'def Switch(a) : ' ) + PySwitch.append( ' sleep(1) ' ) + PySwitch.append( ' Branch = "Negative or null" ' ) + PySwitch.append( ' if a <= 0 : ' ) + PySwitch.append( ' return 0,0,a,Branch,1 ' ) + PySwitch.append( ' if ( a & 1 ) == 0 : ' ) + PySwitch.append( ' Branch = "Even" ' ) + PySwitch.append( ' else : ' ) + PySwitch.append( ' Branch = "Odd" ' ) + PySwitch.append( ' return a & 1,1-(a&1),a,Branch,0 ' ) + Switch,EndOfSwitch = GraphSwitchCheckBranch1NoDefault.SNode( 'Switch' , PySwitch ) + EndOfSwitch.SetName( 'EndOfSwitch' ) + EndOfSwitch.SetAuthor( '' ) + EndOfSwitch.SetComment( 'Compute Node' ) + EndOfSwitch.Coords( 880 , 216 ) + PyEndOfSwitch = [] + PyEndOfSwitch.append( 'from time import * ' ) + PyEndOfSwitch.append( 'def EndOfSwitch(a,Branch) : ' ) + PyEndOfSwitch.append( ' sleep(1) ' ) + PyEndOfSwitch.append( ' return a ' ) + EndOfSwitch.SetPyFunction( 'EndOfSwitch' , PyEndOfSwitch ) + IEndOfSwitcha = EndOfSwitch.InPort( 'a' , 'long' ) + IEndOfSwitchBranch = EndOfSwitch.InPort( 'Branch' , 'string' ) + IEndOfSwitchDefault = EndOfSwitch.GetInPort( 'Default' ) + OEndOfSwitcha = EndOfSwitch.OutPort( 'a' , 'long' ) + OEndOfSwitchGate = EndOfSwitch.GetOutPort( 'Gate' ) + Switch.SetName( 'Switch' ) + Switch.SetAuthor( '' ) + Switch.SetComment( 'Compute Node' ) + Switch.Coords( 194 , 157 ) + ISwitcha = Switch.InPort( 'a' , 'long' ) + ISwitchGate = Switch.GetInPort( 'Gate' ) + OSwitchOdd = Switch.OutPort( 'Odd' , 'long' ) + OSwitchEven = Switch.OutPort( 'Even' , 'int' ) + OSwitcha = Switch.OutPort( 'a' , 'int' ) + OSwitchBranch = Switch.OutPort( 'Branch' , 'string' ) + OSwitchdefault = Switch.OutPort( 'default' , 'boolean' ) + OSwitchDefault = Switch.GetOutPort( 'Default' ) + + # Creation of Links + LIsOddaEndOfSwitcha = GraphSwitchCheckBranch1NoDefault.Link( OIsOdda , IEndOfSwitcha ) + + LIsEvenaEndOfSwitcha = GraphSwitchCheckBranch1NoDefault.Link( OIsEvena , IEndOfSwitcha ) + + LBranchNodeBranchEndOfSwitchBranch = GraphSwitchCheckBranch1NoDefault.Link( OBranchNodeBranch , IEndOfSwitchBranch ) + + LInitLoopSwitchIndexSwitcha = GraphSwitchCheckBranch1NoDefault.Link( OInitLoopSwitchIndex , ISwitcha ) + + LInitLoopSwitchMinEndOfInitLoopSwitchMin = GraphSwitchCheckBranch1NoDefault.Link( OInitLoopSwitchMin , IEndOfInitLoopSwitchMin ) + + LInitLoopSwitchMaxEndOfInitLoopSwitchMax = GraphSwitchCheckBranch1NoDefault.Link( OInitLoopSwitchMax , IEndOfInitLoopSwitchMax ) + + LSwitchOddIsOddGate = GraphSwitchCheckBranch1NoDefault.Link( OSwitchOdd , IIsOddGate ) + LSwitchOddIsOddGate.AddCoord( 1 , 401 , 101 ) + LSwitchOddIsOddGate.AddCoord( 2 , 401 , 188 ) + + LSwitchEvenIsEvenGate = GraphSwitchCheckBranch1NoDefault.Link( OSwitchEven , IIsEvenGate ) + LSwitchEvenIsEvenGate.AddCoord( 1 , 392 , 533 ) + LSwitchEvenIsEvenGate.AddCoord( 2 , 392 , 208 ) + + LSwitchaIsOdda = GraphSwitchCheckBranch1NoDefault.Link( OSwitcha , IIsOdda ) + LSwitchaIsOdda.AddCoord( 1 , 382 , 78 ) + LSwitchaIsOdda.AddCoord( 2 , 382 , 229 ) + + LSwitchaIsEvena = GraphSwitchCheckBranch1NoDefault.Link( OSwitcha , IIsEvena ) + LSwitchaIsEvena.AddCoord( 1 , 381 , 509 ) + LSwitchaIsEvena.AddCoord( 2 , 381 , 229 ) + + LSwitchadefaulta = GraphSwitchCheckBranch1NoDefault.Link( OSwitcha , Idefaulta ) + LSwitchadefaulta.AddCoord( 1 , 382 , 377 ) + LSwitchadefaulta.AddCoord( 2 , 382 , 228 ) + + LSwitchBranchBranchNodeBranch = GraphSwitchCheckBranch1NoDefault.Link( OSwitchBranch , IBranchNodeBranch ) + + LSwitchdefaultdefaultGate = GraphSwitchCheckBranch1NoDefault.Link( OSwitchdefault , IdefaultGate ) + LSwitchdefaultdefaultGate.AddCoord( 1 , 410 , 403 ) + LSwitchdefaultdefaultGate.AddCoord( 2 , 410 , 269 ) + LSwitchdefaultdefaultGate.AddCoord( 3 , 410 , 268 ) + + LEndOfSwitchaEndOfInitLoopSwitchIndex = GraphSwitchCheckBranch1NoDefault.Link( OEndOfSwitcha , IEndOfInitLoopSwitchIndex ) + + LdefaultaEndOfSwitcha = GraphSwitchCheckBranch1NoDefault.Link( Odefaulta , IEndOfSwitcha ) + + # Input datas + IInitLoopSwitchIndex.Input( 0 ) + IInitLoopSwitchMin.Input( -5 ) + IInitLoopSwitchMax.Input( 10 ) + + # Output Ports of the graph + #OEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetOutPort( 'Index' ) + #OEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetOutPort( 'Min' ) + #OEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetOutPort( 'Max' ) + return GraphSwitchCheckBranch1NoDefault + + +GraphSwitchCheckBranch1NoDefault = DefGraphSwitchCheckBranch1NoDefault() diff --git a/examples/GraphSwitchCheckBranch1NoDefault.xml b/examples/GraphSwitchCheckBranch1NoDefault.xml new file mode 100644 index 0000000..dbc5326 --- /dev/null +++ b/examples/GraphSwitchCheckBranch1NoDefault.xml @@ -0,0 +1,532 @@ + + + + + +? + ? + GraphSwitchCheckBranch1NoDefault + 1 + ? + +GraphSwitchCheckBranch1 + + +long + InitLoopSwitch__Index + +long + InitLoopSwitch__Min + +long + InitLoopSwitch__Max + + +long + EndOfInitLoopSwitch__Index + +long + EndOfInitLoopSwitch__Min + +long + EndOfInitLoopSwitch__Max + + + 13/1/2005 - 11:48:50 + 14/2/2005 - 11:39:30 + 2.0 + JR + ? + Switch with two SwitchBranches, One NotSwitchBranch and the DefaultBranch + 0 + 0 + + +? + ? + IsOdd + 3 + ? + +IsOdd + + +long + a + + +long + a + + + +IsOdd + + + + + + 14/2/2005 - 11:36:28 + 14/2/2005 - 11:36:28 + 2.0 + ? + ? + Python function + 415 + 7 + +? + ? + IsEven + 3 + ? + +IsEven + + +long + a + + +long + a + + + +IsEven + + + + + + 14/2/2005 - 11:36:28 + 14/2/2005 - 11:36:28 + 2.0 + ? + ? + Compute Node + 421 + 438 + +? + ? + BranchNode + 3 + ? + +BranchNode + + +string + Branch + + +string + Branch + + + +Print_1 + + + + + + 14/2/2005 - 11:36:28 + 14/2/2005 - 11:36:28 + 2.0 + ? + ? + Compute Node + 529 + 177 + +? + ? + InitLoopSwitch + 4 + EndOfInitLoopSwitch + +InitLoopSwitch + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +InitLoop + + + + +MoreLoop + + + + = Min : ]]> + + + + + +NextLoop + + + + 14/2/2005 - 11:36:28 + 14/2/2005 - 11:36:28 + 2.0 + ? + ? + Compute Node + 10 + 157 + +? + ? + EndOfInitLoopSwitch + 5 + InitLoopSwitch + +EndOfInitLoopSwitch + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +EndOfInitLoopSwitch + + + + + 14/2/2005 - 11:36:28 + 14/2/2005 - 11:36:28 + 2.0 + ? + ? + Compute Node + 1073 + 216 + +? + ? + Switch + 6 + EndOfSwitch + +Switch + + +long + a + + +long + Odd + +int + Even + +int + a + +string + Branch + +boolean + default + + + +Switch + + + + + + + + + + + + 14/2/2005 - 11:36:28 + 14/2/2005 - 11:36:28 + 2.0 + ? + ? + Compute Node + 194 + 157 + +? + ? + EndOfSwitch + 7 + Switch + +EndOfSwitch + + +long + a + +string + Branch + + +long + a + + + +EndOfSwitch + + + + + 14/2/2005 - 11:36:28 + 14/2/2005 - 11:36:28 + 2.0 + ? + ? + Compute Node + 880 + 216 + +? + ? + default + 3 + ? + +default + + +long + a + + +long + a + + + +default + + + + + 14/2/2005 - 11:36:28 + 14/2/2005 - 11:36:28 + 2.0 + ? + ? + Compute Node + 428 + 308 + + +IsOdd + a + EndOfSwitch + a + + +IsEven + a + EndOfSwitch + a + + +BranchNode + Branch + EndOfSwitch + Branch + + +InitLoopSwitch + DoLoop + EndOfInitLoopSwitch + DoLoop + + +InitLoopSwitch + Index + Switch + a + + +InitLoopSwitch + Min + EndOfInitLoopSwitch + Min + + +InitLoopSwitch + Max + EndOfInitLoopSwitch + Max + + +EndOfInitLoopSwitch + DoLoop + InitLoopSwitch + DoLoop + + +Switch + Odd + IsOdd + Gate + + +401 + 101 + +401 + 188 + +Switch + Even + IsEven + Gate + + +392 + 533 + +392 + 208 + +Switch + a + IsOdd + a + + +382 + 78 + +382 + 229 + +Switch + a + IsEven + a + + +381 + 509 + +381 + 229 + +Switch + a + default + a + + +382 + 377 + +382 + 228 + +Switch + Branch + BranchNode + Branch + + +Switch + default + default + Gate + + +410 + 403 + +410 + 269 + +410 + 268 + +EndOfSwitch + a + EndOfInitLoopSwitch + Index + + +default + a + EndOfSwitch + a + + + +GraphSwitchCheckBranch1NoDefault + InitLoopSwitch__Index + InitLoopSwitch + Index + +3 + 0 + + +GraphSwitchCheckBranch1NoDefault + InitLoopSwitch__Min + InitLoopSwitch + Min + +3 + -5 + + +GraphSwitchCheckBranch1NoDefault + InitLoopSwitch__Max + InitLoopSwitch + Max + +3 + 10 + diff --git a/examples/GraphSwitchCheckBranch2NOTValid.py b/examples/GraphSwitchCheckBranch2NOTValid.py new file mode 100644 index 0000000..ee9fb64 --- /dev/null +++ b/examples/GraphSwitchCheckBranch2NOTValid.py @@ -0,0 +1,237 @@ + +# Generated python file of Graph GraphSwitchCheckBranch2NOTValid + +from SuperV import * + +# Graph creation of GraphSwitchCheckBranch2NOTValid +def DefGraphSwitchCheckBranch2NOTValid() : + GraphSwitchCheckBranch2NOTValid = Graph( 'GraphSwitchCheckBranch2NOTValid' ) + GraphSwitchCheckBranch2NOTValid.SetName( 'GraphSwitchCheckBranch2NOTValid' ) + GraphSwitchCheckBranch2NOTValid.SetAuthor( 'JR' ) + GraphSwitchCheckBranch2NOTValid.SetComment( 'Switch with two SwitchBranches, One NotSwitchBranch and the DefaultBranch +Shared Node between Branches' ) + GraphSwitchCheckBranch2NOTValid.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsOdd = [] + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd(aBranch) : ' ) + PyIsOdd.append( ' print a,"IsOdd (GraphSwitch)" ' ) + PyIsOdd.append( ' sleep( 1 ) ' ) + PyIsOdd.append( ' return a ' ) + IsOdd = GraphSwitchCheckBranch2NOTValid.INode( 'IsOdd' , PyIsOdd ) + IsOdd.SetName( 'IsOdd' ) + IsOdd.SetAuthor( '' ) + IsOdd.SetComment( 'Python function' ) + IsOdd.Coords( 649 , 6 ) + IIsOdda = IsOdd.InPort( 'a' , 'long' ) + IIsOddBranch = IsOdd.InPort( 'Branch' , 'string' ) + IIsOddGate = IsOdd.GetInPort( 'Gate' ) + OIsOdda = IsOdd.OutPort( 'a' , 'long' ) + OIsOddGate = IsOdd.GetOutPort( 'Gate' ) + + PyIsEven = [] + PyIsEven.append( 'from time import * ' ) + PyIsEven.append( 'def IsEven(aBranch) : ' ) + PyIsEven.append( ' print a,"IsEven (GraphSwitch)" ' ) + PyIsEven.append( ' sleep( 1 ) ' ) + PyIsEven.append( ' return a ' ) + IsEven = GraphSwitchCheckBranch2NOTValid.INode( 'IsEven' , PyIsEven ) + IsEven.SetName( 'IsEven' ) + IsEven.SetAuthor( '' ) + IsEven.SetComment( 'Compute Node' ) + IsEven.Coords( 657 , 451 ) + IIsEvena = IsEven.InPort( 'a' , 'long' ) + IIsEvenBranch = IsEven.InPort( 'Branch' , 'string' ) + IIsEvenGate = IsEven.GetInPort( 'Gate' ) + OIsEvena = IsEven.OutPort( 'a' , 'long' ) + OIsEvenGate = IsEven.GetOutPort( 'Gate' ) + + PyBranchNode = [] + PyBranchNode.append( 'from time import * ' ) + PyBranchNode.append( 'def Print_1(Branch) : ' ) + PyBranchNode.append( ' print "Print ",Branch ' ) + PyBranchNode.append( ' sleep(1) ' ) + PyBranchNode.append( ' return Branch ' ) + BranchNode = GraphSwitchCheckBranch2NOTValid.INode( 'Print_1' , PyBranchNode ) + BranchNode.SetName( 'BranchNode' ) + BranchNode.SetAuthor( '' ) + BranchNode.SetComment( 'Compute Node' ) + BranchNode.Coords( 429 , 177 ) + IBranchNodeBranch = BranchNode.InPort( 'Branch' , 'string' ) + IBranchNodeGate = BranchNode.GetInPort( 'Gate' ) + OBranchNodeBranch = BranchNode.OutPort( 'Branch' , 'string' ) + OBranchNodeGate = BranchNode.GetOutPort( 'Gate' ) + + Pydefault = [] + Pydefault.append( 'from time import * ' ) + Pydefault.append( 'def default(a,Branch) : ' ) + Pydefault.append( ' sleep(1) ' ) + Pydefault.append( ' return a ' ) + default = GraphSwitchCheckBranch2NOTValid.INode( 'default' , Pydefault ) + default.SetName( 'default' ) + default.SetAuthor( '' ) + default.SetComment( 'Compute Node' ) + default.Coords( 655 , 306 ) + Idefaulta = default.InPort( 'a' , 'long' ) + IdefaultBranch = default.InPort( 'Branch' , 'string' ) + IdefaultGate = default.GetInPort( 'Gate' ) + Odefaulta = default.OutPort( 'a' , 'long' ) + OdefaultGate = default.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyInitLoopSwitch = [] + PyInitLoopSwitch.append( 'def InitLoop(Index,Min,Max) : ' ) + PyInitLoopSwitch.append( ' Index = Max ' ) + PyInitLoopSwitch.append( ' return Index,Min,Max ' ) + PyMoreInitLoopSwitch = [] + PyMoreInitLoopSwitch.append( 'from time import * ' ) + PyMoreInitLoopSwitch.append( 'def MoreLoop(Index,Min,Max) : ' ) + PyMoreInitLoopSwitch.append( ' sleep(1) ' ) + PyMoreInitLoopSwitch.append( ' if Index >= Min : ' ) + PyMoreInitLoopSwitch.append( ' DoLoop = 1 ' ) + PyMoreInitLoopSwitch.append( ' else : ' ) + PyMoreInitLoopSwitch.append( ' DoLoop = 0 ' ) + PyMoreInitLoopSwitch.append( ' return DoLoop,Index,Min,Max ' ) + PyNextInitLoopSwitch = [] + PyNextInitLoopSwitch.append( 'def NextLoop(Index,Min,Max) : ' ) + PyNextInitLoopSwitch.append( ' Index = Index - 1 ' ) + PyNextInitLoopSwitch.append( ' return Index,Min,Max ' ) + InitLoopSwitch,EndOfInitLoopSwitch = GraphSwitchCheckBranch2NOTValid.LNode( 'InitLoop' , PyInitLoopSwitch , 'MoreLoop' , PyMoreInitLoopSwitch , 'NextLoop' , PyNextInitLoopSwitch ) + EndOfInitLoopSwitch.SetName( 'EndOfInitLoopSwitch' ) + EndOfInitLoopSwitch.SetAuthor( '' ) + EndOfInitLoopSwitch.SetComment( 'Compute Node' ) + EndOfInitLoopSwitch.Coords( 1073 , 216 ) + PyEndOfInitLoopSwitch = [] + PyEndOfInitLoopSwitch.append( 'from time import * ' ) + PyEndOfInitLoopSwitch.append( 'def EndOfInitLoopSwitch(DoLoop,Index,Min,Max) : ' ) + PyEndOfInitLoopSwitch.append( ' sleep(1) ' ) + PyEndOfInitLoopSwitch.append( ' return DoLoop,Index,Min,Max ' ) + EndOfInitLoopSwitch.SetPyFunction( 'EndOfInitLoopSwitch' , PyEndOfInitLoopSwitch ) + IInitLoopSwitchDoLoop = InitLoopSwitch.GetInPort( 'DoLoop' ) + IInitLoopSwitchIndex = InitLoopSwitch.InPort( 'Index' , 'long' ) + IInitLoopSwitchMin = InitLoopSwitch.InPort( 'Min' , 'long' ) + IInitLoopSwitchMax = InitLoopSwitch.InPort( 'Max' , 'long' ) + IInitLoopSwitchGate = InitLoopSwitch.GetInPort( 'Gate' ) + OInitLoopSwitchDoLoop = InitLoopSwitch.GetOutPort( 'DoLoop' ) + OInitLoopSwitchIndex = InitLoopSwitch.GetOutPort( 'Index' ) + OInitLoopSwitchMin = InitLoopSwitch.GetOutPort( 'Min' ) + OInitLoopSwitchMax = InitLoopSwitch.GetOutPort( 'Max' ) + IEndOfInitLoopSwitchDoLoop = EndOfInitLoopSwitch.GetInPort( 'DoLoop' ) + IEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetInPort( 'Index' ) + IEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetInPort( 'Min' ) + IEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetInPort( 'Max' ) + IEndOfInitLoopSwitchGate = EndOfInitLoopSwitch.GetInPort( 'Gate' ) + OEndOfInitLoopSwitchDoLoop = EndOfInitLoopSwitch.GetOutPort( 'DoLoop' ) + OEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetOutPort( 'Index' ) + OEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetOutPort( 'Min' ) + OEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetOutPort( 'Max' ) + OEndOfInitLoopSwitchGate = EndOfInitLoopSwitch.GetOutPort( 'Gate' ) + InitLoopSwitch.SetName( 'InitLoopSwitch' ) + InitLoopSwitch.SetAuthor( '' ) + InitLoopSwitch.SetComment( 'Compute Node' ) + InitLoopSwitch.Coords( 10 , 157 ) + + # Creation of Switch Nodes + PySwitch = [] + PySwitch.append( 'from time import * ' ) + PySwitch.append( 'def Switch(a) : ' ) + PySwitch.append( ' sleep(1) ' ) + PySwitch.append( ' Branch = "Negative or null" ' ) + PySwitch.append( ' if a <= 0 : ' ) + PySwitch.append( ' return 0,0,a,Branch,1 ' ) + PySwitch.append( ' if ( a & 1 ) == 0 : ' ) + PySwitch.append( ' Branch = "Even" ' ) + PySwitch.append( ' else : ' ) + PySwitch.append( ' Branch = "Odd" ' ) + PySwitch.append( ' return a & 1,1-(a&1),a,Branch,0 ' ) + Switch,EndOfSwitch = GraphSwitchCheckBranch2NOTValid.SNode( 'Switch' , PySwitch ) + EndOfSwitch.SetName( 'EndOfSwitch' ) + EndOfSwitch.SetAuthor( '' ) + EndOfSwitch.SetComment( 'Compute Node' ) + EndOfSwitch.Coords( 880 , 216 ) + PyEndOfSwitch = [] + PyEndOfSwitch.append( 'from time import * ' ) + PyEndOfSwitch.append( 'def EndOfSwitch(a,Branch) : ' ) + PyEndOfSwitch.append( ' sleep(1) ' ) + PyEndOfSwitch.append( ' return a ' ) + EndOfSwitch.SetPyFunction( 'EndOfSwitch' , PyEndOfSwitch ) + IEndOfSwitcha = EndOfSwitch.InPort( 'a' , 'long' ) + IEndOfSwitchBranch = EndOfSwitch.InPort( 'Branch' , 'string' ) + IEndOfSwitchDefault = EndOfSwitch.GetInPort( 'Default' ) + OEndOfSwitcha = EndOfSwitch.OutPort( 'a' , 'long' ) + OEndOfSwitchGate = EndOfSwitch.GetOutPort( 'Gate' ) + Switch.SetName( 'Switch' ) + Switch.SetAuthor( '' ) + Switch.SetComment( 'Compute Node' ) + Switch.Coords( 194 , 157 ) + ISwitcha = Switch.InPort( 'a' , 'long' ) + ISwitchGate = Switch.GetInPort( 'Gate' ) + OSwitchOdd = Switch.OutPort( 'Odd' , 'long' ) + OSwitchEven = Switch.OutPort( 'Even' , 'int' ) + OSwitcha = Switch.OutPort( 'a' , 'int' ) + OSwitchBranch = Switch.OutPort( 'Branch' , 'string' ) + OSwitchdefault = Switch.OutPort( 'default' , 'boolean' ) + OSwitchDefault = Switch.GetOutPort( 'Default' ) + + # Creation of Links + LIsOddaEndOfSwitcha = GraphSwitchCheckBranch2NOTValid.Link( OIsOdda , IEndOfSwitcha ) + + LIsEvenaEndOfSwitcha = GraphSwitchCheckBranch2NOTValid.Link( OIsEvena , IEndOfSwitcha ) + + LBranchNodeBranchEndOfSwitchBranch = GraphSwitchCheckBranch2NOTValid.Link( OBranchNodeBranch , IEndOfSwitchBranch ) + + LBranchNodeBranchIsOddBranch = GraphSwitchCheckBranch2NOTValid.Link( OBranchNodeBranch , IIsOddBranch ) + + LBranchNodeBranchdefaultBranch = GraphSwitchCheckBranch2NOTValid.Link( OBranchNodeBranch , IdefaultBranch ) + + LBranchNodeBranchIsEvenBranch = GraphSwitchCheckBranch2NOTValid.Link( OBranchNodeBranch , IIsEvenBranch ) + + LInitLoopSwitchIndexSwitcha = GraphSwitchCheckBranch2NOTValid.Link( OInitLoopSwitchIndex , ISwitcha ) + + LInitLoopSwitchMinEndOfInitLoopSwitchMin = GraphSwitchCheckBranch2NOTValid.Link( OInitLoopSwitchMin , IEndOfInitLoopSwitchMin ) + + LInitLoopSwitchMaxEndOfInitLoopSwitchMax = GraphSwitchCheckBranch2NOTValid.Link( OInitLoopSwitchMax , IEndOfInitLoopSwitchMax ) + + LSwitchOddIsOddGate = GraphSwitchCheckBranch2NOTValid.Link( OSwitchOdd , IIsOddGate ) + LSwitchOddIsOddGate.AddCoord( 1 , 400 , 121 ) + LSwitchOddIsOddGate.AddCoord( 2 , 401 , 188 ) + + LSwitchEvenIsEvenGate = GraphSwitchCheckBranch2NOTValid.Link( OSwitchEven , IIsEvenGate ) + LSwitchEvenIsEvenGate.AddCoord( 1 , 391 , 568 ) + LSwitchEvenIsEvenGate.AddCoord( 2 , 392 , 208 ) + + LSwitchadefaulta = GraphSwitchCheckBranch2NOTValid.Link( OSwitcha , Idefaulta ) + + LSwitchaIsEvena = GraphSwitchCheckBranch2NOTValid.Link( OSwitcha , IIsEvena ) + + LSwitchaIsOdda = GraphSwitchCheckBranch2NOTValid.Link( OSwitcha , IIsOdda ) + + LSwitchBranchBranchNodeBranch = GraphSwitchCheckBranch2NOTValid.Link( OSwitchBranch , IBranchNodeBranch ) + + LSwitchdefaultdefaultGate = GraphSwitchCheckBranch2NOTValid.Link( OSwitchdefault , IdefaultGate ) + LSwitchdefaultdefaultGate.AddCoord( 1 , 410 , 422 ) + LSwitchdefaultdefaultGate.AddCoord( 2 , 410 , 269 ) + LSwitchdefaultdefaultGate.AddCoord( 3 , 410 , 268 ) + + LSwitchDefaultEndOfSwitchDefault = GraphSwitchCheckBranch2NOTValid.Link( OSwitchDefault , IEndOfSwitchDefault ) + + LEndOfSwitchaEndOfInitLoopSwitchIndex = GraphSwitchCheckBranch2NOTValid.Link( OEndOfSwitcha , IEndOfInitLoopSwitchIndex ) + + LdefaultaEndOfSwitcha = GraphSwitchCheckBranch2NOTValid.Link( Odefaulta , IEndOfSwitcha ) + + # Input datas + IInitLoopSwitchIndex.Input( 0 ) + IInitLoopSwitchMin.Input( -5 ) + IInitLoopSwitchMax.Input( 10 ) + + # Output Ports of the graph + #OEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetOutPort( 'Index' ) + #OEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetOutPort( 'Min' ) + #OEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetOutPort( 'Max' ) + return GraphSwitchCheckBranch2NOTValid + + +GraphSwitchCheckBranch2NOTValid = DefGraphSwitchCheckBranch2NOTValid() diff --git a/examples/GraphSwitchCheckBranch2NOTValid.xml b/examples/GraphSwitchCheckBranch2NOTValid.xml new file mode 100644 index 0000000..0833676 --- /dev/null +++ b/examples/GraphSwitchCheckBranch2NOTValid.xml @@ -0,0 +1,548 @@ + + + + + +? + ? + GraphSwitchCheckBranch2NOTValid + 1 + ? + +GraphSwitchCheckBranch2NOTValid + + +long + InitLoopSwitch__Index + +long + InitLoopSwitch__Min + +long + InitLoopSwitch__Max + + +long + EndOfInitLoopSwitch__Index + +long + EndOfInitLoopSwitch__Min + +long + EndOfInitLoopSwitch__Max + + + 13/1/2005 - 11:48:50 + 15/2/2005 - 11:47:4 + 2.0 + JR + ? + Switch with two SwitchBranches, One NotSwitchBranch and the DefaultBranch +Shared Node between Branches + 0 + 0 + + +? + ? + IsOdd + 3 + ? + +IsOdd + + +long + a + +string + Branch + + +long + a + + + +IsOdd + + + + + + 15/2/2005 - 11:42:57 + 15/2/2005 - 11:42:57 + 2.0 + ? + ? + Python function + 649 + 6 + +? + ? + IsEven + 3 + ? + +IsEven + + +long + a + +string + Branch + + +long + a + + + +IsEven + + + + + + 15/2/2005 - 11:42:57 + 15/2/2005 - 11:42:57 + 2.0 + ? + ? + Compute Node + 657 + 451 + +? + ? + BranchNode + 3 + ? + +BranchNode + + +string + Branch + + +string + Branch + + + +Print_1 + + + + + + 15/2/2005 - 11:42:57 + 15/2/2005 - 11:42:57 + 2.0 + ? + ? + Compute Node + 429 + 177 + +? + ? + InitLoopSwitch + 4 + EndOfInitLoopSwitch + +InitLoopSwitch + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +InitLoop + + + + +MoreLoop + + + + = Min : ]]> + + + + + +NextLoop + + + + 15/2/2005 - 11:42:57 + 15/2/2005 - 11:42:57 + 2.0 + ? + ? + Compute Node + 10 + 157 + +? + ? + EndOfInitLoopSwitch + 5 + InitLoopSwitch + +EndOfInitLoopSwitch + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +EndOfInitLoopSwitch + + + + + 15/2/2005 - 11:42:57 + 15/2/2005 - 11:42:57 + 2.0 + ? + ? + Compute Node + 1073 + 216 + +? + ? + Switch + 6 + EndOfSwitch + +Switch + + +long + a + + +long + Odd + +int + Even + +int + a + +string + Branch + +boolean + default + + + +Switch + + + + + + + + + + + + 15/2/2005 - 11:42:57 + 15/2/2005 - 11:42:57 + 2.0 + ? + ? + Compute Node + 194 + 157 + +? + ? + EndOfSwitch + 7 + Switch + +EndOfSwitch + + +long + a + +string + Branch + + +long + a + + + +EndOfSwitch + + + + + 15/2/2005 - 11:42:57 + 15/2/2005 - 11:42:57 + 2.0 + ? + ? + Compute Node + 880 + 216 + +? + ? + default + 3 + ? + +default + + +long + a + +string + Branch + + +long + a + + + +default + + + + + 15/2/2005 - 11:42:57 + 15/2/2005 - 11:42:57 + 2.0 + ? + ? + Compute Node + 655 + 306 + + +IsOdd + a + EndOfSwitch + a + + +IsEven + a + EndOfSwitch + a + + +BranchNode + Branch + EndOfSwitch + Branch + + +BranchNode + Branch + IsOdd + Branch + + +BranchNode + Branch + default + Branch + + +BranchNode + Branch + IsEven + Branch + + +InitLoopSwitch + DoLoop + EndOfInitLoopSwitch + DoLoop + + +InitLoopSwitch + Index + Switch + a + + +InitLoopSwitch + Min + EndOfInitLoopSwitch + Min + + +InitLoopSwitch + Max + EndOfInitLoopSwitch + Max + + +EndOfInitLoopSwitch + DoLoop + InitLoopSwitch + DoLoop + + +Switch + Odd + IsOdd + Gate + + +400 + 121 + +401 + 188 + +Switch + Even + IsEven + Gate + + +391 + 568 + +392 + 208 + +Switch + a + default + a + + +Switch + a + IsEven + a + + +Switch + a + IsOdd + a + + +Switch + Branch + BranchNode + Branch + + +Switch + default + default + Gate + + +410 + 422 + +410 + 269 + +410 + 268 + +Switch + Default + EndOfSwitch + Default + + +EndOfSwitch + a + EndOfInitLoopSwitch + Index + + +default + a + EndOfSwitch + a + + + +GraphSwitchCheckBranch2NOTValid + InitLoopSwitch__Index + InitLoopSwitch + Index + +3 + 0 + + +GraphSwitchCheckBranch2NOTValid + InitLoopSwitch__Min + InitLoopSwitch + Min + +3 + -5 + + +GraphSwitchCheckBranch2NOTValid + InitLoopSwitch__Max + InitLoopSwitch + Max + +3 + 10 + diff --git a/examples/GraphSwitchCheckDefault.py b/examples/GraphSwitchCheckDefault.py index 8232e30..d77e790 100644 --- a/examples/GraphSwitchCheckDefault.py +++ b/examples/GraphSwitchCheckDefault.py @@ -1,15 +1,15 @@ -# Generated python file of Graph GraphSwitchCheckDefault +# Generated python file of Graph GraphSwitchCheckDefault_1 from SuperV import * -# Graph creation of GraphSwitchCheckDefault -def DefGraphSwitchCheckDefault() : - GraphSwitchCheckDefault = Graph( 'GraphSwitchCheckDefault' ) - GraphSwitchCheckDefault.SetName( 'GraphSwitchCheckDefault' ) - GraphSwitchCheckDefault.SetAuthor( 'JR' ) - GraphSwitchCheckDefault.SetComment( '' ) - GraphSwitchCheckDefault.Coords( 0 , 0 ) +# Graph creation of GraphSwitchCheckDefault_1 +def DefGraphSwitchCheckDefault_1() : + GraphSwitchCheckDefault_1 = Graph( 'GraphSwitchCheckDefault_1' ) + GraphSwitchCheckDefault_1.SetName( 'GraphSwitchCheckDefault_1' ) + GraphSwitchCheckDefault_1.SetAuthor( 'JR' ) + GraphSwitchCheckDefault_1.SetComment( '' ) + GraphSwitchCheckDefault_1.Coords( 0 , 0 ) # Creation of Factory Nodes @@ -20,7 +20,7 @@ def DefGraphSwitchCheckDefault() : PyIsOdd.append( ' print a,"IsOdd (GraphSwitch)" ' ) PyIsOdd.append( ' sleep( 1 ) ' ) PyIsOdd.append( ' return a ' ) - IsOdd = GraphSwitchCheckDefault.INode( 'IsOdd' , PyIsOdd ) + IsOdd = GraphSwitchCheckDefault_1.INode( 'IsOdd' , PyIsOdd ) IsOdd.SetName( 'IsOdd' ) IsOdd.SetAuthor( '' ) IsOdd.SetComment( 'Python function' ) @@ -36,7 +36,7 @@ def DefGraphSwitchCheckDefault() : PyIsEven.append( ' print a,"IsEven (GraphSwitch)" ' ) PyIsEven.append( ' sleep( 1 ) ' ) PyIsEven.append( ' return a ' ) - IsEven = GraphSwitchCheckDefault.INode( 'IsEven' , PyIsEven ) + IsEven = GraphSwitchCheckDefault_1.INode( 'IsEven' , PyIsEven ) IsEven.SetName( 'IsEven' ) IsEven.SetAuthor( '' ) IsEven.SetComment( 'Compute Node' ) @@ -52,7 +52,7 @@ def DefGraphSwitchCheckDefault() : PyPrintOdd.append( ' print "Print ",a,Branch ' ) PyPrintOdd.append( ' sleep(1) ' ) PyPrintOdd.append( ' return Branch ' ) - PrintOdd = GraphSwitchCheckDefault.INode( 'Print' , PyPrintOdd ) + PrintOdd = GraphSwitchCheckDefault_1.INode( 'Print' , PyPrintOdd ) PrintOdd.SetName( 'PrintOdd' ) PrintOdd.SetAuthor( '' ) PrintOdd.SetComment( 'Compute Node' ) @@ -69,7 +69,7 @@ def DefGraphSwitchCheckDefault() : PyPrintEven.append( ' print "Print ",a,Branch ' ) PyPrintEven.append( ' sleep(1) ' ) PyPrintEven.append( ' return Branch ' ) - PrintEven = GraphSwitchCheckDefault.INode( 'Print_1' , PyPrintEven ) + PrintEven = GraphSwitchCheckDefault_1.INode( 'Print_1' , PyPrintEven ) PrintEven.SetName( 'PrintEven' ) PrintEven.SetAuthor( '' ) PrintEven.SetComment( 'Compute Node' ) @@ -85,7 +85,7 @@ def DefGraphSwitchCheckDefault() : PyEmptyNode.append( 'def EmptyNode(a,Branch) : ' ) PyEmptyNode.append( ' sleep(1) ' ) PyEmptyNode.append( ' return a,Branch ' ) - EmptyNode = GraphSwitchCheckDefault.INode( 'EmptyNode' , PyEmptyNode ) + EmptyNode = GraphSwitchCheckDefault_1.INode( 'EmptyNode' , PyEmptyNode ) EmptyNode.SetName( 'EmptyNode' ) EmptyNode.SetAuthor( '' ) EmptyNode.SetComment( 'Compute Node' ) @@ -97,23 +97,6 @@ def DefGraphSwitchCheckDefault() : OEmptyNodeBranch = EmptyNode.OutPort( 'Branch' , 'string' ) OEmptyNodeGate = EmptyNode.GetOutPort( 'Gate' ) - PyDefault = [] - PyDefault.append( 'from time import * ' ) - PyDefault.append( 'def Default(a,Branch) : ' ) - PyDefault.append( ' sleep(1) ' ) - PyDefault.append( ' return a,Branch ' ) - Default = GraphSwitchCheckDefault.INode( 'Default' , PyDefault ) - Default.SetName( 'Default' ) - Default.SetAuthor( '' ) - Default.SetComment( 'Compute Node' ) - Default.Coords( 421 , 592 ) - IDefaulta = Default.InPort( 'a' , 'long' ) - IDefaultBranch = Default.InPort( 'Branch' , 'string' ) - IDefaultGate = Default.GetInPort( 'Gate' ) - ODefaulta = Default.OutPort( 'a' , 'long' ) - ODefaultBranch = Default.OutPort( 'Branch' , 'string' ) - ODefaultGate = Default.GetOutPort( 'Gate' ) - # Creation of Loop Nodes PyInitLoopSwitch = [] PyInitLoopSwitch.append( 'def InitLoop(Index,Min,Max) : ' ) @@ -132,7 +115,7 @@ def DefGraphSwitchCheckDefault() : PyNextInitLoopSwitch.append( 'def NextLoop(Index,Min,Max) : ' ) PyNextInitLoopSwitch.append( ' Index = Index - 1 ' ) PyNextInitLoopSwitch.append( ' return Index,Min,Max ' ) - InitLoopSwitch,EndOfInitLoopSwitch = GraphSwitchCheckDefault.LNode( 'InitLoop' , PyInitLoopSwitch , 'MoreLoop' , PyMoreInitLoopSwitch , 'NextLoop' , PyNextInitLoopSwitch ) + InitLoopSwitch,EndOfInitLoopSwitch = GraphSwitchCheckDefault_1.LNode( 'InitLoop' , PyInitLoopSwitch , 'MoreLoop' , PyMoreInitLoopSwitch , 'NextLoop' , PyNextInitLoopSwitch ) EndOfInitLoopSwitch.SetName( 'EndOfInitLoopSwitch' ) EndOfInitLoopSwitch.SetAuthor( '' ) EndOfInitLoopSwitch.SetComment( 'Compute Node' ) @@ -180,7 +163,7 @@ def DefGraphSwitchCheckDefault() : PySwitch.append( ' else : ' ) PySwitch.append( ' Branch = "Odd" ' ) PySwitch.append( ' return a & 1,1-(a&1),a,Branch,0 ' ) - Switch,EndOfSwitch = GraphSwitchCheckDefault.SNode( 'Switch' , PySwitch ) + Switch,EndOfSwitch = GraphSwitchCheckDefault_1.SNode( 'Switch' , PySwitch ) EndOfSwitch.SetName( 'EndOfSwitch' ) EndOfSwitch.SetAuthor( '' ) EndOfSwitch.SetComment( 'Compute Node' ) @@ -210,78 +193,64 @@ def DefGraphSwitchCheckDefault() : OSwitchDefault = Switch.GetOutPort( 'Default' ) # Creation of Links - LIsOddaEmptyNodea = GraphSwitchCheckDefault.Link( OIsOdda , IEmptyNodea ) + LIsOddaEmptyNodea = GraphSwitchCheckDefault_1.Link( OIsOdda , IEmptyNodea ) LIsOddaEmptyNodea.AddCoord( 1 , 646 , 78 ) - LIsEvenaEndOfSwitcha = GraphSwitchCheckDefault.Link( OIsEvena , IEndOfSwitcha ) - - LPrintOddBranchEmptyNodeBranch = GraphSwitchCheckDefault.Link( OPrintOddBranch , IEmptyNodeBranch ) - - LPrintEvenBranchEndOfSwitchBranch = GraphSwitchCheckDefault.Link( OPrintEvenBranch , IEndOfSwitchBranch ) + LIsEvenaEndOfSwitcha = GraphSwitchCheckDefault_1.Link( OIsEvena , IEndOfSwitcha ) - LEmptyNodeaEndOfSwitcha = GraphSwitchCheckDefault.Link( OEmptyNodea , IEndOfSwitcha ) + LPrintOddBranchEmptyNodeBranch = GraphSwitchCheckDefault_1.Link( OPrintOddBranch , IEmptyNodeBranch ) - LEmptyNodeBranchEndOfSwitchBranch = GraphSwitchCheckDefault.Link( OEmptyNodeBranch , IEndOfSwitchBranch ) + LPrintEvenBranchEndOfSwitchBranch = GraphSwitchCheckDefault_1.Link( OPrintEvenBranch , IEndOfSwitchBranch ) - LDefaultaEndOfSwitcha = GraphSwitchCheckDefault.Link( ODefaulta , IEndOfSwitcha ) + LEmptyNodeaEndOfSwitcha = GraphSwitchCheckDefault_1.Link( OEmptyNodea , IEndOfSwitcha ) - LDefaultBranchEndOfSwitchBranch = GraphSwitchCheckDefault.Link( ODefaultBranch , IEndOfSwitchBranch ) + LEmptyNodeBranchEndOfSwitchBranch = GraphSwitchCheckDefault_1.Link( OEmptyNodeBranch , IEndOfSwitchBranch ) - LInitLoopSwitchIndexSwitcha = GraphSwitchCheckDefault.Link( OInitLoopSwitchIndex , ISwitcha ) + LInitLoopSwitchIndexSwitcha = GraphSwitchCheckDefault_1.Link( OInitLoopSwitchIndex , ISwitcha ) - LInitLoopSwitchMinEndOfInitLoopSwitchMin = GraphSwitchCheckDefault.Link( OInitLoopSwitchMin , IEndOfInitLoopSwitchMin ) + LInitLoopSwitchMinEndOfInitLoopSwitchMin = GraphSwitchCheckDefault_1.Link( OInitLoopSwitchMin , IEndOfInitLoopSwitchMin ) - LInitLoopSwitchMaxEndOfInitLoopSwitchMax = GraphSwitchCheckDefault.Link( OInitLoopSwitchMax , IEndOfInitLoopSwitchMax ) + LInitLoopSwitchMaxEndOfInitLoopSwitchMax = GraphSwitchCheckDefault_1.Link( OInitLoopSwitchMax , IEndOfInitLoopSwitchMax ) - LSwitchOddIsOddGate = GraphSwitchCheckDefault.Link( OSwitchOdd , IIsOddGate ) + LSwitchOddIsOddGate = GraphSwitchCheckDefault_1.Link( OSwitchOdd , IIsOddGate ) LSwitchOddIsOddGate.AddCoord( 1 , 401 , 101 ) LSwitchOddIsOddGate.AddCoord( 2 , 401 , 160 ) - LSwitchOddPrintOddGate = GraphSwitchCheckDefault.Link( OSwitchOdd , IPrintOddGate ) + LSwitchOddPrintOddGate = GraphSwitchCheckDefault_1.Link( OSwitchOdd , IPrintOddGate ) LSwitchOddPrintOddGate.AddCoord( 1 , 401 , 245 ) LSwitchOddPrintOddGate.AddCoord( 2 , 401 , 159 ) - LSwitchEvenIsEvenGate = GraphSwitchCheckDefault.Link( OSwitchEven , IIsEvenGate ) + LSwitchEvenIsEvenGate = GraphSwitchCheckDefault_1.Link( OSwitchEven , IIsEvenGate ) LSwitchEvenIsEvenGate.AddCoord( 1 , 392 , 533 ) LSwitchEvenIsEvenGate.AddCoord( 2 , 392 , 182 ) - LSwitchEvenPrintEvenGate = GraphSwitchCheckDefault.Link( OSwitchEven , IPrintEvenGate ) + LSwitchEvenPrintEvenGate = GraphSwitchCheckDefault_1.Link( OSwitchEven , IPrintEvenGate ) LSwitchEvenPrintEvenGate.AddCoord( 1 , 392 , 403 ) LSwitchEvenPrintEvenGate.AddCoord( 2 , 392 , 181 ) - LSwitchaIsOdda = GraphSwitchCheckDefault.Link( OSwitcha , IIsOdda ) + LSwitchaIsOdda = GraphSwitchCheckDefault_1.Link( OSwitcha , IIsOdda ) LSwitchaIsOdda.AddCoord( 1 , 382 , 78 ) LSwitchaIsOdda.AddCoord( 2 , 382 , 199 ) - LSwitchaIsEvena = GraphSwitchCheckDefault.Link( OSwitcha , IIsEvena ) + LSwitchaIsEvena = GraphSwitchCheckDefault_1.Link( OSwitcha , IIsEvena ) LSwitchaIsEvena.AddCoord( 1 , 381 , 509 ) LSwitchaIsEvena.AddCoord( 2 , 382 , 200 ) - LSwitchaPrintOdda = GraphSwitchCheckDefault.Link( OSwitcha , IPrintOdda ) + LSwitchaPrintOdda = GraphSwitchCheckDefault_1.Link( OSwitcha , IPrintOdda ) - LSwitchaPrintEvena = GraphSwitchCheckDefault.Link( OSwitcha , IPrintEvena ) + LSwitchaPrintEvena = GraphSwitchCheckDefault_1.Link( OSwitcha , IPrintEvena ) LSwitchaPrintEvena.AddCoord( 1 , 381 , 361 ) LSwitchaPrintEvena.AddCoord( 2 , 382 , 200 ) - LSwitchaDefaulta = GraphSwitchCheckDefault.Link( OSwitcha , IDefaulta ) - LSwitchaDefaulta.AddCoord( 1 , 382 , 663 ) - LSwitchaDefaulta.AddCoord( 2 , 382 , 199 ) + LSwitchBranchPrintOddBranch = GraphSwitchCheckDefault_1.Link( OSwitchBranch , IPrintOddBranch ) - LSwitchBranchPrintOddBranch = GraphSwitchCheckDefault.Link( OSwitchBranch , IPrintOddBranch ) - - LSwitchBranchPrintEvenBranch = GraphSwitchCheckDefault.Link( OSwitchBranch , IPrintEvenBranch ) + LSwitchBranchPrintEvenBranch = GraphSwitchCheckDefault_1.Link( OSwitchBranch , IPrintEvenBranch ) LSwitchBranchPrintEvenBranch.AddCoord( 1 , 369 , 381 ) LSwitchBranchPrintEvenBranch.AddCoord( 2 , 369 , 219 ) - LSwitchBranchDefaultBranch = GraphSwitchCheckDefault.Link( OSwitchBranch , IDefaultBranch ) - LSwitchBranchDefaultBranch.AddCoord( 1 , 370 , 683 ) - LSwitchBranchDefaultBranch.AddCoord( 2 , 370 , 220 ) - - LSwitchDefaultDefaultGate = GraphSwitchCheckDefault.Link( OSwitchDefault , IDefaultGate ) - LSwitchDefaultDefaultGate.AddCoord( 1 , 360 , 707 ) - LSwitchDefaultDefaultGate.AddCoord( 2 , 360 , 263 ) + LSwitchDefaultEndOfSwitchDefault = GraphSwitchCheckDefault_1.Link( OSwitchDefault , IEndOfSwitchDefault ) - LEndOfSwitchaEndOfInitLoopSwitchIndex = GraphSwitchCheckDefault.Link( OEndOfSwitcha , IEndOfInitLoopSwitchIndex ) + LEndOfSwitchaEndOfInitLoopSwitchIndex = GraphSwitchCheckDefault_1.Link( OEndOfSwitcha , IEndOfInitLoopSwitchIndex ) # Input datas IInitLoopSwitchIndex.Input( 0 ) @@ -293,7 +262,7 @@ def DefGraphSwitchCheckDefault() : #OEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetOutPort( 'Min' ) #OEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetOutPort( 'Max' ) #OSwitchdefault = Switch.GetOutPort( 'default' ) - return GraphSwitchCheckDefault + return GraphSwitchCheckDefault_1 -GraphSwitchCheckDefault = DefGraphSwitchCheckDefault() +GraphSwitchCheckDefault_1 = DefGraphSwitchCheckDefault_1() diff --git a/examples/GraphSwitchCheckDefault.xml b/examples/GraphSwitchCheckDefault.xml index 81e7ab6..0e92e72 100644 --- a/examples/GraphSwitchCheckDefault.xml +++ b/examples/GraphSwitchCheckDefault.xml @@ -5,11 +5,11 @@ ? ? - GraphSwitchCheckDefault + GraphSwitchCheckDefault_1 1 ? -GraphSwitchCheck_2 +GraphSwitchCheckDefault_1 long @@ -36,7 +36,7 @@ 13/1/2005 - 12:21:43 - 13/1/2005 - 12:23:17 + 8/3/2005 - 16:47:4 2.0 JR ? @@ -69,8 +69,8 @@ - 13/1/2005 - 12:23:17 - 13/1/2005 - 12:23:17 + 8/3/2005 - 16:47:4 + 8/3/2005 - 16:47:4 2.0 ? ? @@ -102,8 +102,8 @@ - 13/1/2005 - 12:23:17 - 13/1/2005 - 12:23:17 + 8/3/2005 - 16:47:4 + 8/3/2005 - 16:47:4 2.0 ? ? @@ -138,8 +138,8 @@ - 13/1/2005 - 12:23:17 - 13/1/2005 - 12:23:17 + 8/3/2005 - 16:47:4 + 8/3/2005 - 16:47:4 2.0 ? ? @@ -174,8 +174,8 @@ - 13/1/2005 - 12:23:17 - 13/1/2005 - 12:23:17 + 8/3/2005 - 16:47:4 + 8/3/2005 - 16:47:4 2.0 ? ? @@ -212,8 +212,8 @@ - 13/1/2005 - 12:23:17 - 13/1/2005 - 12:23:17 + 8/3/2005 - 16:47:4 + 8/3/2005 - 16:47:4 2.0 ? ? @@ -221,44 +221,6 @@ 652 110 -? - ? - Default - 3 - ? - -Default - - -long - a - -string - Branch - - -long - a - -string - Branch - - - -Default - - - - - 13/1/2005 - 12:23:17 - 13/1/2005 - 12:23:17 - 2.0 - ? - ? - Compute Node - 421 - 592 - ? ? InitLoopSwitch @@ -308,8 +270,8 @@ - 13/1/2005 - 12:23:17 - 13/1/2005 - 12:23:17 + 8/3/2005 - 16:47:4 + 8/3/2005 - 16:47:4 2.0 ? ? @@ -352,8 +314,8 @@ - 13/1/2005 - 12:23:17 - 13/1/2005 - 12:23:17 + 8/3/2005 - 16:47:4 + 8/3/2005 - 16:47:4 2.0 ? ? @@ -403,8 +365,8 @@ - 13/1/2005 - 12:23:17 - 13/1/2005 - 12:23:17 + 8/3/2005 - 16:47:4 + 8/3/2005 - 16:47:4 2.0 ? ? @@ -438,8 +400,8 @@ - 13/1/2005 - 12:23:17 - 13/1/2005 - 12:23:17 + 8/3/2005 - 16:47:4 + 8/3/2005 - 16:47:4 2.0 ? ? @@ -487,18 +449,6 @@ Branch -Default - a - EndOfSwitch - a - - -Default - Branch - EndOfSwitch - Branch - - InitLoopSwitch DoLoop EndOfInitLoopSwitch @@ -619,18 +569,6 @@ 382 200 -Switch - a - Default - a - - -382 - 663 - -382 - 199 - Switch Branch PrintOdd @@ -649,29 +587,11 @@ 369 219 -Switch - Branch - Default - Branch - - -370 - 683 - -370 - 220 - Switch Default - Default - Gate - - -360 - 707 - -360 - 263 + EndOfSwitch + Default + EndOfSwitch a @@ -680,7 +600,7 @@ -GraphSwitchCheckDefault +GraphSwitchCheckDefault_1 InitLoopSwitch__Index InitLoopSwitch Index @@ -689,7 +609,7 @@ 0 -GraphSwitchCheckDefault +GraphSwitchCheckDefault_1 InitLoopSwitch__Min InitLoopSwitch Min @@ -698,7 +618,7 @@ -5 -GraphSwitchCheckDefault +GraphSwitchCheckDefault_1 InitLoopSwitch__Max InitLoopSwitch Max diff --git a/examples/GraphSwitchCheckDefault2NOTValid2.py b/examples/GraphSwitchCheckDefault2NOTValid2.py index a94310f..794350c 100644 --- a/examples/GraphSwitchCheckDefault2NOTValid2.py +++ b/examples/GraphSwitchCheckDefault2NOTValid2.py @@ -1,15 +1,15 @@ -# Generated python file of Graph GraphSwitchCheckDefault2NOTValid2 +# Generated python file of Graph GraphSwitchCheckDefault2NOTValid2_1 from SuperV import * -# Graph creation of GraphSwitchCheckDefault2NOTValid2 -def DefGraphSwitchCheckDefault2NOTValid2() : - GraphSwitchCheckDefault2NOTValid2 = Graph( 'GraphSwitchCheckDefault2NOTValid2' ) - GraphSwitchCheckDefault2NOTValid2.SetName( 'GraphSwitchCheckDefault2NOTValid2' ) - GraphSwitchCheckDefault2NOTValid2.SetAuthor( 'JR' ) - GraphSwitchCheckDefault2NOTValid2.SetComment( '' ) - GraphSwitchCheckDefault2NOTValid2.Coords( 0 , 0 ) +# Graph creation of GraphSwitchCheckDefault2NOTValid2_1 +def DefGraphSwitchCheckDefault2NOTValid2_1() : + GraphSwitchCheckDefault2NOTValid2_1 = Graph( 'GraphSwitchCheckDefault2NOTValid2_1' ) + GraphSwitchCheckDefault2NOTValid2_1.SetName( 'GraphSwitchCheckDefault2NOTValid2_1' ) + GraphSwitchCheckDefault2NOTValid2_1.SetAuthor( 'JR' ) + GraphSwitchCheckDefault2NOTValid2_1.SetComment( '' ) + GraphSwitchCheckDefault2NOTValid2_1.Coords( 0 , 0 ) # Creation of Factory Nodes @@ -20,7 +20,7 @@ def DefGraphSwitchCheckDefault2NOTValid2() : PyIsOdd.append( ' print a,"IsOdd (GraphSwitch)" ' ) PyIsOdd.append( ' sleep( 1 ) ' ) PyIsOdd.append( ' return a ' ) - IsOdd = GraphSwitchCheckDefault2NOTValid2.INode( 'IsOdd' , PyIsOdd ) + IsOdd = GraphSwitchCheckDefault2NOTValid2_1.INode( 'IsOdd' , PyIsOdd ) IsOdd.SetName( 'IsOdd' ) IsOdd.SetAuthor( '' ) IsOdd.SetComment( 'Python function' ) @@ -36,7 +36,7 @@ def DefGraphSwitchCheckDefault2NOTValid2() : PyIsEven.append( ' print a,"IsEven (GraphSwitch)" ' ) PyIsEven.append( ' sleep( 1 ) ' ) PyIsEven.append( ' return a ' ) - IsEven = GraphSwitchCheckDefault2NOTValid2.INode( 'IsEven' , PyIsEven ) + IsEven = GraphSwitchCheckDefault2NOTValid2_1.INode( 'IsEven' , PyIsEven ) IsEven.SetName( 'IsEven' ) IsEven.SetAuthor( '' ) IsEven.SetComment( 'Compute Node' ) @@ -52,7 +52,7 @@ def DefGraphSwitchCheckDefault2NOTValid2() : PyPrintOdd.append( ' print "Print ",a,Branch ' ) PyPrintOdd.append( ' sleep(1) ' ) PyPrintOdd.append( ' return Branch ' ) - PrintOdd = GraphSwitchCheckDefault2NOTValid2.INode( 'Print' , PyPrintOdd ) + PrintOdd = GraphSwitchCheckDefault2NOTValid2_1.INode( 'Print' , PyPrintOdd ) PrintOdd.SetName( 'PrintOdd' ) PrintOdd.SetAuthor( '' ) PrintOdd.SetComment( 'Compute Node' ) @@ -69,7 +69,7 @@ def DefGraphSwitchCheckDefault2NOTValid2() : PyPrintEven.append( ' print "Print ",a,Branch ' ) PyPrintEven.append( ' sleep(1) ' ) PyPrintEven.append( ' return Branch ' ) - PrintEven = GraphSwitchCheckDefault2NOTValid2.INode( 'Print_1' , PyPrintEven ) + PrintEven = GraphSwitchCheckDefault2NOTValid2_1.INode( 'Print_1' , PyPrintEven ) PrintEven.SetName( 'PrintEven' ) PrintEven.SetAuthor( '' ) PrintEven.SetComment( 'Compute Node' ) @@ -85,7 +85,7 @@ def DefGraphSwitchCheckDefault2NOTValid2() : PyEmptyNode.append( 'def EmptyNode(a,Branch) : ' ) PyEmptyNode.append( ' sleep(1) ' ) PyEmptyNode.append( ' return a,Branch ' ) - EmptyNode = GraphSwitchCheckDefault2NOTValid2.INode( 'EmptyNode' , PyEmptyNode ) + EmptyNode = GraphSwitchCheckDefault2NOTValid2_1.INode( 'EmptyNode' , PyEmptyNode ) EmptyNode.SetName( 'EmptyNode' ) EmptyNode.SetAuthor( '' ) EmptyNode.SetComment( 'Compute Node' ) @@ -102,7 +102,7 @@ def DefGraphSwitchCheckDefault2NOTValid2() : PyDefault.append( 'def Default(a,Branch) : ' ) PyDefault.append( ' sleep(1) ' ) PyDefault.append( ' return a,Branch ' ) - Default = GraphSwitchCheckDefault2NOTValid2.INode( 'Default' , PyDefault ) + Default = GraphSwitchCheckDefault2NOTValid2_1.INode( 'Default' , PyDefault ) Default.SetName( 'Default' ) Default.SetAuthor( '' ) Default.SetComment( 'Compute Node' ) @@ -119,11 +119,11 @@ def DefGraphSwitchCheckDefault2NOTValid2() : PyPuta.append( 'def Puta(a) : ' ) PyPuta.append( ' sleep(1) ' ) PyPuta.append( ' return a ' ) - Puta = GraphSwitchCheckDefault2NOTValid2.INode( 'Puta' , PyPuta ) + Puta = GraphSwitchCheckDefault2NOTValid2_1.INode( 'Puta' , PyPuta ) Puta.SetName( 'Puta' ) Puta.SetAuthor( '' ) Puta.SetComment( 'Compute Node' ) - Puta.Coords( 665 , 486 ) + Puta.Coords( 653 , 414 ) IPutaa = Puta.InPort( 'a' , 'long' ) IPutaGate = Puta.GetInPort( 'Gate' ) OPutaa = Puta.OutPort( 'a' , 'long' ) @@ -134,7 +134,7 @@ def DefGraphSwitchCheckDefault2NOTValid2() : PyPutBranch.append( 'def PutBranch(Branch) : ' ) PyPutBranch.append( ' sleep(1) ' ) PyPutBranch.append( ' return Branch ' ) - PutBranch = GraphSwitchCheckDefault2NOTValid2.INode( 'PutBranch' , PyPutBranch ) + PutBranch = GraphSwitchCheckDefault2NOTValid2_1.INode( 'PutBranch' , PyPutBranch ) PutBranch.SetName( 'PutBranch' ) PutBranch.SetAuthor( '' ) PutBranch.SetComment( 'Compute Node' ) @@ -162,7 +162,7 @@ def DefGraphSwitchCheckDefault2NOTValid2() : PyNextInitLoopSwitch.append( 'def NextLoop(Index,Min,Max) : ' ) PyNextInitLoopSwitch.append( ' Index = Index - 1 ' ) PyNextInitLoopSwitch.append( ' return Index,Min,Max ' ) - InitLoopSwitch,EndOfInitLoopSwitch = GraphSwitchCheckDefault2NOTValid2.LNode( 'InitLoop' , PyInitLoopSwitch , 'MoreLoop' , PyMoreInitLoopSwitch , 'NextLoop' , PyNextInitLoopSwitch ) + InitLoopSwitch,EndOfInitLoopSwitch = GraphSwitchCheckDefault2NOTValid2_1.LNode( 'InitLoop' , PyInitLoopSwitch , 'MoreLoop' , PyMoreInitLoopSwitch , 'NextLoop' , PyNextInitLoopSwitch ) EndOfInitLoopSwitch.SetName( 'EndOfInitLoopSwitch' ) EndOfInitLoopSwitch.SetAuthor( '' ) EndOfInitLoopSwitch.SetComment( 'Compute Node' ) @@ -210,7 +210,7 @@ def DefGraphSwitchCheckDefault2NOTValid2() : PySwitch.append( ' else : ' ) PySwitch.append( ' Branch = "Odd" ' ) PySwitch.append( ' return a & 1,1-(a&1),a,Branch,0 ' ) - Switch,EndOfSwitch = GraphSwitchCheckDefault2NOTValid2.SNode( 'Switch' , PySwitch ) + Switch,EndOfSwitch = GraphSwitchCheckDefault2NOTValid2_1.SNode( 'Switch' , PySwitch ) EndOfSwitch.SetName( 'EndOfSwitch' ) EndOfSwitch.SetAuthor( '' ) EndOfSwitch.SetComment( 'Compute Node' ) @@ -240,82 +240,88 @@ def DefGraphSwitchCheckDefault2NOTValid2() : OSwitchDefault = Switch.GetOutPort( 'Default' ) # Creation of Links - LIsOddaEmptyNodea = GraphSwitchCheckDefault2NOTValid2.Link( OIsOdda , IEmptyNodea ) + LIsOddaEmptyNodea = GraphSwitchCheckDefault2NOTValid2_1.Link( OIsOdda , IEmptyNodea ) LIsOddaEmptyNodea.AddCoord( 1 , 646 , 78 ) - LIsEvenaEndOfSwitcha = GraphSwitchCheckDefault2NOTValid2.Link( OIsEvena , IEndOfSwitcha ) + LIsEvenaEndOfSwitcha = GraphSwitchCheckDefault2NOTValid2_1.Link( OIsEvena , IEndOfSwitcha ) - LPrintOddBranchEmptyNodeBranch = GraphSwitchCheckDefault2NOTValid2.Link( OPrintOddBranch , IEmptyNodeBranch ) + LIsEvenaPutaa = GraphSwitchCheckDefault2NOTValid2_1.Link( OIsEvena , IPutaa ) - LPrintEvenBranchEndOfSwitchBranch = GraphSwitchCheckDefault2NOTValid2.Link( OPrintEvenBranch , IEndOfSwitchBranch ) + LPrintOddBranchEmptyNodeBranch = GraphSwitchCheckDefault2NOTValid2_1.Link( OPrintOddBranch , IEmptyNodeBranch ) - LEmptyNodeaEndOfSwitcha = GraphSwitchCheckDefault2NOTValid2.Link( OEmptyNodea , IEndOfSwitcha ) + LPrintEvenBranchEndOfSwitchBranch = GraphSwitchCheckDefault2NOTValid2_1.Link( OPrintEvenBranch , IEndOfSwitchBranch ) - LEmptyNodeBranchEndOfSwitchBranch = GraphSwitchCheckDefault2NOTValid2.Link( OEmptyNodeBranch , IEndOfSwitchBranch ) + LEmptyNodeaEndOfSwitcha = GraphSwitchCheckDefault2NOTValid2_1.Link( OEmptyNodea , IEndOfSwitcha ) - LDefaultaPutaa = GraphSwitchCheckDefault2NOTValid2.Link( ODefaulta , IPutaa ) + LEmptyNodeBranchEndOfSwitchBranch = GraphSwitchCheckDefault2NOTValid2_1.Link( OEmptyNodeBranch , IEndOfSwitchBranch ) - LDefaultBranchPutBranchBranch = GraphSwitchCheckDefault2NOTValid2.Link( ODefaultBranch , IPutBranchBranch ) + LDefaultaEndOfSwitcha = GraphSwitchCheckDefault2NOTValid2_1.Link( ODefaulta , IEndOfSwitcha ) - LInitLoopSwitchIndexSwitcha = GraphSwitchCheckDefault2NOTValid2.Link( OInitLoopSwitchIndex , ISwitcha ) + LDefaultBranchEndOfSwitchBranch = GraphSwitchCheckDefault2NOTValid2_1.Link( ODefaultBranch , IEndOfSwitchBranch ) - LInitLoopSwitchMinEndOfInitLoopSwitchMin = GraphSwitchCheckDefault2NOTValid2.Link( OInitLoopSwitchMin , IEndOfInitLoopSwitchMin ) + LDefaultBranchPutBranchBranch = GraphSwitchCheckDefault2NOTValid2_1.Link( ODefaultBranch , IPutBranchBranch ) - LInitLoopSwitchMaxEndOfInitLoopSwitchMax = GraphSwitchCheckDefault2NOTValid2.Link( OInitLoopSwitchMax , IEndOfInitLoopSwitchMax ) + LInitLoopSwitchIndexSwitcha = GraphSwitchCheckDefault2NOTValid2_1.Link( OInitLoopSwitchIndex , ISwitcha ) - LSwitchOddIsOddGate = GraphSwitchCheckDefault2NOTValid2.Link( OSwitchOdd , IIsOddGate ) + LInitLoopSwitchMinEndOfInitLoopSwitchMin = GraphSwitchCheckDefault2NOTValid2_1.Link( OInitLoopSwitchMin , IEndOfInitLoopSwitchMin ) + + LInitLoopSwitchMaxEndOfInitLoopSwitchMax = GraphSwitchCheckDefault2NOTValid2_1.Link( OInitLoopSwitchMax , IEndOfInitLoopSwitchMax ) + + LSwitchOddIsOddGate = GraphSwitchCheckDefault2NOTValid2_1.Link( OSwitchOdd , IIsOddGate ) LSwitchOddIsOddGate.AddCoord( 1 , 401 , 101 ) LSwitchOddIsOddGate.AddCoord( 2 , 401 , 160 ) - LSwitchOddPrintOddGate = GraphSwitchCheckDefault2NOTValid2.Link( OSwitchOdd , IPrintOddGate ) + LSwitchOddPrintOddGate = GraphSwitchCheckDefault2NOTValid2_1.Link( OSwitchOdd , IPrintOddGate ) LSwitchOddPrintOddGate.AddCoord( 1 , 401 , 245 ) LSwitchOddPrintOddGate.AddCoord( 2 , 401 , 159 ) - LSwitchEvenIsEvenGate = GraphSwitchCheckDefault2NOTValid2.Link( OSwitchEven , IIsEvenGate ) + LSwitchEvenIsEvenGate = GraphSwitchCheckDefault2NOTValid2_1.Link( OSwitchEven , IIsEvenGate ) LSwitchEvenIsEvenGate.AddCoord( 1 , 392 , 533 ) LSwitchEvenIsEvenGate.AddCoord( 2 , 392 , 182 ) - LSwitchEvenPrintEvenGate = GraphSwitchCheckDefault2NOTValid2.Link( OSwitchEven , IPrintEvenGate ) + LSwitchEvenPrintEvenGate = GraphSwitchCheckDefault2NOTValid2_1.Link( OSwitchEven , IPrintEvenGate ) LSwitchEvenPrintEvenGate.AddCoord( 1 , 392 , 403 ) LSwitchEvenPrintEvenGate.AddCoord( 2 , 392 , 181 ) - LSwitchaIsOdda = GraphSwitchCheckDefault2NOTValid2.Link( OSwitcha , IIsOdda ) + LSwitchaIsOdda = GraphSwitchCheckDefault2NOTValid2_1.Link( OSwitcha , IIsOdda ) LSwitchaIsOdda.AddCoord( 1 , 382 , 78 ) LSwitchaIsOdda.AddCoord( 2 , 382 , 199 ) - LSwitchaIsEvena = GraphSwitchCheckDefault2NOTValid2.Link( OSwitcha , IIsEvena ) + LSwitchaIsEvena = GraphSwitchCheckDefault2NOTValid2_1.Link( OSwitcha , IIsEvena ) LSwitchaIsEvena.AddCoord( 1 , 381 , 509 ) LSwitchaIsEvena.AddCoord( 2 , 382 , 200 ) - LSwitchaPrintOdda = GraphSwitchCheckDefault2NOTValid2.Link( OSwitcha , IPrintOdda ) + LSwitchaPrintOdda = GraphSwitchCheckDefault2NOTValid2_1.Link( OSwitcha , IPrintOdda ) - LSwitchaPrintEvena = GraphSwitchCheckDefault2NOTValid2.Link( OSwitcha , IPrintEvena ) + LSwitchaPrintEvena = GraphSwitchCheckDefault2NOTValid2_1.Link( OSwitcha , IPrintEvena ) LSwitchaPrintEvena.AddCoord( 1 , 381 , 361 ) LSwitchaPrintEvena.AddCoord( 2 , 382 , 200 ) - LSwitchaDefaulta = GraphSwitchCheckDefault2NOTValid2.Link( OSwitcha , IDefaulta ) + LSwitchaDefaulta = GraphSwitchCheckDefault2NOTValid2_1.Link( OSwitcha , IDefaulta ) LSwitchaDefaulta.AddCoord( 1 , 382 , 663 ) LSwitchaDefaulta.AddCoord( 2 , 382 , 199 ) - LSwitchBranchPrintOddBranch = GraphSwitchCheckDefault2NOTValid2.Link( OSwitchBranch , IPrintOddBranch ) + LSwitchBranchPrintOddBranch = GraphSwitchCheckDefault2NOTValid2_1.Link( OSwitchBranch , IPrintOddBranch ) - LSwitchBranchPrintEvenBranch = GraphSwitchCheckDefault2NOTValid2.Link( OSwitchBranch , IPrintEvenBranch ) + LSwitchBranchPrintEvenBranch = GraphSwitchCheckDefault2NOTValid2_1.Link( OSwitchBranch , IPrintEvenBranch ) LSwitchBranchPrintEvenBranch.AddCoord( 1 , 369 , 381 ) LSwitchBranchPrintEvenBranch.AddCoord( 2 , 369 , 219 ) - LSwitchBranchDefaultBranch = GraphSwitchCheckDefault2NOTValid2.Link( OSwitchBranch , IDefaultBranch ) + LSwitchBranchDefaultBranch = GraphSwitchCheckDefault2NOTValid2_1.Link( OSwitchBranch , IDefaultBranch ) LSwitchBranchDefaultBranch.AddCoord( 1 , 370 , 683 ) LSwitchBranchDefaultBranch.AddCoord( 2 , 370 , 220 ) - LSwitchdefaultDefaultGate = GraphSwitchCheckDefault2NOTValid2.Link( OSwitchdefault , IDefaultGate ) + LSwitchdefaultDefaultGate = GraphSwitchCheckDefault2NOTValid2_1.Link( OSwitchdefault , IDefaultGate ) LSwitchdefaultDefaultGate.AddCoord( 1 , 363 , 707 ) LSwitchdefaultDefaultGate.AddCoord( 2 , 362 , 239 ) - LEndOfSwitchaEndOfInitLoopSwitchIndex = GraphSwitchCheckDefault2NOTValid2.Link( OEndOfSwitcha , IEndOfInitLoopSwitchIndex ) + LSwitchDefaultEndOfSwitchDefault = GraphSwitchCheckDefault2NOTValid2_1.Link( OSwitchDefault , IEndOfSwitchDefault ) + + LEndOfSwitchaEndOfInitLoopSwitchIndex = GraphSwitchCheckDefault2NOTValid2_1.Link( OEndOfSwitcha , IEndOfInitLoopSwitchIndex ) - LPutaaEndOfSwitcha = GraphSwitchCheckDefault2NOTValid2.Link( OPutaa , IEndOfSwitcha ) + LPutaaEndOfSwitcha = GraphSwitchCheckDefault2NOTValid2_1.Link( OPutaa , IEndOfSwitcha ) - LPutBranchBranchEndOfSwitchBranch = GraphSwitchCheckDefault2NOTValid2.Link( OPutBranchBranch , IEndOfSwitchBranch ) + LPutBranchBranchEndOfSwitchBranch = GraphSwitchCheckDefault2NOTValid2_1.Link( OPutBranchBranch , IEndOfSwitchBranch ) # Input datas IInitLoopSwitchIndex.Input( 0 ) @@ -326,7 +332,7 @@ def DefGraphSwitchCheckDefault2NOTValid2() : #OEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetOutPort( 'Index' ) #OEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetOutPort( 'Min' ) #OEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetOutPort( 'Max' ) - return GraphSwitchCheckDefault2NOTValid2 + return GraphSwitchCheckDefault2NOTValid2_1 -GraphSwitchCheckDefault2NOTValid2 = DefGraphSwitchCheckDefault2NOTValid2() +GraphSwitchCheckDefault2NOTValid2_1 = DefGraphSwitchCheckDefault2NOTValid2_1() diff --git a/examples/GraphSwitchCheckDefault2NOTValid2.xml b/examples/GraphSwitchCheckDefault2NOTValid2.xml index f628cd0..b97732b 100644 --- a/examples/GraphSwitchCheckDefault2NOTValid2.xml +++ b/examples/GraphSwitchCheckDefault2NOTValid2.xml @@ -5,11 +5,11 @@ ? ? - GraphSwitchCheckDefault2NOTValid2 + GraphSwitchCheckDefault2NOTValid2_1 1 ? -GraphSwitchCheckDefault2NOTValid2 +GraphSwitchCheckDefault2NOTValid2_1 long @@ -33,7 +33,7 @@ 13/1/2005 - 12:21:43 - 19/1/2005 - 12:17:7 + 8/3/2005 - 16:55:59 2.0 JR ? @@ -66,8 +66,8 @@ - 19/1/2005 - 12:17:7 - 19/1/2005 - 12:17:7 + 8/3/2005 - 16:55:59 + 8/3/2005 - 16:55:59 2.0 ? ? @@ -99,8 +99,8 @@ - 19/1/2005 - 12:17:7 - 19/1/2005 - 12:17:7 + 8/3/2005 - 16:55:59 + 8/3/2005 - 16:55:59 2.0 ? ? @@ -135,8 +135,8 @@ - 19/1/2005 - 12:17:7 - 19/1/2005 - 12:17:7 + 8/3/2005 - 16:55:59 + 8/3/2005 - 16:55:59 2.0 ? ? @@ -171,8 +171,8 @@ - 19/1/2005 - 12:17:7 - 19/1/2005 - 12:17:7 + 8/3/2005 - 16:55:59 + 8/3/2005 - 16:55:59 2.0 ? ? @@ -209,8 +209,8 @@ - 19/1/2005 - 12:17:7 - 19/1/2005 - 12:17:7 + 8/3/2005 - 16:55:59 + 8/3/2005 - 16:55:59 2.0 ? ? @@ -247,8 +247,8 @@ - 19/1/2005 - 12:17:7 - 19/1/2005 - 12:17:7 + 8/3/2005 - 16:55:59 + 8/3/2005 - 16:55:59 2.0 ? ? @@ -305,8 +305,8 @@ - 19/1/2005 - 12:17:7 - 19/1/2005 - 12:17:7 + 8/3/2005 - 16:55:59 + 8/3/2005 - 16:55:59 2.0 ? ? @@ -349,8 +349,8 @@ - 19/1/2005 - 12:17:7 - 19/1/2005 - 12:17:7 + 8/3/2005 - 16:55:59 + 8/3/2005 - 16:55:59 2.0 ? ? @@ -400,8 +400,8 @@ - 19/1/2005 - 12:17:7 - 19/1/2005 - 12:17:7 + 8/3/2005 - 16:55:59 + 8/3/2005 - 16:55:59 2.0 ? ? @@ -435,8 +435,8 @@ - 19/1/2005 - 12:17:7 - 19/1/2005 - 12:17:7 + 8/3/2005 - 16:55:59 + 8/3/2005 - 16:55:59 2.0 ? ? @@ -467,14 +467,14 @@ - 19/1/2005 - 12:17:7 - 19/1/2005 - 12:17:7 + 8/3/2005 - 16:55:59 + 8/3/2005 - 16:55:59 2.0 ? ? Compute Node - 665 - 486 + 653 + 414 ? ? @@ -499,8 +499,8 @@ - 19/1/2005 - 12:17:7 - 19/1/2005 - 12:17:7 + 8/3/2005 - 16:55:59 + 8/3/2005 - 16:55:59 2.0 ? ? @@ -524,6 +524,12 @@ a +IsEven + a + Puta + a + + PrintOdd Branch EmptyNode @@ -550,10 +556,16 @@ Default a - Puta + EndOfSwitch a +Default + Branch + EndOfSwitch + Branch + + Default Branch PutBranch @@ -734,6 +746,12 @@ 362 239 +Switch + Default + EndOfSwitch + Default + + EndOfSwitch a EndOfInitLoopSwitch @@ -753,7 +771,7 @@ -GraphSwitchCheckDefault2NOTValid2 +GraphSwitchCheckDefault2NOTValid2_1 InitLoopSwitch__Index InitLoopSwitch Index @@ -762,7 +780,7 @@ 0 -GraphSwitchCheckDefault2NOTValid2 +GraphSwitchCheckDefault2NOTValid2_1 InitLoopSwitch__Min InitLoopSwitch Min @@ -771,7 +789,7 @@ -5 -GraphSwitchCheckDefault2NOTValid2 +GraphSwitchCheckDefault2NOTValid2_1 InitLoopSwitch__Max InitLoopSwitch Max diff --git a/examples/GraphSwitchCheckNoDefault2.py b/examples/GraphSwitchCheckNoDefault2.py new file mode 100644 index 0000000..55ee62f --- /dev/null +++ b/examples/GraphSwitchCheckNoDefault2.py @@ -0,0 +1,332 @@ + +# Generated python file of Graph GraphSwitchCheckNoDefault2 + +from SuperV import * + +# Graph creation of GraphSwitchCheckNoDefault2 +def DefGraphSwitchCheckNoDefault2() : + GraphSwitchCheckNoDefault2 = Graph( 'GraphSwitchCheckNoDefault2' ) + GraphSwitchCheckNoDefault2.SetName( 'GraphSwitchCheckNoDefault2' ) + GraphSwitchCheckNoDefault2.SetAuthor( 'JR' ) + GraphSwitchCheckNoDefault2.SetComment( '' ) + GraphSwitchCheckNoDefault2.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsOdd = [] + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd(a) : ' ) + PyIsOdd.append( ' print a,"IsOdd (GraphSwitch)" ' ) + PyIsOdd.append( ' sleep( 1 ) ' ) + PyIsOdd.append( ' return a ' ) + IsOdd = GraphSwitchCheckNoDefault2.INode( 'IsOdd' , PyIsOdd ) + IsOdd.SetName( 'IsOdd' ) + IsOdd.SetAuthor( '' ) + IsOdd.SetComment( 'Python function' ) + IsOdd.Coords( 415 , 7 ) + IIsOdda = IsOdd.InPort( 'a' , 'long' ) + IIsOddGate = IsOdd.GetInPort( 'Gate' ) + OIsOdda = IsOdd.OutPort( 'a' , 'long' ) + OIsOddGate = IsOdd.GetOutPort( 'Gate' ) + + PyIsEven = [] + PyIsEven.append( 'from time import * ' ) + PyIsEven.append( 'def IsEven(a) : ' ) + PyIsEven.append( ' print a,"IsEven (GraphSwitch)" ' ) + PyIsEven.append( ' sleep( 1 ) ' ) + PyIsEven.append( ' return a ' ) + IsEven = GraphSwitchCheckNoDefault2.INode( 'IsEven' , PyIsEven ) + IsEven.SetName( 'IsEven' ) + IsEven.SetAuthor( '' ) + IsEven.SetComment( 'Compute Node' ) + IsEven.Coords( 421 , 438 ) + IIsEvena = IsEven.InPort( 'a' , 'long' ) + IIsEvenGate = IsEven.GetInPort( 'Gate' ) + OIsEvena = IsEven.OutPort( 'a' , 'long' ) + OIsEvenGate = IsEven.GetOutPort( 'Gate' ) + + PyPrintOdd = [] + PyPrintOdd.append( 'from time import * ' ) + PyPrintOdd.append( 'def Print(a,Branch) : ' ) + PyPrintOdd.append( ' print "Print ",a,Branch ' ) + PyPrintOdd.append( ' sleep(1) ' ) + PyPrintOdd.append( ' return Branch ' ) + PrintOdd = GraphSwitchCheckNoDefault2.INode( 'Print' , PyPrintOdd ) + PrintOdd.SetName( 'PrintOdd' ) + PrintOdd.SetAuthor( '' ) + PrintOdd.SetComment( 'Compute Node' ) + PrintOdd.Coords( 415 , 130 ) + IPrintOdda = PrintOdd.InPort( 'a' , 'long' ) + IPrintOddBranch = PrintOdd.InPort( 'Branch' , 'string' ) + IPrintOddGate = PrintOdd.GetInPort( 'Gate' ) + OPrintOddBranch = PrintOdd.OutPort( 'Branch' , 'string' ) + OPrintOddGate = PrintOdd.GetOutPort( 'Gate' ) + + PyPrintEven = [] + PyPrintEven.append( 'from time import * ' ) + PyPrintEven.append( 'def Print_1(a,Branch) : ' ) + PyPrintEven.append( ' print "Print ",a,Branch ' ) + PyPrintEven.append( ' sleep(1) ' ) + PyPrintEven.append( ' return Branch ' ) + PrintEven = GraphSwitchCheckNoDefault2.INode( 'Print_1' , PyPrintEven ) + PrintEven.SetName( 'PrintEven' ) + PrintEven.SetAuthor( '' ) + PrintEven.SetComment( 'Compute Node' ) + PrintEven.Coords( 423 , 289 ) + IPrintEvena = PrintEven.InPort( 'a' , 'long' ) + IPrintEvenBranch = PrintEven.InPort( 'Branch' , 'string' ) + IPrintEvenGate = PrintEven.GetInPort( 'Gate' ) + OPrintEvenBranch = PrintEven.OutPort( 'Branch' , 'string' ) + OPrintEvenGate = PrintEven.GetOutPort( 'Gate' ) + + PyEmptyNode = [] + PyEmptyNode.append( 'from time import * ' ) + PyEmptyNode.append( 'def EmptyNode(a,Branch) : ' ) + PyEmptyNode.append( ' sleep(1) ' ) + PyEmptyNode.append( ' return a,Branch ' ) + EmptyNode = GraphSwitchCheckNoDefault2.INode( 'EmptyNode' , PyEmptyNode ) + EmptyNode.SetName( 'EmptyNode' ) + EmptyNode.SetAuthor( '' ) + EmptyNode.SetComment( 'Compute Node' ) + EmptyNode.Coords( 652 , 110 ) + IEmptyNodea = EmptyNode.InPort( 'a' , 'long' ) + IEmptyNodeBranch = EmptyNode.InPort( 'Branch' , 'string' ) + IEmptyNodeGate = EmptyNode.GetInPort( 'Gate' ) + OEmptyNodea = EmptyNode.OutPort( 'a' , 'long' ) + OEmptyNodeBranch = EmptyNode.OutPort( 'Branch' , 'string' ) + OEmptyNodeGate = EmptyNode.GetOutPort( 'Gate' ) + + PyDefault = [] + PyDefault.append( 'from time import * ' ) + PyDefault.append( 'def Default(a,Branch) : ' ) + PyDefault.append( ' sleep(1) ' ) + PyDefault.append( ' return a,Branch ' ) + Default = GraphSwitchCheckNoDefault2.INode( 'Default' , PyDefault ) + Default.SetName( 'Default' ) + Default.SetAuthor( '' ) + Default.SetComment( 'Compute Node' ) + Default.Coords( 421 , 592 ) + IDefaulta = Default.InPort( 'a' , 'long' ) + IDefaultBranch = Default.InPort( 'Branch' , 'string' ) + IDefaultGate = Default.GetInPort( 'Gate' ) + ODefaulta = Default.OutPort( 'a' , 'long' ) + ODefaultBranch = Default.OutPort( 'Branch' , 'string' ) + ODefaultGate = Default.GetOutPort( 'Gate' ) + + PyPuta = [] + PyPuta.append( 'from time import * ' ) + PyPuta.append( 'def Puta(a) : ' ) + PyPuta.append( ' sleep(1) ' ) + PyPuta.append( ' return a ' ) + Puta = GraphSwitchCheckNoDefault2.INode( 'Puta' , PyPuta ) + Puta.SetName( 'Puta' ) + Puta.SetAuthor( '' ) + Puta.SetComment( 'Compute Node' ) + Puta.Coords( 665 , 486 ) + IPutaa = Puta.InPort( 'a' , 'long' ) + IPutaGate = Puta.GetInPort( 'Gate' ) + OPutaa = Puta.OutPort( 'a' , 'long' ) + OPutaGate = Puta.GetOutPort( 'Gate' ) + + PyPutBranch = [] + PyPutBranch.append( 'from time import * ' ) + PyPutBranch.append( 'def PutBranch(Branch) : ' ) + PyPutBranch.append( ' sleep(1) ' ) + PyPutBranch.append( ' return Branch ' ) + PutBranch = GraphSwitchCheckNoDefault2.INode( 'PutBranch' , PyPutBranch ) + PutBranch.SetName( 'PutBranch' ) + PutBranch.SetAuthor( '' ) + PutBranch.SetComment( 'Compute Node' ) + PutBranch.Coords( 662 , 613 ) + IPutBranchBranch = PutBranch.InPort( 'Branch' , 'string' ) + IPutBranchGate = PutBranch.GetInPort( 'Gate' ) + OPutBranchBranch = PutBranch.OutPort( 'Branch' , 'string' ) + OPutBranchGate = PutBranch.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyInitLoopSwitch = [] + PyInitLoopSwitch.append( 'def InitLoop(Index,Min,Max) : ' ) + PyInitLoopSwitch.append( ' Index = Max ' ) + PyInitLoopSwitch.append( ' return Index,Min,Max ' ) + PyMoreInitLoopSwitch = [] + PyMoreInitLoopSwitch.append( 'from time import * ' ) + PyMoreInitLoopSwitch.append( 'def MoreLoop(Index,Min,Max) : ' ) + PyMoreInitLoopSwitch.append( ' sleep(1) ' ) + PyMoreInitLoopSwitch.append( ' if Index >= Min : ' ) + PyMoreInitLoopSwitch.append( ' DoLoop = 1 ' ) + PyMoreInitLoopSwitch.append( ' else : ' ) + PyMoreInitLoopSwitch.append( ' DoLoop = 0 ' ) + PyMoreInitLoopSwitch.append( ' return DoLoop,Index,Min,Max ' ) + PyNextInitLoopSwitch = [] + PyNextInitLoopSwitch.append( 'def NextLoop(Index,Min,Max) : ' ) + PyNextInitLoopSwitch.append( ' Index = Index - 1 ' ) + PyNextInitLoopSwitch.append( ' return Index,Min,Max ' ) + InitLoopSwitch,EndOfInitLoopSwitch = GraphSwitchCheckNoDefault2.LNode( 'InitLoop' , PyInitLoopSwitch , 'MoreLoop' , PyMoreInitLoopSwitch , 'NextLoop' , PyNextInitLoopSwitch ) + EndOfInitLoopSwitch.SetName( 'EndOfInitLoopSwitch' ) + EndOfInitLoopSwitch.SetAuthor( '' ) + EndOfInitLoopSwitch.SetComment( 'Compute Node' ) + EndOfInitLoopSwitch.Coords( 1074 , 194 ) + PyEndOfInitLoopSwitch = [] + PyEndOfInitLoopSwitch.append( 'from time import * ' ) + PyEndOfInitLoopSwitch.append( 'def EndOfInitLoopSwitch(DoLoop,Index,Min,Max) : ' ) + PyEndOfInitLoopSwitch.append( ' sleep(1) ' ) + PyEndOfInitLoopSwitch.append( ' return DoLoop,Index,Min,Max ' ) + EndOfInitLoopSwitch.SetPyFunction( 'EndOfInitLoopSwitch' , PyEndOfInitLoopSwitch ) + IInitLoopSwitchDoLoop = InitLoopSwitch.GetInPort( 'DoLoop' ) + IInitLoopSwitchIndex = InitLoopSwitch.InPort( 'Index' , 'long' ) + IInitLoopSwitchMin = InitLoopSwitch.InPort( 'Min' , 'long' ) + IInitLoopSwitchMax = InitLoopSwitch.InPort( 'Max' , 'long' ) + IInitLoopSwitchGate = InitLoopSwitch.GetInPort( 'Gate' ) + OInitLoopSwitchDoLoop = InitLoopSwitch.GetOutPort( 'DoLoop' ) + OInitLoopSwitchIndex = InitLoopSwitch.GetOutPort( 'Index' ) + OInitLoopSwitchMin = InitLoopSwitch.GetOutPort( 'Min' ) + OInitLoopSwitchMax = InitLoopSwitch.GetOutPort( 'Max' ) + IEndOfInitLoopSwitchDoLoop = EndOfInitLoopSwitch.GetInPort( 'DoLoop' ) + IEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetInPort( 'Index' ) + IEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetInPort( 'Min' ) + IEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetInPort( 'Max' ) + IEndOfInitLoopSwitchGate = EndOfInitLoopSwitch.GetInPort( 'Gate' ) + OEndOfInitLoopSwitchDoLoop = EndOfInitLoopSwitch.GetOutPort( 'DoLoop' ) + OEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetOutPort( 'Index' ) + OEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetOutPort( 'Min' ) + OEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetOutPort( 'Max' ) + OEndOfInitLoopSwitchGate = EndOfInitLoopSwitch.GetOutPort( 'Gate' ) + InitLoopSwitch.SetName( 'InitLoopSwitch' ) + InitLoopSwitch.SetAuthor( '' ) + InitLoopSwitch.SetComment( 'Compute Node' ) + InitLoopSwitch.Coords( 10 , 129 ) + + # Creation of Switch Nodes + PySwitch = [] + PySwitch.append( 'from time import * ' ) + PySwitch.append( 'def Switch(a) : ' ) + PySwitch.append( ' sleep(1) ' ) + PySwitch.append( ' Branch = "Negative or null" ' ) + PySwitch.append( ' if a <= 0 : ' ) + PySwitch.append( ' return 0,0,a,Branch,1 ' ) + PySwitch.append( ' if ( a & 1 ) == 0 : ' ) + PySwitch.append( ' Branch = "Even" ' ) + PySwitch.append( ' else : ' ) + PySwitch.append( ' Branch = "Odd" ' ) + PySwitch.append( ' return a & 1,1-(a&1),a,Branch,0 ' ) + Switch,EndOfSwitch = GraphSwitchCheckNoDefault2.SNode( 'Switch' , PySwitch ) + EndOfSwitch.SetName( 'EndOfSwitch' ) + EndOfSwitch.SetAuthor( '' ) + EndOfSwitch.SetComment( 'Compute Node' ) + EndOfSwitch.Coords( 882 , 194 ) + PyEndOfSwitch = [] + PyEndOfSwitch.append( 'from time import * ' ) + PyEndOfSwitch.append( 'def EndOfSwitch(a,Branch) : ' ) + PyEndOfSwitch.append( ' sleep(1) ' ) + PyEndOfSwitch.append( ' return a ' ) + EndOfSwitch.SetPyFunction( 'EndOfSwitch' , PyEndOfSwitch ) + IEndOfSwitcha = EndOfSwitch.InPort( 'a' , 'long' ) + IEndOfSwitchBranch = EndOfSwitch.InPort( 'Branch' , 'string' ) + IEndOfSwitchDefault = EndOfSwitch.GetInPort( 'Default' ) + OEndOfSwitcha = EndOfSwitch.OutPort( 'a' , 'long' ) + OEndOfSwitchGate = EndOfSwitch.GetOutPort( 'Gate' ) + Switch.SetName( 'Switch' ) + Switch.SetAuthor( '' ) + Switch.SetComment( 'Compute Node' ) + Switch.Coords( 190 , 129 ) + ISwitcha = Switch.InPort( 'a' , 'long' ) + ISwitchGate = Switch.GetInPort( 'Gate' ) + OSwitchOdd = Switch.OutPort( 'Odd' , 'long' ) + OSwitchEven = Switch.OutPort( 'Even' , 'int' ) + OSwitcha = Switch.OutPort( 'a' , 'int' ) + OSwitchBranch = Switch.OutPort( 'Branch' , 'string' ) + OSwitchdefault = Switch.OutPort( 'default' , 'boolean' ) + OSwitchDefault = Switch.GetOutPort( 'Default' ) + + # Creation of Links + LIsOddaEmptyNodea = GraphSwitchCheckNoDefault2.Link( OIsOdda , IEmptyNodea ) + LIsOddaEmptyNodea.AddCoord( 1 , 646 , 78 ) + + LIsEvenaEndOfSwitcha = GraphSwitchCheckNoDefault2.Link( OIsEvena , IEndOfSwitcha ) + + LPrintOddBranchEmptyNodeBranch = GraphSwitchCheckNoDefault2.Link( OPrintOddBranch , IEmptyNodeBranch ) + + LPrintEvenBranchEndOfSwitchBranch = GraphSwitchCheckNoDefault2.Link( OPrintEvenBranch , IEndOfSwitchBranch ) + + LEmptyNodeaEndOfSwitcha = GraphSwitchCheckNoDefault2.Link( OEmptyNodea , IEndOfSwitcha ) + + LEmptyNodeBranchEndOfSwitchBranch = GraphSwitchCheckNoDefault2.Link( OEmptyNodeBranch , IEndOfSwitchBranch ) + + LDefaultaPutaa = GraphSwitchCheckNoDefault2.Link( ODefaulta , IPutaa ) + + LDefaultBranchPutBranchBranch = GraphSwitchCheckNoDefault2.Link( ODefaultBranch , IPutBranchBranch ) + + LInitLoopSwitchIndexSwitcha = GraphSwitchCheckNoDefault2.Link( OInitLoopSwitchIndex , ISwitcha ) + + LInitLoopSwitchMinEndOfInitLoopSwitchMin = GraphSwitchCheckNoDefault2.Link( OInitLoopSwitchMin , IEndOfInitLoopSwitchMin ) + + LInitLoopSwitchMaxEndOfInitLoopSwitchMax = GraphSwitchCheckNoDefault2.Link( OInitLoopSwitchMax , IEndOfInitLoopSwitchMax ) + + LSwitchOddIsOddGate = GraphSwitchCheckNoDefault2.Link( OSwitchOdd , IIsOddGate ) + LSwitchOddIsOddGate.AddCoord( 1 , 401 , 101 ) + LSwitchOddIsOddGate.AddCoord( 2 , 401 , 160 ) + + LSwitchOddPrintOddGate = GraphSwitchCheckNoDefault2.Link( OSwitchOdd , IPrintOddGate ) + LSwitchOddPrintOddGate.AddCoord( 1 , 401 , 245 ) + LSwitchOddPrintOddGate.AddCoord( 2 , 401 , 159 ) + + LSwitchEvenIsEvenGate = GraphSwitchCheckNoDefault2.Link( OSwitchEven , IIsEvenGate ) + LSwitchEvenIsEvenGate.AddCoord( 1 , 392 , 533 ) + LSwitchEvenIsEvenGate.AddCoord( 2 , 392 , 182 ) + + LSwitchEvenPrintEvenGate = GraphSwitchCheckNoDefault2.Link( OSwitchEven , IPrintEvenGate ) + LSwitchEvenPrintEvenGate.AddCoord( 1 , 392 , 403 ) + LSwitchEvenPrintEvenGate.AddCoord( 2 , 392 , 181 ) + + LSwitchaIsOdda = GraphSwitchCheckNoDefault2.Link( OSwitcha , IIsOdda ) + LSwitchaIsOdda.AddCoord( 1 , 382 , 78 ) + LSwitchaIsOdda.AddCoord( 2 , 382 , 199 ) + + LSwitchaIsEvena = GraphSwitchCheckNoDefault2.Link( OSwitcha , IIsEvena ) + LSwitchaIsEvena.AddCoord( 1 , 381 , 509 ) + LSwitchaIsEvena.AddCoord( 2 , 382 , 200 ) + + LSwitchaPrintOdda = GraphSwitchCheckNoDefault2.Link( OSwitcha , IPrintOdda ) + + LSwitchaPrintEvena = GraphSwitchCheckNoDefault2.Link( OSwitcha , IPrintEvena ) + LSwitchaPrintEvena.AddCoord( 1 , 381 , 361 ) + LSwitchaPrintEvena.AddCoord( 2 , 382 , 200 ) + + LSwitchaDefaulta = GraphSwitchCheckNoDefault2.Link( OSwitcha , IDefaulta ) + LSwitchaDefaulta.AddCoord( 1 , 382 , 663 ) + LSwitchaDefaulta.AddCoord( 2 , 382 , 199 ) + + LSwitchBranchPrintOddBranch = GraphSwitchCheckNoDefault2.Link( OSwitchBranch , IPrintOddBranch ) + + LSwitchBranchPrintEvenBranch = GraphSwitchCheckNoDefault2.Link( OSwitchBranch , IPrintEvenBranch ) + LSwitchBranchPrintEvenBranch.AddCoord( 1 , 369 , 381 ) + LSwitchBranchPrintEvenBranch.AddCoord( 2 , 369 , 219 ) + + LSwitchBranchDefaultBranch = GraphSwitchCheckNoDefault2.Link( OSwitchBranch , IDefaultBranch ) + LSwitchBranchDefaultBranch.AddCoord( 1 , 370 , 683 ) + LSwitchBranchDefaultBranch.AddCoord( 2 , 370 , 220 ) + + LSwitchdefaultDefaultGate = GraphSwitchCheckNoDefault2.Link( OSwitchdefault , IDefaultGate ) + LSwitchdefaultDefaultGate.AddCoord( 1 , 363 , 707 ) + LSwitchdefaultDefaultGate.AddCoord( 2 , 362 , 239 ) + + LEndOfSwitchaEndOfInitLoopSwitchIndex = GraphSwitchCheckNoDefault2.Link( OEndOfSwitcha , IEndOfInitLoopSwitchIndex ) + + LPutaaEndOfSwitcha = GraphSwitchCheckNoDefault2.Link( OPutaa , IEndOfSwitcha ) + + LPutBranchBranchEndOfSwitchBranch = GraphSwitchCheckNoDefault2.Link( OPutBranchBranch , IEndOfSwitchBranch ) + + # Input datas + IInitLoopSwitchIndex.Input( 0 ) + IInitLoopSwitchMin.Input( -5 ) + IInitLoopSwitchMax.Input( 10 ) + + # Output Ports of the graph + #OEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetOutPort( 'Index' ) + #OEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetOutPort( 'Min' ) + #OEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetOutPort( 'Max' ) + return GraphSwitchCheckNoDefault2 + + +GraphSwitchCheckNoDefault2 = DefGraphSwitchCheckNoDefault2() diff --git a/examples/GraphSwitchCheckNoDefault2.xml b/examples/GraphSwitchCheckNoDefault2.xml new file mode 100644 index 0000000..d7ccd5e --- /dev/null +++ b/examples/GraphSwitchCheckNoDefault2.xml @@ -0,0 +1,781 @@ + + + + + +? + ? + GraphSwitchCheckNoDefault2 + 1 + ? + +GraphSwitchCheckDefault2NOTValid2 + + +long + InitLoopSwitch__Index + +long + InitLoopSwitch__Min + +long + InitLoopSwitch__Max + + +long + EndOfInitLoopSwitch__Index + +long + EndOfInitLoopSwitch__Min + +long + EndOfInitLoopSwitch__Max + + + 13/1/2005 - 12:21:43 + 14/2/2005 - 14:13:3 + 2.0 + JR + ? + ? + 0 + 0 + + +? + ? + IsOdd + 3 + ? + +IsOdd + + +long + a + + +long + a + + + +IsOdd + + + + + + 14/2/2005 - 14:13:3 + 14/2/2005 - 14:13:3 + 2.0 + ? + ? + Python function + 415 + 7 + +? + ? + IsEven + 3 + ? + +IsEven + + +long + a + + +long + a + + + +IsEven + + + + + + 14/2/2005 - 14:13:3 + 14/2/2005 - 14:13:3 + 2.0 + ? + ? + Compute Node + 421 + 438 + +? + ? + PrintOdd + 3 + ? + +PrintOdd + + +long + a + +string + Branch + + +string + Branch + + + +Print + + + + + + 14/2/2005 - 14:13:3 + 14/2/2005 - 14:13:3 + 2.0 + ? + ? + Compute Node + 415 + 130 + +? + ? + PrintEven + 3 + ? + +PrintEven + + +long + a + +string + Branch + + +string + Branch + + + +Print_1 + + + + + + 14/2/2005 - 14:13:3 + 14/2/2005 - 14:13:3 + 2.0 + ? + ? + Compute Node + 423 + 289 + +? + ? + EmptyNode + 3 + ? + +EmptyNode + + +long + a + +string + Branch + + +long + a + +string + Branch + + + +EmptyNode + + + + + 14/2/2005 - 14:13:3 + 14/2/2005 - 14:13:3 + 2.0 + ? + ? + Compute Node + 652 + 110 + +? + ? + Default + 3 + ? + +Default + + +long + a + +string + Branch + + +long + a + +string + Branch + + + +Default + + + + + 14/2/2005 - 14:13:3 + 14/2/2005 - 14:13:3 + 2.0 + ? + ? + Compute Node + 421 + 592 + +? + ? + InitLoopSwitch + 4 + EndOfInitLoopSwitch + +InitLoopSwitch + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +InitLoop + + + + +MoreLoop + + + + = Min : ]]> + + + + + +NextLoop + + + + 14/2/2005 - 14:13:3 + 14/2/2005 - 14:13:3 + 2.0 + ? + ? + Compute Node + 10 + 129 + +? + ? + EndOfInitLoopSwitch + 5 + InitLoopSwitch + +EndOfInitLoopSwitch + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +EndOfInitLoopSwitch + + + + + 14/2/2005 - 14:13:3 + 14/2/2005 - 14:13:3 + 2.0 + ? + ? + Compute Node + 1074 + 194 + +? + ? + Switch + 6 + EndOfSwitch + +Switch + + +long + a + + +long + Odd + +int + Even + +int + a + +string + Branch + +boolean + default + + + +Switch + + + + + + + + + + + + 14/2/2005 - 14:13:3 + 14/2/2005 - 14:13:3 + 2.0 + ? + ? + Compute Node + 190 + 129 + +? + ? + EndOfSwitch + 7 + Switch + +EndOfSwitch + + +long + a + +string + Branch + + +long + a + + + +EndOfSwitch + + + + + 14/2/2005 - 14:13:3 + 14/2/2005 - 14:13:3 + 2.0 + ? + ? + Compute Node + 882 + 194 + +? + ? + Puta + 3 + ? + +Puta + + +long + a + + +long + a + + + +Puta + + + + + 14/2/2005 - 14:13:3 + 14/2/2005 - 14:13:3 + 2.0 + ? + ? + Compute Node + 665 + 486 + +? + ? + PutBranch + 3 + ? + +PutBranch + + +string + Branch + + +string + Branch + + + +PutBranch + + + + + 14/2/2005 - 14:13:3 + 14/2/2005 - 14:13:3 + 2.0 + ? + ? + Compute Node + 662 + 613 + + +IsOdd + a + EmptyNode + a + + +646 + 78 + +IsEven + a + EndOfSwitch + a + + +PrintOdd + Branch + EmptyNode + Branch + + +PrintEven + Branch + EndOfSwitch + Branch + + +EmptyNode + a + EndOfSwitch + a + + +EmptyNode + Branch + EndOfSwitch + Branch + + +Default + a + Puta + a + + +Default + Branch + PutBranch + Branch + + +InitLoopSwitch + DoLoop + EndOfInitLoopSwitch + DoLoop + + +InitLoopSwitch + Index + Switch + a + + +InitLoopSwitch + Min + EndOfInitLoopSwitch + Min + + +InitLoopSwitch + Max + EndOfInitLoopSwitch + Max + + +EndOfInitLoopSwitch + DoLoop + InitLoopSwitch + DoLoop + + +Switch + Odd + IsOdd + Gate + + +401 + 101 + +401 + 160 + +Switch + Odd + PrintOdd + Gate + + +401 + 245 + +401 + 159 + +Switch + Even + IsEven + Gate + + +392 + 533 + +392 + 182 + +Switch + Even + PrintEven + Gate + + +392 + 403 + +392 + 181 + +Switch + a + IsOdd + a + + +382 + 78 + +382 + 199 + +Switch + a + IsEven + a + + +381 + 509 + +382 + 200 + +Switch + a + PrintOdd + a + + +Switch + a + PrintEven + a + + +381 + 361 + +382 + 200 + +Switch + a + Default + a + + +382 + 663 + +382 + 199 + +Switch + Branch + PrintOdd + Branch + + +Switch + Branch + PrintEven + Branch + + +369 + 381 + +369 + 219 + +Switch + Branch + Default + Branch + + +370 + 683 + +370 + 220 + +Switch + default + Default + Gate + + +363 + 707 + +362 + 239 + +EndOfSwitch + a + EndOfInitLoopSwitch + Index + + +Puta + a + EndOfSwitch + a + + +PutBranch + Branch + EndOfSwitch + Branch + + + +GraphSwitchCheckNoDefault2 + InitLoopSwitch__Index + InitLoopSwitch + Index + +3 + 0 + + +GraphSwitchCheckNoDefault2 + InitLoopSwitch__Min + InitLoopSwitch + Min + +3 + -5 + + +GraphSwitchCheckNoDefault2 + InitLoopSwitch__Max + InitLoopSwitch + Max + +3 + 10 + diff --git a/examples/GraphSwitchCrash.py b/examples/GraphSwitchCrash.py index f22827a..59443ba 100755 --- a/examples/GraphSwitchCrash.py +++ b/examples/GraphSwitchCrash.py @@ -1,237 +1,260 @@ -# Generated python file of Graph GraphSwitchCrash +# Generated python file of Graph GraphSwitchCrash_1 from SuperV import * -# Graph creation -GraphSwitchCrash = Graph( 'GraphSwitchCrash' ) -GraphSwitchCrash.SetName( 'GraphSwitchCrash' ) -GraphSwitchCrash.SetAuthor( '' ) -GraphSwitchCrash.SetComment( '' ) -GraphSwitchCrash.Coords( 0 , 0 ) -# Creation of Factory Nodes +# Graph creation of GraphSwitchCrash_1 +def DefGraphSwitchCrash_1() : + GraphSwitchCrash_1 = Graph( 'GraphSwitchCrash_1' ) + GraphSwitchCrash_1.SetName( 'GraphSwitchCrash_1' ) + GraphSwitchCrash_1.SetAuthor( '' ) + GraphSwitchCrash_1.SetComment( '' ) + GraphSwitchCrash_1.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsOdd = [] + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd(a) : ' ) + PyIsOdd.append( ' print a,"IsOdd (IsOdd)" ' ) + PyIsOdd.append( ' sleep( 1 ) ' ) + PyIsOdd.append( ' return a ' ) + IsOdd = GraphSwitchCrash_1.INode( 'IsOdd' , PyIsOdd ) + IsOdd.SetName( 'IsOdd' ) + IsOdd.SetAuthor( '' ) + IsOdd.SetComment( 'Python function' ) + IsOdd.Coords( 387 , 58 ) + IIsOdda = IsOdd.InPort( 'a' , 'long' ) + IIsOddGate = IsOdd.GetInPort( 'Gate' ) + OIsOdda = IsOdd.OutPort( 'a' , 'long' ) + OIsOddGate = IsOdd.GetOutPort( 'Gate' ) + + PyIsOdd_1 = [] + PyIsOdd_1.append( 'from time import * ' ) + PyIsOdd_1.append( 'def IsOdd(a,Even) : ' ) + PyIsOdd_1.append( ' print a,"IsOdd (IsOdd_1)" ' ) + PyIsOdd_1.append( ' sleep( 1 ) ' ) + PyIsOdd_1.append( ' return a ' ) + IsOdd_1 = GraphSwitchCrash_1.INode( 'IsOdd' , PyIsOdd_1 ) + IsOdd_1.SetName( 'IsOdd_1' ) + IsOdd_1.SetAuthor( '' ) + IsOdd_1.SetComment( 'Python function' ) + IsOdd_1.Coords( 417 , 287 ) + IIsOdd_1a = IsOdd_1.InPort( 'a' , 'long' ) + IIsOdd_1Even = IsOdd_1.InPort( 'Even' , 'boolean' ) + IIsOdd_1Gate = IsOdd_1.GetInPort( 'Gate' ) + OIsOdd_1a = IsOdd_1.OutPort( 'a' , 'long' ) + OIsOdd_1Gate = IsOdd_1.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyInitLoopSwitch = [] + PyInitLoopSwitch.append( 'def InitLoop(Index,Min,Max) : ' ) + PyInitLoopSwitch.append( ' return Index,Min,Max ' ) + PyMoreInitLoopSwitch = [] + PyMoreInitLoopSwitch.append( 'def MoreLoop(Index,Min,Max) : ' ) + PyMoreInitLoopSwitch.append( ' if Index <= Max : ' ) + PyMoreInitLoopSwitch.append( ' DoLoop = 1 ' ) + PyMoreInitLoopSwitch.append( ' else : ' ) + PyMoreInitLoopSwitch.append( ' DoLoop = 0 ' ) + PyMoreInitLoopSwitch.append( ' return DoLoop,Index,Min,Max ' ) + PyNextInitLoopSwitch = [] + PyNextInitLoopSwitch.append( 'def NextLoop(Index,Min,Max) : ' ) + PyNextInitLoopSwitch.append( ' Index = Index + 1 ' ) + PyNextInitLoopSwitch.append( ' return Index,Min,Max ' ) + InitLoopSwitch,EndOfInitLoopSwitch = GraphSwitchCrash_1.LNode( 'InitLoop' , PyInitLoopSwitch , 'MoreLoop' , PyMoreInitLoopSwitch , 'NextLoop' , PyNextInitLoopSwitch ) + EndOfInitLoopSwitch.SetName( 'EndOfInitLoopSwitch' ) + EndOfInitLoopSwitch.SetAuthor( '' ) + EndOfInitLoopSwitch.SetComment( 'Compute Node' ) + EndOfInitLoopSwitch.Coords( 766 , 127 ) + PyEndOfInitLoopSwitch = [] + EndOfInitLoopSwitch.SetPyFunction( '' , PyEndOfInitLoopSwitch ) + IInitLoopSwitchDoLoop = InitLoopSwitch.GetInPort( 'DoLoop' ) + IInitLoopSwitchIndex = InitLoopSwitch.InPort( 'Index' , 'long' ) + IInitLoopSwitchMin = InitLoopSwitch.InPort( 'Min' , 'long' ) + IInitLoopSwitchMax = InitLoopSwitch.InPort( 'Max' , 'long' ) + IInitLoopSwitchGate = InitLoopSwitch.GetInPort( 'Gate' ) + OInitLoopSwitchDoLoop = InitLoopSwitch.GetOutPort( 'DoLoop' ) + OInitLoopSwitchIndex = InitLoopSwitch.GetOutPort( 'Index' ) + OInitLoopSwitchMin = InitLoopSwitch.GetOutPort( 'Min' ) + OInitLoopSwitchMax = InitLoopSwitch.GetOutPort( 'Max' ) + IEndOfInitLoopSwitchDoLoop = EndOfInitLoopSwitch.GetInPort( 'DoLoop' ) + IEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetInPort( 'Index' ) + IEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetInPort( 'Min' ) + IEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetInPort( 'Max' ) + IEndOfInitLoopSwitchGate = EndOfInitLoopSwitch.GetInPort( 'Gate' ) + OEndOfInitLoopSwitchDoLoop = EndOfInitLoopSwitch.GetOutPort( 'DoLoop' ) + OEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetOutPort( 'Index' ) + OEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetOutPort( 'Min' ) + OEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetOutPort( 'Max' ) + OEndOfInitLoopSwitchGate = EndOfInitLoopSwitch.GetOutPort( 'Gate' ) + InitLoopSwitch.SetName( 'InitLoopSwitch' ) + InitLoopSwitch.SetAuthor( '' ) + InitLoopSwitch.SetComment( 'Compute Node' ) + InitLoopSwitch.Coords( 10 , 129 ) + + PyInitLoop = [] + PyInitLoop.append( 'def InitLoop(Index,Min,Max) : ' ) + PyInitLoop.append( ' return Index,Min,Max ' ) + PyMoreInitLoop = [] + PyMoreInitLoop.append( 'def MoreLoop(Index,Min,Max) : ' ) + PyMoreInitLoop.append( ' if Index <= Max : ' ) + PyMoreInitLoop.append( ' DoLoop = 1 ' ) + PyMoreInitLoop.append( ' else : ' ) + PyMoreInitLoop.append( ' DoLoop = 0 ' ) + PyMoreInitLoop.append( ' return DoLoop,Index,Min,Max ' ) + PyNextInitLoop = [] + PyNextInitLoop.append( 'def NextLoop(Index,Min,Max) : ' ) + PyNextInitLoop.append( ' Index = Index + 1 ' ) + PyNextInitLoop.append( ' return Index,Min,Max ' ) + InitLoop,EndOfInitLoop = GraphSwitchCrash_1.LNode( 'InitLoop' , PyInitLoop , 'MoreLoop' , PyMoreInitLoop , 'NextLoop' , PyNextInitLoop ) + EndOfInitLoop.SetName( 'EndOfInitLoop' ) + EndOfInitLoop.SetAuthor( '' ) + EndOfInitLoop.SetComment( 'Compute Node' ) + EndOfInitLoop.Coords( 783 , 381 ) + PyEndOfInitLoop = [] + EndOfInitLoop.SetPyFunction( '' , PyEndOfInitLoop ) + IInitLoopDoLoop = InitLoop.GetInPort( 'DoLoop' ) + IInitLoopIndex = InitLoop.InPort( 'Index' , 'long' ) + IInitLoopMin = InitLoop.InPort( 'Min' , 'long' ) + IInitLoopMax = InitLoop.InPort( 'Max' , 'long' ) + IInitLoopGate = InitLoop.GetInPort( 'Gate' ) + OInitLoopDoLoop = InitLoop.GetOutPort( 'DoLoop' ) + OInitLoopIndex = InitLoop.GetOutPort( 'Index' ) + OInitLoopMin = InitLoop.GetOutPort( 'Min' ) + OInitLoopMax = InitLoop.GetOutPort( 'Max' ) + IEndOfInitLoopDoLoop = EndOfInitLoop.GetInPort( 'DoLoop' ) + IEndOfInitLoopIndex = EndOfInitLoop.GetInPort( 'Index' ) + IEndOfInitLoopMin = EndOfInitLoop.GetInPort( 'Min' ) + IEndOfInitLoopMax = EndOfInitLoop.GetInPort( 'Max' ) + IEndOfInitLoopGate = EndOfInitLoop.GetInPort( 'Gate' ) + OEndOfInitLoopDoLoop = EndOfInitLoop.GetOutPort( 'DoLoop' ) + OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) + OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) + OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) + OEndOfInitLoopGate = EndOfInitLoop.GetOutPort( 'Gate' ) + InitLoop.SetName( 'InitLoop' ) + InitLoop.SetAuthor( '' ) + InitLoop.SetComment( 'Compute Node' ) + InitLoop.Coords( 10 , 388 ) + + # Creation of Switch Nodes + PySwitch = [] + PySwitch.append( 'from time import * ' ) + PySwitch.append( 'def Switch(a) : ' ) + PySwitch.append( ' if ( a & 1 ) == 0 : ' ) + PySwitch.append( ' sleep(1) ' ) + PySwitch.append( ' return a & 1,1-(a&1),a ' ) + Switch,EndOfSwitch = GraphSwitchCrash_1.SNode( 'Switch' , PySwitch ) + EndOfSwitch.SetName( 'EndOfSwitch' ) + EndOfSwitch.SetAuthor( '' ) + EndOfSwitch.SetComment( 'Compute Node' ) + EndOfSwitch.Coords( 587 , 126 ) + PyEndOfSwitch = [] + EndOfSwitch.SetPyFunction( '' , PyEndOfSwitch ) + IEndOfSwitcha = EndOfSwitch.InPort( 'a' , 'long' ) + IEndOfSwitchDefault = EndOfSwitch.GetInPort( 'Default' ) + OEndOfSwitcha = EndOfSwitch.OutPort( 'a' , 'long' ) + OEndOfSwitchGate = EndOfSwitch.GetOutPort( 'Gate' ) + Switch.SetName( 'Switch' ) + Switch.SetAuthor( '' ) + Switch.SetComment( 'Compute Node' ) + Switch.Coords( 186 , 130 ) + ISwitcha = Switch.InPort( 'a' , 'long' ) + ISwitchGate = Switch.GetInPort( 'Gate' ) + OSwitchOdd = Switch.OutPort( 'Odd' , 'long' ) + OSwitchEven = Switch.OutPort( 'Even' , 'int' ) + OSwitcha = Switch.OutPort( 'a' , 'int' ) + OSwitchDefault = Switch.GetOutPort( 'Default' ) + + PySwitch_1 = [] + PySwitch_1.append( 'from time import * ' ) + PySwitch_1.append( 'def Switch(a) : ' ) + PySwitch_1.append( ' if ( a & 1 ) == 0 : ' ) + PySwitch_1.append( ' sleep(1) ' ) + PySwitch_1.append( ' return a & 1,1-(a&1),a ' ) + Switch_1,EndSwitch = GraphSwitchCrash_1.SNode( 'Switch' , PySwitch_1 ) + EndSwitch.SetName( 'EndSwitch' ) + EndSwitch.SetAuthor( '' ) + EndSwitch.SetComment( 'Compute Node' ) + EndSwitch.Coords( 605 , 382 ) + PyEndSwitch = [] + EndSwitch.SetPyFunction( '' , PyEndSwitch ) + IEndSwitcha = EndSwitch.InPort( 'a' , 'long' ) + IEndSwitchDefault = EndSwitch.GetInPort( 'Default' ) + OEndSwitcha = EndSwitch.OutPort( 'a' , 'long' ) + OEndSwitchGate = EndSwitch.GetOutPort( 'Gate' ) + Switch_1.SetName( 'Switch_1' ) + Switch_1.SetAuthor( '' ) + Switch_1.SetComment( 'Compute Node' ) + Switch_1.Coords( 193 , 388 ) + ISwitch_1a = Switch_1.InPort( 'a' , 'long' ) + ISwitch_1Gate = Switch_1.GetInPort( 'Gate' ) + OSwitch_1Odd = Switch_1.OutPort( 'Odd' , 'long' ) + OSwitch_1Even = Switch_1.OutPort( 'Even' , 'int' ) + OSwitch_1a = Switch_1.OutPort( 'a' , 'int' ) + OSwitch_1Default = Switch_1.GetOutPort( 'Default' ) + + # Creation of Links + LIsOddaEndOfSwitcha = GraphSwitchCrash_1.Link( OIsOdda , IEndOfSwitcha ) + LIsOddaEndOfSwitcha.AddCoord( 1 , 572 , 157 ) + LIsOddaEndOfSwitcha.AddCoord( 2 , 572 , 130 ) + + LInitLoopSwitchIndexSwitcha = GraphSwitchCrash_1.Link( OInitLoopSwitchIndex , ISwitcha ) + + LInitLoopSwitchMinEndOfInitLoopSwitchMin = GraphSwitchCrash_1.Link( OInitLoopSwitchMin , IEndOfInitLoopSwitchMin ) + + LInitLoopSwitchMaxEndOfInitLoopSwitchMax = GraphSwitchCrash_1.Link( OInitLoopSwitchMax , IEndOfInitLoopSwitchMax ) + + LSwitchOddIsOddGate = GraphSwitchCrash_1.Link( OSwitchOdd , IIsOddGate ) + + LSwitchaIsOdda = GraphSwitchCrash_1.Link( OSwitcha , IIsOdda ) + LSwitchaIsOdda.AddCoord( 1 , 365 , 129 ) + LSwitchaIsOdda.AddCoord( 2 , 365 , 201 ) + + LSwitchDefaultEndOfSwitchDefault = GraphSwitchCrash_1.Link( OSwitchDefault , IEndOfSwitchDefault ) + + LEndOfSwitchaEndOfInitLoopSwitchIndex = GraphSwitchCrash_1.Link( OEndOfSwitcha , IEndOfInitLoopSwitchIndex ) + + LIsOdd_1aEndSwitcha = GraphSwitchCrash_1.Link( OIsOdd_1a , IEndSwitcha ) + LIsOdd_1aEndSwitcha.AddCoord( 1 , 593 , 411 ) + LIsOdd_1aEndSwitcha.AddCoord( 2 , 593 , 358 ) + + LInitLoopIndexSwitch_1a = GraphSwitchCrash_1.Link( OInitLoopIndex , ISwitch_1a ) + + LInitLoopMinEndOfInitLoopMin = GraphSwitchCrash_1.Link( OInitLoopMin , IEndOfInitLoopMin ) + + LInitLoopMaxEndOfInitLoopMax = GraphSwitchCrash_1.Link( OInitLoopMax , IEndOfInitLoopMax ) + + LSwitch_1OddIsOdd_1Gate = GraphSwitchCrash_1.Link( OSwitch_1Odd , IIsOdd_1Gate ) + + LSwitch_1EvenIsOdd_1Even = GraphSwitchCrash_1.Link( OSwitch_1Even , IIsOdd_1Even ) + + LSwitch_1aIsOdd_1a = GraphSwitchCrash_1.Link( OSwitch_1a , IIsOdd_1a ) + LSwitch_1aIsOdd_1a.AddCoord( 1 , 377 , 358 ) + LSwitch_1aIsOdd_1a.AddCoord( 2 , 377 , 460 ) + + LSwitch_1DefaultEndSwitchDefault = GraphSwitchCrash_1.Link( OSwitch_1Default , IEndSwitchDefault ) + + LEndSwitchaEndOfInitLoopIndex = GraphSwitchCrash_1.Link( OEndSwitcha , IEndOfInitLoopIndex ) + + # Input datas + IInitLoopSwitchIndex.Input( 0 ) + IInitLoopSwitchMin.Input( 0 ) + IInitLoopSwitchMax.Input( 23 ) + IInitLoopIndex.Input( 0 ) + IInitLoopMin.Input( 0 ) + IInitLoopMax.Input( 31 ) + + # Output Ports of the graph + #OEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetOutPort( 'Index' ) + #OEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetOutPort( 'Min' ) + #OEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetOutPort( 'Max' ) + #OSwitchEven = Switch.GetOutPort( 'Even' ) + #OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) + #OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) + #OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) + return GraphSwitchCrash_1 -# Creation of InLine Nodes -PyIsOdd = [] -PyIsOdd.append( 'from time import * ' ) -PyIsOdd.append( 'def IsOdd(a) : ' ) -PyIsOdd.append( ' print a,"IsOdd (PyIsOdd)" ' ) -PyIsOdd.append( ' sleep( 1 ) ' ) -PyIsOdd.append( ' return a ' ) -IsOdd = GraphSwitchCrash.INode( 'IsOdd' , PyIsOdd ) -IsOdd.SetName( 'IsOdd' ) -IsOdd.SetAuthor( '' ) -IsOdd.SetComment( 'Python function' ) -IsOdd.Coords( 388 , 50 ) -IsOdd.InPort( 'a' , 'long' ) -IsOdd.OutPort( 'a' , 'long' ) -PyIsOdd_1 = [] -PyIsOdd_1.append( 'from time import * ' ) -PyIsOdd_1.append( 'def IsOdd(a,Even) : ' ) -PyIsOdd_1.append( ' print a,"IsOdd (PyIsOdd_1)" ' ) -PyIsOdd_1.append( ' sleep( 1 ) ' ) -PyIsOdd_1.append( ' return a ' ) -IsOdd_1 = GraphSwitchCrash.INode( 'IsOdd' , PyIsOdd_1 ) -IsOdd_1.SetName( 'IsOdd_1' ) -IsOdd_1.SetAuthor( '' ) -IsOdd_1.SetComment( 'Python function' ) -IsOdd_1.Coords( 419 , 279 ) -IsOdd_1.InPort( 'a' , 'long' ) -IsOdd_1.InPort( 'Even' , 'boolean' ) -IsOdd_1.OutPort( 'a' , 'long' ) - -# Creation of Loop Nodes -PyInitLoopSwitch = [] -PyInitLoopSwitch.append( 'def InitLoop(Index,Min,Max) : ' ) -PyInitLoopSwitch.append( ' return Index,Min,Max ' ) -PyMoreInitLoopSwitch = [] -PyMoreInitLoopSwitch.append( 'def MoreLoop(Index,Min,Max) : ' ) -PyMoreInitLoopSwitch.append( ' if Index <= Max : ' ) -PyMoreInitLoopSwitch.append( ' DoLoop = 1 ' ) -PyMoreInitLoopSwitch.append( ' else : ' ) -PyMoreInitLoopSwitch.append( ' DoLoop = 0 ' ) -PyMoreInitLoopSwitch.append( ' return DoLoop,Index,Min,Max ' ) -PyNextInitLoopSwitch = [] -PyNextInitLoopSwitch.append( 'def NextLoop(Index,Min,Max) : ' ) -PyNextInitLoopSwitch.append( ' Index = Index + 1 ' ) -PyNextInitLoopSwitch.append( ' return Index,Min,Max ' ) -InitLoopSwitch,EndOfInitLoopSwitch = GraphSwitchCrash.LNode( 'InitLoop' , PyInitLoopSwitch , 'MoreLoop' , PyMoreInitLoopSwitch , 'NextLoop' , PyNextInitLoopSwitch ) -EndOfInitLoopSwitch.SetName( 'EndOfInitLoopSwitch' ) -EndOfInitLoopSwitch.SetAuthor( '' ) -EndOfInitLoopSwitch.SetComment( '' ) -EndOfInitLoopSwitch.Coords( 766 , 127 ) -InitLoopSwitch.SetName( 'InitLoopSwitch' ) -InitLoopSwitch.SetAuthor( '' ) -InitLoopSwitch.SetComment( '' ) -InitLoopSwitch.Coords( 10 , 129 ) -InitLoopSwitch.InPort( 'Index' , 'long' ) -InitLoopSwitch.InPort( 'Min' , 'long' ) -InitLoopSwitch.InPort( 'Max' , 'long' ) -InitLoopSwitch.OutPort( 'Index' , 'long' ) -InitLoopSwitch.OutPort( 'Min' , 'long' ) -InitLoopSwitch.OutPort( 'Max' , 'long' ) - -PyInitLoop = [] -PyInitLoop.append( 'def InitLoop(Index,Min,Max) : ' ) -PyInitLoop.append( ' return Index,Min,Max ' ) -PyMoreInitLoop = [] -PyMoreInitLoop.append( 'def MoreLoop(Index,Min,Max) : ' ) -PyMoreInitLoop.append( ' if Index <= Max : ' ) -PyMoreInitLoop.append( ' DoLoop = 1 ' ) -PyMoreInitLoop.append( ' else : ' ) -PyMoreInitLoop.append( ' DoLoop = 0 ' ) -PyMoreInitLoop.append( ' return DoLoop,Index,Min,Max ' ) -PyNextInitLoop = [] -PyNextInitLoop.append( 'def NextLoop(Index,Min,Max) : ' ) -PyNextInitLoop.append( ' Index = Index + 1 ' ) -PyNextInitLoop.append( ' return Index,Min,Max ' ) -InitLoop,EndOfInitLoop = GraphSwitchCrash.LNode( 'InitLoop' , PyInitLoop , 'MoreLoop' , PyMoreInitLoop , 'NextLoop' , PyNextInitLoop ) -EndOfInitLoop.SetName( 'EndOfInitLoop' ) -EndOfInitLoop.SetAuthor( '' ) -EndOfInitLoop.SetComment( '' ) -EndOfInitLoop.Coords( 783 , 381 ) -InitLoop.SetName( 'InitLoop' ) -InitLoop.SetAuthor( '' ) -InitLoop.SetComment( '' ) -InitLoop.Coords( 10 , 388 ) -InitLoop.InPort( 'Index' , 'long' ) -InitLoop.InPort( 'Min' , 'long' ) -InitLoop.InPort( 'Max' , 'long' ) -InitLoop.OutPort( 'Index' , 'long' ) -InitLoop.OutPort( 'Min' , 'long' ) -InitLoop.OutPort( 'Max' , 'long' ) - -# Creation of Switch Nodes -PySwitch = [] -PySwitch.append( 'from time import * ' ) -PySwitch.append( 'def Switch(a) : ' ) -PySwitch.append( ' if ( a & 1 ) == 0 : ' ) -PySwitch.append( ' sleep(1) ' ) -PySwitch.append( ' return a & 1,1-(a&1),a ' ) -Switch,EndOfSwitch = GraphSwitchCrash.SNode( 'Switch' , PySwitch ) -EndOfSwitch.SetName( 'EndOfSwitch' ) -EndOfSwitch.SetAuthor( '' ) -EndOfSwitch.SetComment( '' ) -EndOfSwitch.Coords( 587 , 126 ) -PyEndOfSwitch = [] -EndOfSwitch.SetPyFunction( 'EndSwitch' , PyEndOfSwitch ) -EndOfSwitch.InPort( 'a' , 'long' ) -EndOfSwitch.OutPort( 'a' , 'long' ) -Switch.SetName( 'Switch' ) -Switch.SetAuthor( '' ) -Switch.SetComment( '' ) -Switch.Coords( 186 , 130 ) -Switch.InPort( 'a' , 'long' ) -Switch.OutPort( 'Odd' , 'long' ) -Switch.OutPort( 'Even' , 'int' ) -Switch.OutPort( 'a' , 'int' ) - -PySwitch_1 = [] -PySwitch_1.append( 'from time import * ' ) -PySwitch_1.append( 'def Switch(a) : ' ) -PySwitch_1.append( ' if ( a & 1 ) == 0 : ' ) -PySwitch_1.append( ' sleep(1) ' ) -PySwitch_1.append( ' return a & 1,1-(a&1),a ' ) -Switch_1,EndSwitch = GraphSwitchCrash.SNode( 'Switch' , PySwitch_1 ) -EndSwitch.SetName( 'EndSwitch' ) -EndSwitch.SetAuthor( '' ) -EndSwitch.SetComment( '' ) -EndSwitch.Coords( 605 , 382 ) -PyEndSwitch = [] -EndSwitch.SetPyFunction( 'EndSwitch' , PyEndSwitch ) -EndSwitch.InPort( 'a' , 'long' ) -EndSwitch.OutPort( 'a' , 'long' ) -Switch_1.SetName( 'Switch_1' ) -Switch_1.SetAuthor( '' ) -Switch_1.SetComment( '' ) -Switch_1.Coords( 193 , 388 ) -Switch_1.InPort( 'a' , 'long' ) -Switch_1.OutPort( 'Odd' , 'long' ) -Switch_1.OutPort( 'Even' , 'int' ) -Switch_1.OutPort( 'a' , 'int' ) - -# Creation of Links -IsOdda = IsOdd.Port( 'a' ) -EndOfSwitcha = GraphSwitchCrash.Link( IsOdda , EndOfSwitch.Port( 'a' ) ) -EndOfSwitcha.AddCoord( 1 , 573 , 160 ) -EndOfSwitcha.AddCoord( 2 , 572 , 130 ) - -InitLoopSwitchIndex = InitLoopSwitch.Port( 'Index' ) -Switcha = GraphSwitchCrash.Link( InitLoopSwitchIndex , Switch.Port( 'a' ) ) - -InitLoopSwitchMin = InitLoopSwitch.Port( 'Min' ) -EndOfInitLoopSwitchMin = GraphSwitchCrash.Link( InitLoopSwitchMin , EndOfInitLoopSwitch.Port( 'Min' ) ) - -InitLoopSwitchMax = InitLoopSwitch.Port( 'Max' ) -EndOfInitLoopSwitchMax = GraphSwitchCrash.Link( InitLoopSwitchMax , EndOfInitLoopSwitch.Port( 'Max' ) ) - -SwitchOdd = Switch.Port( 'Odd' ) -IsOddInGate = GraphSwitchCrash.Link( SwitchOdd , IsOdd.Port( 'InGate' ) ) - -Switcha = Switch.Port( 'a' ) -IsOdda = GraphSwitchCrash.Link( Switcha , IsOdd.Port( 'a' ) ) -IsOdda.AddCoord( 1 , 365 , 129 ) -IsOdda.AddCoord( 2 , 365 , 222 ) - -SwitchDefault = Switch.Port( 'Default' ) -EndOfSwitchDefault = GraphSwitchCrash.Link( SwitchDefault , EndOfSwitch.Port( 'Default' ) ) -EndOfSwitchDefault.AddCoord( 1 , 572 , 194 ) -EndOfSwitchDefault.AddCoord( 2 , 571 , 257 ) - -EndOfSwitcha = EndOfSwitch.Port( 'a' ) -EndOfInitLoopSwitchIndex = GraphSwitchCrash.Link( EndOfSwitcha , EndOfInitLoopSwitch.Port( 'Index' ) ) - -IsOdd_1a = IsOdd_1.Port( 'a' ) -EndSwitcha = GraphSwitchCrash.Link( IsOdd_1a , EndSwitch.Port( 'a' ) ) -EndSwitcha.AddCoord( 1 , 599 , 416 ) -EndSwitcha.AddCoord( 2 , 598 , 358 ) - -InitLoopIndex = InitLoop.Port( 'Index' ) -Switch_1a = GraphSwitchCrash.Link( InitLoopIndex , Switch_1.Port( 'a' ) ) - -InitLoopMin = InitLoop.Port( 'Min' ) -EndOfInitLoopMin = GraphSwitchCrash.Link( InitLoopMin , EndOfInitLoop.Port( 'Min' ) ) - -InitLoopMax = InitLoop.Port( 'Max' ) -EndOfInitLoopMax = GraphSwitchCrash.Link( InitLoopMax , EndOfInitLoop.Port( 'Max' ) ) - -Switch_1Odd = Switch_1.Port( 'Odd' ) -IsOdd_1InGate = GraphSwitchCrash.Link( Switch_1Odd , IsOdd_1.Port( 'InGate' ) ) - -Switch_1Even = Switch_1.Port( 'Even' ) -EndSwitchDefault = GraphSwitchCrash.Link( Switch_1Even , EndSwitch.Port( 'Default' ) ) - -IsOdd_1Even = GraphSwitchCrash.Link( Switch_1Even , IsOdd_1.Port( 'Even' ) ) -IsOdd_1Even.AddCoord( 1 , 402 , 388 ) -IsOdd_1Even.AddCoord( 2 , 402 , 450 ) - -Switch_1a = Switch_1.Port( 'a' ) -IsOdd_1a = GraphSwitchCrash.Link( Switch_1a , IsOdd_1.Port( 'a' ) ) -IsOdd_1a.AddCoord( 1 , 377 , 358 ) -IsOdd_1a.AddCoord( 2 , 378 , 481 ) - -EndSwitcha = EndSwitch.Port( 'a' ) -EndOfInitLoopIndex = GraphSwitchCrash.Link( EndSwitcha , EndOfInitLoop.Port( 'Index' ) ) - -# Creation of Input datas -InitLoopSwitchIndex = InitLoopSwitch.Input( 'Index' , 0) -InitLoopSwitchMin = InitLoopSwitch.Input( 'Min' , 0) -InitLoopSwitchMax = InitLoopSwitch.Input( 'Max' , 100) -InitLoopIndex = InitLoop.Input( 'Index' , 0) -InitLoopMin = InitLoop.Input( 'Min' , 0) -InitLoopMax = InitLoop.Input( 'Max' , 100) - -# Creation of Output variables -EndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.Port( 'Index' ) -EndOfInitLoopSwitchMin = EndOfInitLoopSwitch.Port( 'Min' ) -EndOfInitLoopSwitchMax = EndOfInitLoopSwitch.Port( 'Max' ) -SwitchEven = Switch.Port( 'Even' ) -EndOfInitLoopIndex = EndOfInitLoop.Port( 'Index' ) -EndOfInitLoopMin = EndOfInitLoop.Port( 'Min' ) -EndOfInitLoopMax = EndOfInitLoop.Port( 'Max' ) - -GraphSwitchCrash.Run() -GraphSwitchCrash.DoneW() -print GraphSwitchCrash.State() -GraphSwitchCrash.PrintPorts() +GraphSwitchCrash_1 = DefGraphSwitchCrash_1() diff --git a/examples/GraphSwitchCrash.xml b/examples/GraphSwitchCrash.xml index 50c0b25..d536a40 100755 --- a/examples/GraphSwitchCrash.xml +++ b/examples/GraphSwitchCrash.xml @@ -1,670 +1,667 @@ - + + ? - ? - GraphSwitchCrash - 1 - ? - -GraphSwitchCrash - + ? + GraphSwitchCrash_1 + 1 + ? + +GraphSwitchCrash_1 + long - InitLoopSwitch\Index - + InitLoopSwitch__Index + long - InitLoopSwitch\Min - + InitLoopSwitch__Min + long - InitLoopSwitch\Max - + InitLoopSwitch__Max + long - InitLoop\Index - + InitLoop__Index + long - InitLoop\Min - + InitLoop__Min + long - InitLoop\Max - + InitLoop__Max + long - EndOfInitLoopSwitch\Index - + EndOfInitLoopSwitch__Index + long - EndOfInitLoopSwitch\Min - + EndOfInitLoopSwitch__Min + long - EndOfInitLoopSwitch\Max - + EndOfInitLoopSwitch__Max + int - Switch\Even - + Switch__Even + long - EndOfInitLoop\Index - + EndOfInitLoop__Index + long - EndOfInitLoop\Min - + EndOfInitLoop__Min + long - EndOfInitLoop\Max - - - 14/10/2003 - 10:29:4 - 15/10/2003 - 18:11:6 - 1.05 - ? - ? - ? - 0 - 0 - + EndOfInitLoop__Max + + + 14/10/2003 - 10:29:4 + 8/3/2005 - 16:57:44 + 1.05 + ? + ? + ? + 0 + 0 + ? - ? - IsOdd - 3 - ? - + ? + IsOdd + 3 + ? + IsOdd - + long - a - + a + long - a - - + a + + IsOdd - - - - - - 15/10/2003 - 18:11:6 - 15/10/2003 - 18:11:6 - 1.05 - ? - ? - Python function - 388 - 50 - + + + + + + 8/3/2005 - 16:57:44 + 8/3/2005 - 16:57:44 + 1.05 + ? + ? + Python function + 387 + 58 + ? - ? - InitLoopSwitch - 4 - EndOfInitLoopSwitch - + ? + InitLoopSwitch + 4 + EndOfInitLoopSwitch + InitLoopSwitch - + long - Index - + Index + long - Min - + Min + long - Max - + Max + long - Index - + Index + long - Min - + Min + long - Max - - + Max + + InitLoop - - - + + + MoreLoop - - - - - - - + + + + + + + NextLoop - - - - 15/10/2003 - 18:11:6 - 15/10/2003 - 18:11:6 - 1.05 - ? - ? - ? - 10 - 129 - + + + + 8/3/2005 - 16:57:44 + 8/3/2005 - 16:57:44 + 1.05 + ? + ? + Compute Node + 10 + 129 + ? - ? - EndOfInitLoopSwitch - 5 - InitLoopSwitch - + ? + EndOfInitLoopSwitch + 5 + InitLoopSwitch + EndOfInitLoopSwitch - + long - Index - + Index + long - Min - + Min + long - Max - + Max + long - Index - + Index + long - Min - + Min + long - Max - - - - 15/10/2003 - 18:11:6 - 15/10/2003 - 18:11:6 - 1.05 - ? - ? - ? - 766 - 127 - + Max + + + +? + + 8/3/2005 - 16:57:44 + 8/3/2005 - 16:57:44 + 1.05 + ? + ? + Compute Node + 766 + 127 + ? - ? - Switch - 6 - EndOfSwitch - + ? + Switch + 6 + EndOfSwitch + Switch - + long - a - + a + long - Odd - + Odd + int - Even - + Even + int - a - - + a + + Switch - - - - - - 15/10/2003 - 18:11:6 - 15/10/2003 - 18:11:6 - 1.05 - ? - ? - ? - 186 - 130 - + + + + + + 8/3/2005 - 16:57:44 + 8/3/2005 - 16:57:44 + 1.05 + ? + ? + Compute Node + 186 + 130 + ? - ? - EndOfSwitch - 7 - Switch - + ? + EndOfSwitch + 7 + Switch + EndOfSwitch - + long - a - + a + long - a - - - - 15/10/2003 - 18:11:6 - 15/10/2003 - 18:11:6 - 1.05 - ? - ? - ? - 587 - 126 - + a + + + +? + + 8/3/2005 - 16:57:44 + 8/3/2005 - 16:57:44 + 1.05 + ? + ? + Compute Node + 587 + 126 + ? - ? - IsOdd_1 - 3 - ? - + ? + IsOdd_1 + 3 + ? + IsOdd_1 - + long - a - + a + boolean - Even - + Even + long - a - - + a + + IsOdd - - - - - - 15/10/2003 - 18:11:6 - 15/10/2003 - 18:11:6 - 1.05 - ? - ? - Python function - 419 - 279 - + + + + + + 8/3/2005 - 16:57:44 + 8/3/2005 - 16:57:44 + 1.05 + ? + ? + Python function + 417 + 287 + ? - ? - InitLoop - 4 - EndOfInitLoop - + ? + InitLoop + 4 + EndOfInitLoop + InitLoop - + long - Index - + Index + long - Min - + Min + long - Max - + Max + long - Index - + Index + long - Min - + Min + long - Max - - + Max + + InitLoop - - - + + + MoreLoop - - - - - - - + + + + + + + NextLoop - - - - 15/10/2003 - 18:11:6 - 15/10/2003 - 18:11:6 - 1.05 - ? - ? - ? - 10 - 388 - + + + + 8/3/2005 - 16:57:44 + 8/3/2005 - 16:57:44 + 1.05 + ? + ? + Compute Node + 10 + 388 + ? - ? - EndOfInitLoop - 5 - InitLoop - + ? + EndOfInitLoop + 5 + InitLoop + EndOfInitLoop - + long - Index - + Index + long - Min - + Min + long - Max - + Max + long - Index - + Index + long - Min - + Min + long - Max - - - - 15/10/2003 - 18:11:6 - 15/10/2003 - 18:11:6 - 1.05 - ? - ? - ? - 783 - 381 - + Max + + + +? + + 8/3/2005 - 16:57:44 + 8/3/2005 - 16:57:44 + 1.05 + ? + ? + Compute Node + 783 + 381 + ? - ? - Switch_1 - 6 - EndSwitch - + ? + Switch_1 + 6 + EndSwitch + Switch_1 - + long - a - + a + long - Odd - + Odd + int - Even - + Even + int - a - - + a + + Switch - - - - - - 15/10/2003 - 18:11:6 - 15/10/2003 - 18:11:6 - 1.05 - ? - ? - ? - 193 - 388 - + + + + + + 8/3/2005 - 16:57:44 + 8/3/2005 - 16:57:44 + 1.05 + ? + ? + Compute Node + 193 + 388 + ? - ? - EndSwitch - 7 - Switch_1 - + ? + EndSwitch + 7 + Switch_1 + EndSwitch - + long - a - + a + long - a - - - - 15/10/2003 - 18:11:6 - 15/10/2003 - 18:11:6 - 1.05 - ? - ? - ? - 605 - 382 - + a + + + +? + + 8/3/2005 - 16:57:44 + 8/3/2005 - 16:57:44 + 1.05 + ? + ? + Compute Node + 605 + 382 + IsOdd - a - EndOfSwitch - a - + a + EndOfSwitch + a + -573 - 160 - 572 - 130 - + 157 + +572 + 130 + InitLoopSwitch - DoLoop - EndOfInitLoopSwitch - DoLoop - - + DoLoop + EndOfInitLoopSwitch + DoLoop + + InitLoopSwitch - Index - Switch - a - - + Index + Switch + a + + InitLoopSwitch - Min - EndOfInitLoopSwitch - Min - - + Min + EndOfInitLoopSwitch + Min + + InitLoopSwitch - Max - EndOfInitLoopSwitch - Max - - + Max + EndOfInitLoopSwitch + Max + + EndOfInitLoopSwitch - DoLoop - InitLoopSwitch - DoLoop - - + DoLoop + InitLoopSwitch + DoLoop + + Switch - Odd - IsOdd - InGate - - + Odd + IsOdd + Gate + + Switch - a - IsOdd - a - + a + IsOdd + a + 365 - 129 - + 129 + 365 - 222 - + 201 + Switch - Default - EndOfSwitch - Default - - -572 - 194 - -571 - 257 - + Default + EndOfSwitch + Default + + EndOfSwitch - a - EndOfInitLoopSwitch - Index - - + a + EndOfInitLoopSwitch + Index + + IsOdd_1 - a - EndSwitch - a - + a + EndSwitch + a + -599 - 416 - -598 - 358 - +593 + 411 + +593 + 358 + InitLoop - DoLoop - EndOfInitLoop - DoLoop - - + DoLoop + EndOfInitLoop + DoLoop + + InitLoop - Index - Switch_1 - a - - + Index + Switch_1 + a + + InitLoop - Min - EndOfInitLoop - Min - - + Min + EndOfInitLoop + Min + + InitLoop - Max - EndOfInitLoop - Max - - + Max + EndOfInitLoop + Max + + EndOfInitLoop - DoLoop - InitLoop - DoLoop - - -Switch_1 - Odd - IsOdd_1 - InGate - - + DoLoop + InitLoop + DoLoop + + Switch_1 - Even - EndSwitch - Default - - + Odd + IsOdd_1 + Gate + + Switch_1 - Even - IsOdd_1 - Even - - -402 - 388 - -402 - 450 - + Even + IsOdd_1 + Even + + Switch_1 - a - IsOdd_1 - a - + a + IsOdd_1 + a + 377 - 358 - -378 - 481 - + 358 + +377 + 460 + +Switch_1 + Default + EndSwitch + Default + + EndSwitch - a - EndOfInitLoop - Index - - + a + EndOfInitLoop + Index + + -GraphSwitchCrash - InitLoopSwitch\Index - InitLoopSwitch - Index - +GraphSwitchCrash_1 + InitLoopSwitch__Index + InitLoopSwitch + Index + 3 - 0 - - -GraphSwitchCrash - InitLoopSwitch\Min - InitLoopSwitch - Min - + 0 + + +GraphSwitchCrash_1 + InitLoopSwitch__Min + InitLoopSwitch + Min + 3 - 0 - - -GraphSwitchCrash - InitLoopSwitch\Max - InitLoopSwitch - Max - + 0 + + +GraphSwitchCrash_1 + InitLoopSwitch__Max + InitLoopSwitch + Max + 3 - 100 - - -GraphSwitchCrash - InitLoop\Index - InitLoop - Index - + 23 + + +GraphSwitchCrash_1 + InitLoop__Index + InitLoop + Index + 3 - 0 - - -GraphSwitchCrash - InitLoop\Min - InitLoop - Min - + 0 + + +GraphSwitchCrash_1 + InitLoop__Min + InitLoop + Min + 3 - 0 - - -GraphSwitchCrash - InitLoop\Max - InitLoop - Max - + 0 + + +GraphSwitchCrash_1 + InitLoop__Max + InitLoop + Max + 3 - 100 - + 31 + diff --git a/examples/GraphSwitchErrExec.py b/examples/GraphSwitchErrExec.py index 4706bb0..2da23cd 100644 --- a/examples/GraphSwitchErrExec.py +++ b/examples/GraphSwitchErrExec.py @@ -1,15 +1,15 @@ -# Generated python file of Graph GraphSwitch_1 +# Generated python file of Graph GraphSwitchErrExec from SuperV import * -# Graph creation of GraphSwitch_1 -def DefGraphSwitch_1() : - GraphSwitch_1 = Graph( 'GraphSwitch_1' ) - GraphSwitch_1.SetName( 'GraphSwitch_1' ) - GraphSwitch_1.SetAuthor( '' ) - GraphSwitch_1.SetComment( '' ) - GraphSwitch_1.Coords( 0 , 0 ) +# Graph creation of GraphSwitchErrExec +def DefGraphSwitchErrExec() : + GraphSwitchErrExec = Graph( 'GraphSwitchErrExec' ) + GraphSwitchErrExec.SetName( 'GraphSwitchErrExec' ) + GraphSwitchErrExec.SetAuthor( '' ) + GraphSwitchErrExec.SetComment( '' ) + GraphSwitchErrExec.Coords( 0 , 0 ) # Creation of Factory Nodes @@ -20,7 +20,7 @@ def DefGraphSwitch_1() : PyIsOdd.append( ' print a,"IsOdd (GraphSwitch)" ' ) PyIsOdd.append( ' sleep( 1 ) ' ) PyIsOdd.append( ' return a ' ) - IsOdd = GraphSwitch_1.INode( 'IsOdd' , PyIsOdd ) + IsOdd = GraphSwitchErrExec.INode( 'IsOdd' , PyIsOdd ) IsOdd.SetName( 'IsOdd' ) IsOdd.SetAuthor( '' ) IsOdd.SetComment( 'Python function' ) @@ -36,7 +36,7 @@ def DefGraphSwitch_1() : PyIsEven.append( ' print a,"IsEven (GraphSwitch)" ' ) PyIsEven.append( ' sleep( 1 ) ' ) PyIsEven.append( ' return a ' ) - IsEven = GraphSwitch_1.INode( 'IsEven' , PyIsEven ) + IsEven = GraphSwitchErrExec.INode( 'IsEven' , PyIsEven ) IsEven.SetName( 'IsEven' ) IsEven.SetAuthor( '' ) IsEven.SetComment( 'Compute Node' ) @@ -62,7 +62,7 @@ def DefGraphSwitch_1() : PyNextInitLoopSwitch.append( 'def NextLoop(Index,Min,Max) : ' ) PyNextInitLoopSwitch.append( ' Index = Index - 1 ' ) PyNextInitLoopSwitch.append( ' return Index,Min,Max ' ) - InitLoopSwitch,EndOfInitLoopSwitch = GraphSwitch_1.LNode( 'InitLoop' , PyInitLoopSwitch , 'MoreLoop' , PyMoreInitLoopSwitch , 'NextLoop' , PyNextInitLoopSwitch ) + InitLoopSwitch,EndOfInitLoopSwitch = GraphSwitchErrExec.LNode( 'InitLoop' , PyInitLoopSwitch , 'MoreLoop' , PyMoreInitLoopSwitch , 'NextLoop' , PyNextInitLoopSwitch ) EndOfInitLoopSwitch.SetName( 'EndOfInitLoopSwitch' ) EndOfInitLoopSwitch.SetAuthor( '' ) EndOfInitLoopSwitch.SetComment( 'Compute Node' ) @@ -104,7 +104,7 @@ def DefGraphSwitch_1() : PySwitch.append( ' if ( a & 1 ) == 0 : ' ) PySwitch.append( ' sleep(1) ' ) PySwitch.append( ' return a & 1,1-(a&1),a ' ) - Switch,EndOfSwitch = GraphSwitch_1.SNode( 'Switch' , PySwitch ) + Switch,EndOfSwitch = GraphSwitchErrExec.SNode( 'Switch' , PySwitch ) EndOfSwitch.SetName( 'EndOfSwitch' ) EndOfSwitch.SetAuthor( '' ) EndOfSwitch.SetComment( 'Compute Node' ) @@ -127,27 +127,27 @@ def DefGraphSwitch_1() : OSwitchDefault = Switch.GetOutPort( 'Default' ) # Creation of Links - LIsOddaEndOfSwitcha = GraphSwitch_1.Link( OIsOdda , IEndOfSwitcha ) + LIsOddaEndOfSwitcha = GraphSwitchErrExec.Link( OIsOdda , IEndOfSwitcha ) - LInitLoopSwitchIndexSwitcha = GraphSwitch_1.Link( OInitLoopSwitchIndex , ISwitcha ) + LInitLoopSwitchIndexSwitcha = GraphSwitchErrExec.Link( OInitLoopSwitchIndex , ISwitcha ) - LInitLoopSwitchMinEndOfInitLoopSwitchMin = GraphSwitch_1.Link( OInitLoopSwitchMin , IEndOfInitLoopSwitchMin ) + LInitLoopSwitchMinEndOfInitLoopSwitchMin = GraphSwitchErrExec.Link( OInitLoopSwitchMin , IEndOfInitLoopSwitchMin ) - LInitLoopSwitchMaxEndOfInitLoopSwitchMax = GraphSwitch_1.Link( OInitLoopSwitchMax , IEndOfInitLoopSwitchMax ) + LInitLoopSwitchMaxEndOfInitLoopSwitchMax = GraphSwitchErrExec.Link( OInitLoopSwitchMax , IEndOfInitLoopSwitchMax ) - LIsEvenaEndOfSwitcha = GraphSwitch_1.Link( OIsEvena , IEndOfSwitcha ) + LIsEvenaEndOfSwitcha = GraphSwitchErrExec.Link( OIsEvena , IEndOfSwitcha ) - LSwitchOddIsOddGate = GraphSwitch_1.Link( OSwitchOdd , IIsOddGate ) + LSwitchOddIsOddGate = GraphSwitchErrExec.Link( OSwitchOdd , IIsOddGate ) - LSwitchEvenIsEvenGate = GraphSwitch_1.Link( OSwitchEven , IIsEvenGate ) + LSwitchEvenIsEvenGate = GraphSwitchErrExec.Link( OSwitchEven , IIsEvenGate ) - LSwitchaIsOdda = GraphSwitch_1.Link( OSwitcha , IIsOdda ) + LSwitchaIsOdda = GraphSwitchErrExec.Link( OSwitcha , IIsOdda ) - LSwitchaIsEvena = GraphSwitch_1.Link( OSwitcha , IIsEvena ) + LSwitchaIsEvena = GraphSwitchErrExec.Link( OSwitcha , IIsEvena ) - LSwitchDefaultEndOfSwitchDefault = GraphSwitch_1.Link( OSwitchDefault , IEndOfSwitchDefault ) + LSwitchDefaultEndOfSwitchDefault = GraphSwitchErrExec.Link( OSwitchDefault , IEndOfSwitchDefault ) - LEndOfSwitchaEndOfInitLoopSwitchIndex = GraphSwitch_1.Link( OEndOfSwitcha , IEndOfInitLoopSwitchIndex ) + LEndOfSwitchaEndOfInitLoopSwitchIndex = GraphSwitchErrExec.Link( OEndOfSwitcha , IEndOfInitLoopSwitchIndex ) # Input datas IInitLoopSwitchIndex.Input( 0 ) @@ -158,7 +158,7 @@ def DefGraphSwitch_1() : #OEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetOutPort( 'Index' ) #OEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetOutPort( 'Min' ) #OEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetOutPort( 'Max' ) - return GraphSwitch_1 + return GraphSwitchErrExec -GraphSwitch_1 = DefGraphSwitch_1() +GraphSwitchErrExec = DefGraphSwitchErrExec() diff --git a/examples/GraphSwitchErrExec.xml b/examples/GraphSwitchErrExec.xml index e588ff6..f910104 100644 --- a/examples/GraphSwitchErrExec.xml +++ b/examples/GraphSwitchErrExec.xml @@ -5,7 +5,7 @@ ? ? - GraphSwitch_1 + GraphSwitchErrExec 1 ? @@ -33,7 +33,7 @@ 1/10/2003 - 17:23:54 - 12/1/2005 - 16:10:58 + 5/7/2005 - 17:11:46 1.05 ? ? @@ -66,8 +66,8 @@ - 12/1/2005 - 16:10:58 - 12/1/2005 - 16:10:58 + 5/7/2005 - 17:11:46 + 5/7/2005 - 17:11:46 1.05 ? ? @@ -122,8 +122,8 @@ - 12/1/2005 - 16:10:58 - 12/1/2005 - 16:10:58 + 5/7/2005 - 17:11:46 + 5/7/2005 - 17:11:46 1.05 ? ? @@ -163,8 +163,8 @@ ? - 12/1/2005 - 16:10:58 - 12/1/2005 - 16:10:58 + 5/7/2005 - 17:11:46 + 5/7/2005 - 17:11:46 1.05 ? ? @@ -196,8 +196,8 @@ - 12/1/2005 - 16:10:58 - 12/1/2005 - 16:10:58 + 5/7/2005 - 17:11:46 + 5/7/2005 - 17:11:46 2.0 ? ? @@ -239,8 +239,8 @@ - 12/1/2005 - 16:10:58 - 12/1/2005 - 16:10:58 + 5/7/2005 - 17:11:46 + 5/7/2005 - 17:11:46 2.0 ? ? @@ -268,8 +268,8 @@ EndSwitch_1 - 12/1/2005 - 16:10:58 - 12/1/2005 - 16:10:58 + 5/7/2005 - 17:11:46 + 5/7/2005 - 17:11:46 2.0 ? ? @@ -357,7 +357,7 @@ -GraphSwitch_1 +GraphSwitchErrExec InitLoopSwitch__Index InitLoopSwitch Index @@ -366,7 +366,7 @@ 0 -GraphSwitch_1 +GraphSwitchErrExec InitLoopSwitch__Min InitLoopSwitch Min @@ -375,7 +375,7 @@ -5 -GraphSwitch_1 +GraphSwitchErrExec InitLoopSwitch__Max InitLoopSwitch Max diff --git a/examples/GraphSwitchExecutable.py b/examples/GraphSwitchExecutable.py new file mode 100644 index 0000000..464f832 --- /dev/null +++ b/examples/GraphSwitchExecutable.py @@ -0,0 +1,148 @@ + +# Generated python file of Graph GraphSwitchExecutable + +from SuperV import * + +# Graph creation of GraphSwitchExecutable +def DefGraphSwitchExecutable() : + GraphSwitchExecutable = Graph( 'GraphSwitchExecutable' ) + GraphSwitchExecutable.SetName( 'GraphSwitchExecutable' ) + GraphSwitchExecutable.SetAuthor( '' ) + GraphSwitchExecutable.SetComment( '' ) + GraphSwitchExecutable.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsOdd = [] + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd(a) : ' ) + PyIsOdd.append( ' print a,"IsOdd (GraphSwitch)" ' ) + PyIsOdd.append( ' sleep( 1 ) ' ) + PyIsOdd.append( ' return a ' ) + IsOdd = GraphSwitchExecutable.INode( 'IsOdd' , PyIsOdd ) + IsOdd.SetName( 'IsOdd' ) + IsOdd.SetAuthor( '' ) + IsOdd.SetComment( 'Python function' ) + IsOdd.Coords( 389 , 65 ) + IIsOdda = IsOdd.InPort( 'a' , 'long' ) + IIsOddGate = IsOdd.GetInPort( 'Gate' ) + OIsOdda = IsOdd.OutPort( 'a' , 'long' ) + OIsOddGate = IsOdd.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyInitLoopSwitch = [] + PyInitLoopSwitch.append( 'def InitLoop(Index,Min,Max) : ' ) + PyInitLoopSwitch.append( ' return Index,Min,Max ' ) + PyMoreInitLoopSwitch = [] + PyMoreInitLoopSwitch.append( 'def MoreLoop(Index,Min,Max) : ' ) + PyMoreInitLoopSwitch.append( ' if Index <= Max : ' ) + PyMoreInitLoopSwitch.append( ' DoLoop = 1 ' ) + PyMoreInitLoopSwitch.append( ' else : ' ) + PyMoreInitLoopSwitch.append( ' DoLoop = 0 ' ) + PyMoreInitLoopSwitch.append( ' return DoLoop,Index,Min,Max ' ) + PyNextInitLoopSwitch = [] + PyNextInitLoopSwitch.append( 'def NextLoop(Index,Min,Max) : ' ) + PyNextInitLoopSwitch.append( ' Index = Index + 1 ' ) + PyNextInitLoopSwitch.append( ' return Index,Min,Max ' ) + InitLoopSwitch,EndOfInitLoopSwitch = GraphSwitchExecutable.LNode( 'InitLoop' , PyInitLoopSwitch , 'MoreLoop' , PyMoreInitLoopSwitch , 'NextLoop' , PyNextInitLoopSwitch ) + EndOfInitLoopSwitch.SetName( 'EndOfInitLoopSwitch' ) + EndOfInitLoopSwitch.SetAuthor( '' ) + EndOfInitLoopSwitch.SetComment( 'Compute Node' ) + EndOfInitLoopSwitch.Coords( 772 , 132 ) + PyEndOfInitLoopSwitch = [] + EndOfInitLoopSwitch.SetPyFunction( '' , PyEndOfInitLoopSwitch ) + IInitLoopSwitchDoLoop = InitLoopSwitch.GetInPort( 'DoLoop' ) + IInitLoopSwitchIndex = InitLoopSwitch.InPort( 'Index' , 'long' ) + IInitLoopSwitchMin = InitLoopSwitch.InPort( 'Min' , 'long' ) + IInitLoopSwitchMax = InitLoopSwitch.InPort( 'Max' , 'long' ) + IInitLoopSwitchGate = InitLoopSwitch.GetInPort( 'Gate' ) + OInitLoopSwitchDoLoop = InitLoopSwitch.GetOutPort( 'DoLoop' ) + OInitLoopSwitchIndex = InitLoopSwitch.GetOutPort( 'Index' ) + OInitLoopSwitchMin = InitLoopSwitch.GetOutPort( 'Min' ) + OInitLoopSwitchMax = InitLoopSwitch.GetOutPort( 'Max' ) + IEndOfInitLoopSwitchDoLoop = EndOfInitLoopSwitch.GetInPort( 'DoLoop' ) + IEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetInPort( 'Index' ) + IEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetInPort( 'Min' ) + IEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetInPort( 'Max' ) + IEndOfInitLoopSwitchGate = EndOfInitLoopSwitch.GetInPort( 'Gate' ) + OEndOfInitLoopSwitchDoLoop = EndOfInitLoopSwitch.GetOutPort( 'DoLoop' ) + OEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetOutPort( 'Index' ) + OEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetOutPort( 'Min' ) + OEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetOutPort( 'Max' ) + OEndOfInitLoopSwitchGate = EndOfInitLoopSwitch.GetOutPort( 'Gate' ) + InitLoopSwitch.SetName( 'InitLoopSwitch' ) + InitLoopSwitch.SetAuthor( '' ) + InitLoopSwitch.SetComment( 'Compute Node' ) + InitLoopSwitch.Coords( 10 , 129 ) + + # Creation of Switch Nodes + PySwitch = [] + PySwitch.append( 'from time import * ' ) + PySwitch.append( 'def Switch(a) : ' ) + PySwitch.append( ' if ( a & 1 ) == 0 : ' ) + PySwitch.append( ' sleep(1) ' ) + PySwitch.append( ' return a & 1,1-(a&1),a,a ' ) + Switch,EndOfSwitch = GraphSwitchExecutable.SNode( 'Switch' , PySwitch ) + EndOfSwitch.SetName( 'EndOfSwitch' ) + EndOfSwitch.SetAuthor( '' ) + EndOfSwitch.SetComment( 'Compute Node' ) + EndOfSwitch.Coords( 581 , 132 ) + PyEndOfSwitch = [] + PyEndOfSwitch.append( 'def EndOfSwitch( a , Even , k ) : ' ) + PyEndOfSwitch.append( ' return a ' ) + EndOfSwitch.SetPyFunction( 'EndOfSwitch' , PyEndOfSwitch ) + IEndOfSwitcha = EndOfSwitch.InPort( 'a' , 'long' ) + IEndOfSwitchEven = EndOfSwitch.InPort( 'Even' , 'long' ) + IEndOfSwitchk = EndOfSwitch.InPort( 'k' , 'long' ) + IEndOfSwitchDefault = EndOfSwitch.GetInPort( 'Default' ) + OEndOfSwitcha = EndOfSwitch.OutPort( 'a' , 'long' ) + OEndOfSwitchGate = EndOfSwitch.GetOutPort( 'Gate' ) + Switch.SetName( 'Switch' ) + Switch.SetAuthor( '' ) + Switch.SetComment( 'Compute Node' ) + Switch.Coords( 194 , 129 ) + ISwitcha = Switch.InPort( 'a' , 'long' ) + ISwitchGate = Switch.GetInPort( 'Gate' ) + OSwitchOdd = Switch.OutPort( 'Odd' , 'long' ) + OSwitchEven = Switch.OutPort( 'Even' , 'int' ) + OSwitcha = Switch.OutPort( 'a' , 'int' ) + OSwitchi = Switch.OutPort( 'i' , 'long' ) + OSwitchDefault = Switch.GetOutPort( 'Default' ) + + # Creation of Links + LIsOddaEndOfSwitcha = GraphSwitchExecutable.Link( OIsOdda , IEndOfSwitcha ) + + LInitLoopSwitchIndexSwitcha = GraphSwitchExecutable.Link( OInitLoopSwitchIndex , ISwitcha ) + + LInitLoopSwitchMinEndOfInitLoopSwitchMin = GraphSwitchExecutable.Link( OInitLoopSwitchMin , IEndOfInitLoopSwitchMin ) + + LInitLoopSwitchMaxEndOfInitLoopSwitchMax = GraphSwitchExecutable.Link( OInitLoopSwitchMax , IEndOfInitLoopSwitchMax ) + + LSwitchOddIsOddGate = GraphSwitchExecutable.Link( OSwitchOdd , IIsOddGate ) + + LSwitchaIsOdda = GraphSwitchExecutable.Link( OSwitcha , IIsOdda ) + + LSwitchiEndOfSwitchk = GraphSwitchExecutable.Link( OSwitchi , IEndOfSwitchk ) + + LSwitchDefaultEndOfSwitchDefault = GraphSwitchExecutable.Link( OSwitchDefault , IEndOfSwitchDefault ) + + LEndOfSwitchaEndOfInitLoopSwitchIndex = GraphSwitchExecutable.Link( OEndOfSwitcha , IEndOfInitLoopSwitchIndex ) + + # Input datas + IInitLoopSwitchIndex.Input( 0 ) + IInitLoopSwitchMin.Input( 0 ) + IInitLoopSwitchMax.Input( 35 ) + + # Input Ports of the graph + #IEndOfSwitchEven = EndOfSwitch.GetInPort( 'Even' ) + + # Output Ports of the graph + #OEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetOutPort( 'Index' ) + #OEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetOutPort( 'Min' ) + #OEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetOutPort( 'Max' ) + #OSwitchEven = Switch.GetOutPort( 'Even' ) + return GraphSwitchExecutable + + +GraphSwitchExecutable = DefGraphSwitchExecutable() diff --git a/examples/GraphSwitchExecutable.xml b/examples/GraphSwitchExecutable.xml new file mode 100644 index 0000000..f65d704 --- /dev/null +++ b/examples/GraphSwitchExecutable.xml @@ -0,0 +1,351 @@ + + + + + +? + ? + GraphSwitchExecutable + 1 + ? + +GraphSwitchExecutable + + +long + InitLoopSwitch__Index + +long + InitLoopSwitch__Min + +long + InitLoopSwitch__Max + +long + EndOfSwitch__Even + + +long + EndOfInitLoopSwitch__Index + +long + EndOfInitLoopSwitch__Min + +long + EndOfInitLoopSwitch__Max + +int + Switch__Even + + + 1/10/2003 - 17:23:54 + 8/7/2005 - 14:55:5 + 1.05 + ? + ? + ? + 0 + 0 + + +? + ? + IsOdd + 3 + ? + +IsOdd + + +long + a + + +long + a + + + +IsOdd + + + + + + 8/7/2005 - 14:55:5 + 8/7/2005 - 14:55:5 + 1.05 + ? + ? + Python function + 389 + 65 + +? + ? + InitLoopSwitch + 4 + EndOfInitLoopSwitch + +InitLoopSwitch + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +InitLoop + + + +MoreLoop + + + + + + + +NextLoop + + + + 8/7/2005 - 14:55:5 + 8/7/2005 - 14:55:5 + 1.05 + ? + ? + Compute Node + 10 + 129 + +? + ? + EndOfInitLoopSwitch + 5 + InitLoopSwitch + +EndOfInitLoopSwitch + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +? + + 8/7/2005 - 14:55:5 + 8/7/2005 - 14:55:5 + 1.05 + ? + ? + Compute Node + 772 + 132 + +? + ? + Switch + 6 + EndOfSwitch + +Switch + + +long + a + + +long + Odd + +int + Even + +int + a + +long + i + + + +Switch + + + + + + 8/7/2005 - 14:55:5 + 8/7/2005 - 14:55:5 + 1.05 + ? + ? + Compute Node + 194 + 129 + +? + ? + EndOfSwitch + 7 + Switch + +EndOfSwitch + + +long + a + +long + Even + +long + k + + +long + a + + + +EndOfSwitch + + + 8/7/2005 - 14:55:5 + 8/7/2005 - 14:55:5 + 1.05 + ? + ? + Compute Node + 581 + 132 + + +IsOdd + a + EndOfSwitch + a + + +InitLoopSwitch + DoLoop + EndOfInitLoopSwitch + DoLoop + + +InitLoopSwitch + Index + Switch + a + + +InitLoopSwitch + Min + EndOfInitLoopSwitch + Min + + +InitLoopSwitch + Max + EndOfInitLoopSwitch + Max + + +EndOfInitLoopSwitch + DoLoop + InitLoopSwitch + DoLoop + + +Switch + Odd + IsOdd + Gate + + +Switch + a + IsOdd + a + + +Switch + i + EndOfSwitch + k + + +Switch + Default + EndOfSwitch + Default + + +EndOfSwitch + a + EndOfInitLoopSwitch + Index + + + +GraphSwitchExecutable + InitLoopSwitch__Index + InitLoopSwitch + Index + +3 + 0 + + +GraphSwitchExecutable + InitLoopSwitch__Min + InitLoopSwitch + Min + +3 + 0 + + +GraphSwitchExecutable + InitLoopSwitch__Max + InitLoopSwitch + Max + +3 + 35 + diff --git a/examples/GraphSwitchGates.py b/examples/GraphSwitchGates.py new file mode 100644 index 0000000..6999ae1 --- /dev/null +++ b/examples/GraphSwitchGates.py @@ -0,0 +1,156 @@ + +# Generated python file of Graph GraphSwitchGates + +from SuperV import * + +# Graph creation of GraphSwitchGates +def DefGraphSwitchGates() : + GraphSwitchGates = Graph( 'GraphSwitchGates' ) + GraphSwitchGates.SetName( 'GraphSwitchGates' ) + GraphSwitchGates.SetAuthor( 'JR' ) + GraphSwitchGates.SetComment( '' ) + GraphSwitchGates.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsOdd = [] + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd() : ' ) + PyIsOdd.append( ' sleep(1) ' ) + PyIsOdd.append( ' return ' ) + IsOdd = GraphSwitchGates.INode( 'IsOdd' , PyIsOdd ) + IsOdd.SetName( 'IsOdd' ) + IsOdd.SetAuthor( '' ) + IsOdd.SetComment( 'Compute Node' ) + IsOdd.Coords( 424 , 116 ) + IIsOddGate = IsOdd.GetInPort( 'Gate' ) + OIsOddGate = IsOdd.GetOutPort( 'Gate' ) + + PyIsEven = [] + PyIsEven.append( 'from time import * ' ) + PyIsEven.append( 'def IsEven() : ' ) + PyIsEven.append( ' sleep(1) ' ) + PyIsEven.append( ' return ' ) + IsEven = GraphSwitchGates.INode( 'IsEven' , PyIsEven ) + IsEven.SetName( 'IsEven' ) + IsEven.SetAuthor( '' ) + IsEven.SetComment( 'Compute Node' ) + IsEven.Coords( 428 , 345 ) + IIsEvenGate = IsEven.GetInPort( 'Gate' ) + OIsEvenGate = IsEven.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyLoopGates = [] + PyLoopGates.append( 'def InitLoop(Index,Max,Min) : ' ) + PyLoopGates.append( ' Index = Max ' ) + PyLoopGates.append( ' return Index,Max,Min ' ) + PyMoreLoopGates = [] + PyMoreLoopGates.append( 'from time import * ' ) + PyMoreLoopGates.append( 'def MoreLoop(Index,Max,Min) : ' ) + PyMoreLoopGates.append( ' sleep(1) ' ) + PyMoreLoopGates.append( ' DoLoop = 0 ' ) + PyMoreLoopGates.append( ' if Index >= Min : ' ) + PyMoreLoopGates.append( ' DoLoop = 1 ' ) + PyMoreLoopGates.append( ' return DoLoop,Index,Max,Min ' ) + PyNextLoopGates = [] + PyNextLoopGates.append( 'def NextLoop(Index,Max,Min) : ' ) + PyNextLoopGates.append( ' Index = Index - 1 ' ) + PyNextLoopGates.append( ' return Index,Max,Min ' ) + LoopGates,EndLoopGates = GraphSwitchGates.LNode( 'InitLoop' , PyLoopGates , 'MoreLoop' , PyMoreLoopGates , 'NextLoop' , PyNextLoopGates ) + EndLoopGates.SetName( 'EndLoopGates' ) + EndLoopGates.SetAuthor( '' ) + EndLoopGates.SetComment( 'Compute Node' ) + EndLoopGates.Coords( 875 , 216 ) + PyEndLoopGates = [] + EndLoopGates.SetPyFunction( 'EndLoopGates' , PyEndLoopGates ) + ILoopGatesDoLoop = LoopGates.GetInPort( 'DoLoop' ) + ILoopGatesIndex = LoopGates.InPort( 'Index' , 'long' ) + ILoopGatesMax = LoopGates.InPort( 'Max' , 'long' ) + ILoopGatesMin = LoopGates.InPort( 'Min' , 'long' ) + ILoopGatesGate = LoopGates.GetInPort( 'Gate' ) + OLoopGatesDoLoop = LoopGates.GetOutPort( 'DoLoop' ) + OLoopGatesIndex = LoopGates.GetOutPort( 'Index' ) + OLoopGatesMax = LoopGates.GetOutPort( 'Max' ) + OLoopGatesMin = LoopGates.GetOutPort( 'Min' ) + IEndLoopGatesDoLoop = EndLoopGates.GetInPort( 'DoLoop' ) + IEndLoopGatesIndex = EndLoopGates.GetInPort( 'Index' ) + IEndLoopGatesMax = EndLoopGates.GetInPort( 'Max' ) + IEndLoopGatesMin = EndLoopGates.GetInPort( 'Min' ) + IEndLoopGatesGate = EndLoopGates.GetInPort( 'Gate' ) + OEndLoopGatesDoLoop = EndLoopGates.GetOutPort( 'DoLoop' ) + OEndLoopGatesIndex = EndLoopGates.GetOutPort( 'Index' ) + OEndLoopGatesMax = EndLoopGates.GetOutPort( 'Max' ) + OEndLoopGatesMin = EndLoopGates.GetOutPort( 'Min' ) + OEndLoopGatesGate = EndLoopGates.GetOutPort( 'Gate' ) + LoopGates.SetName( 'LoopGates' ) + LoopGates.SetAuthor( '' ) + LoopGates.SetComment( 'Compute Node' ) + LoopGates.Coords( 13 , 236 ) + + # Creation of Switch Nodes + PySwitchGates = [] + PySwitchGates.append( 'def SwitchGates(Index) : ' ) + PySwitchGates.append( ' Odd = 0 ' ) + PySwitchGates.append( ' Even = 0 ' ) + PySwitchGates.append( ' if (Index & 1) == 1 : ' ) + PySwitchGates.append( ' Odd = 1 ' ) + PySwitchGates.append( ' if (Index & 1) == 0 : ' ) + PySwitchGates.append( ' Even = 1 ' ) + PySwitchGates.append( ' return Odd,Even ' ) + SwitchGates,EndSwitchGates = GraphSwitchGates.SNode( 'SwitchGates' , PySwitchGates ) + EndSwitchGates.SetName( 'EndSwitchGates' ) + EndSwitchGates.SetAuthor( '' ) + EndSwitchGates.SetComment( 'Compute Node' ) + EndSwitchGates.Coords( 648 , 276 ) + PyEndSwitchGates = [] + PyEndSwitchGates.append( 'from time import * ' ) + PyEndSwitchGates.append( 'def EndSwitchGates() : ' ) + PyEndSwitchGates.append( ' sleep(1) ' ) + PyEndSwitchGates.append( ' return ' ) + PyEndSwitchGates.append( '' ) + EndSwitchGates.SetPyFunction( 'EndSwitchGates' , PyEndSwitchGates ) + IEndSwitchGatesDefault = EndSwitchGates.GetInPort( 'Default' ) + OEndSwitchGatesGate = EndSwitchGates.GetOutPort( 'Gate' ) + SwitchGates.SetName( 'SwitchGates' ) + SwitchGates.SetAuthor( '' ) + SwitchGates.SetComment( 'Compute Node' ) + SwitchGates.Coords( 204 , 236 ) + ISwitchGatesIndex = SwitchGates.InPort( 'Index' , 'long' ) + ISwitchGatesGate = SwitchGates.GetInPort( 'Gate' ) + OSwitchGatesOdd = SwitchGates.OutPort( 'Odd' , 'long' ) + OSwitchGatesEven = SwitchGates.OutPort( 'Even' , 'long' ) + OSwitchGatesDefault = SwitchGates.GetOutPort( 'Default' ) + + # Creation of Links + LLoopGatesIndexEndLoopGatesIndex = GraphSwitchGates.Link( OLoopGatesIndex , IEndLoopGatesIndex ) + + LLoopGatesIndexSwitchGatesIndex = GraphSwitchGates.Link( OLoopGatesIndex , ISwitchGatesIndex ) + + LLoopGatesMaxEndLoopGatesMax = GraphSwitchGates.Link( OLoopGatesMax , IEndLoopGatesMax ) + + LLoopGatesMinEndLoopGatesMin = GraphSwitchGates.Link( OLoopGatesMin , IEndLoopGatesMin ) + + LSwitchGatesOddIsOddGate = GraphSwitchGates.Link( OSwitchGatesOdd , IIsOddGate ) + + LSwitchGatesEvenIsEvenGate = GraphSwitchGates.Link( OSwitchGatesEven , IIsEvenGate ) + + LEndSwitchGatesGateEndLoopGatesGate = GraphSwitchGates.Link( OEndSwitchGatesGate , IEndLoopGatesGate ) + + LIsOddGateEndSwitchGatesDefault = GraphSwitchGates.Link( OIsOddGate , IEndSwitchGatesDefault ) + + LIsEvenGateEndSwitchGatesDefault = GraphSwitchGates.Link( OIsEvenGate , IEndSwitchGatesDefault ) + + # Input datas + ILoopGatesIndex.Input( 0 ) + ILoopGatesMax.Input( 13 ) + ILoopGatesMin.Input( -7 ) + + # Output Ports of the graph + #OEndLoopGatesIndex = EndLoopGates.GetOutPort( 'Index' ) + #OEndLoopGatesMax = EndLoopGates.GetOutPort( 'Max' ) + #OEndLoopGatesMin = EndLoopGates.GetOutPort( 'Min' ) + return GraphSwitchGates + + +GraphSwitchGates = DefGraphSwitchGates() diff --git a/examples/GraphSwitchGates.xml b/examples/GraphSwitchGates.xml new file mode 100644 index 0000000..7c6b883 --- /dev/null +++ b/examples/GraphSwitchGates.xml @@ -0,0 +1,354 @@ + + + + + +? + ? + GraphSwitchGates + 1 + ? + +GraphSwitchGatesDefault + + +long + LoopGates__Index + +long + LoopGates__Max + +long + LoopGates__Min + + +long + EndLoopGates__Index + +long + EndLoopGates__Max + +long + EndLoopGates__Min + + + 16/2/2005 - 10:40:8 + 16/2/2005 - 11:44:13 + 2.0 + JR + ? + ? + 0 + 0 + + +? + ? + LoopGates + 4 + EndLoopGates + +LoopGates + + +long + Index + +long + Max + +long + Min + + +long + Index + +long + Max + +long + Min + + + +InitLoop + + + + +MoreLoop + + + + + = Min : ]]> + + + +NextLoop + + + + 16/2/2005 - 11:33:14 + 16/2/2005 - 11:33:14 + 2.0 + ? + ? + Compute Node + 13 + 236 + +? + ? + EndLoopGates + 5 + LoopGates + +EndLoopGates + + +long + Index + +long + Max + +long + Min + + +long + Index + +long + Max + +long + Min + + + +EndLoopGates + + 16/2/2005 - 11:33:14 + 16/2/2005 - 11:33:14 + 2.0 + ? + ? + Compute Node + 875 + 216 + +? + ? + SwitchGates + 6 + EndSwitchGates + +SwitchGates + + +long + Index + + +long + Odd + +long + Even + + + +SwitchGates + + + + + + + + + 16/2/2005 - 11:33:14 + 16/2/2005 - 11:33:14 + 2.0 + ? + ? + Compute Node + 204 + 236 + +? + ? + EndSwitchGates + 7 + SwitchGates + +EndSwitchGates + + + + + +EndSwitchGates + + + + + + 16/2/2005 - 11:33:14 + 16/2/2005 - 11:33:14 + 2.0 + ? + ? + Compute Node + 648 + 276 + +? + ? + IsOdd + 3 + ? + +IsOdd + + + + + +IsOdd + + + + + 16/2/2005 - 11:33:14 + 16/2/2005 - 11:33:14 + 2.0 + ? + ? + Compute Node + 424 + 116 + +? + ? + IsEven + 3 + ? + +IsEven + + + + + +IsEven + + + + + 16/2/2005 - 11:33:14 + 16/2/2005 - 11:33:14 + 2.0 + ? + ? + Compute Node + 428 + 345 + + +LoopGates + DoLoop + EndLoopGates + DoLoop + + +LoopGates + Index + EndLoopGates + Index + + +LoopGates + Index + SwitchGates + Index + + +LoopGates + Max + EndLoopGates + Max + + +LoopGates + Min + EndLoopGates + Min + + +EndLoopGates + DoLoop + LoopGates + DoLoop + + +SwitchGates + Odd + IsOdd + Gate + + +SwitchGates + Even + IsEven + Gate + + +EndSwitchGates + Gate + EndLoopGates + Gate + + +IsOdd + Gate + EndSwitchGates + Default + + +IsEven + Gate + EndSwitchGates + Default + + + +GraphSwitchGates + LoopGates__Index + LoopGates + Index + +3 + 0 + + +GraphSwitchGates + LoopGates__Max + LoopGates + Max + +3 + 13 + + +GraphSwitchGates + LoopGates__Min + LoopGates + Min + +3 + -7 + diff --git a/examples/GraphSwitchGatesDefault.py b/examples/GraphSwitchGatesDefault.py new file mode 100644 index 0000000..dd176ff --- /dev/null +++ b/examples/GraphSwitchGatesDefault.py @@ -0,0 +1,159 @@ + +# Generated python file of Graph GraphSwitchGatesDefault + +from SuperV import * + +# Graph creation of GraphSwitchGatesDefault +def DefGraphSwitchGatesDefault() : + GraphSwitchGatesDefault = Graph( 'GraphSwitchGatesDefault' ) + GraphSwitchGatesDefault.SetName( 'GraphSwitchGatesDefault' ) + GraphSwitchGatesDefault.SetAuthor( 'JR' ) + GraphSwitchGatesDefault.SetComment( '' ) + GraphSwitchGatesDefault.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsOdd = [] + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd() : ' ) + PyIsOdd.append( ' sleep(1) ' ) + PyIsOdd.append( ' return ' ) + IsOdd = GraphSwitchGatesDefault.INode( 'IsOdd' , PyIsOdd ) + IsOdd.SetName( 'IsOdd' ) + IsOdd.SetAuthor( '' ) + IsOdd.SetComment( 'Compute Node' ) + IsOdd.Coords( 424 , 116 ) + IIsOddGate = IsOdd.GetInPort( 'Gate' ) + OIsOddGate = IsOdd.GetOutPort( 'Gate' ) + + PyIsEven = [] + PyIsEven.append( 'from time import * ' ) + PyIsEven.append( 'def IsEven() : ' ) + PyIsEven.append( ' sleep(1) ' ) + PyIsEven.append( ' return ' ) + IsEven = GraphSwitchGatesDefault.INode( 'IsEven' , PyIsEven ) + IsEven.SetName( 'IsEven' ) + IsEven.SetAuthor( '' ) + IsEven.SetComment( 'Compute Node' ) + IsEven.Coords( 428 , 345 ) + IIsEvenGate = IsEven.GetInPort( 'Gate' ) + OIsEvenGate = IsEven.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyLoopGates = [] + PyLoopGates.append( 'def InitLoop(Index,Max,Min) : ' ) + PyLoopGates.append( ' Index = Max ' ) + PyLoopGates.append( ' return Index,Max,Min ' ) + PyMoreLoopGates = [] + PyMoreLoopGates.append( 'from time import * ' ) + PyMoreLoopGates.append( 'def MoreLoop(Index,Max,Min) : ' ) + PyMoreLoopGates.append( ' sleep(1) ' ) + PyMoreLoopGates.append( ' DoLoop = 0 ' ) + PyMoreLoopGates.append( ' if Index >= Min : ' ) + PyMoreLoopGates.append( ' DoLoop = 1 ' ) + PyMoreLoopGates.append( ' return DoLoop,Index,Max,Min ' ) + PyNextLoopGates = [] + PyNextLoopGates.append( 'def NextLoop(Index,Max,Min) : ' ) + PyNextLoopGates.append( ' Index = Index - 1 ' ) + PyNextLoopGates.append( ' return Index,Max,Min ' ) + LoopGates,EndLoopGates = GraphSwitchGatesDefault.LNode( 'InitLoop' , PyLoopGates , 'MoreLoop' , PyMoreLoopGates , 'NextLoop' , PyNextLoopGates ) + EndLoopGates.SetName( 'EndLoopGates' ) + EndLoopGates.SetAuthor( '' ) + EndLoopGates.SetComment( 'Compute Node' ) + EndLoopGates.Coords( 875 , 216 ) + PyEndLoopGates = [] + EndLoopGates.SetPyFunction( 'EndLoopGates' , PyEndLoopGates ) + ILoopGatesDoLoop = LoopGates.GetInPort( 'DoLoop' ) + ILoopGatesIndex = LoopGates.InPort( 'Index' , 'long' ) + ILoopGatesMax = LoopGates.InPort( 'Max' , 'long' ) + ILoopGatesMin = LoopGates.InPort( 'Min' , 'long' ) + ILoopGatesGate = LoopGates.GetInPort( 'Gate' ) + OLoopGatesDoLoop = LoopGates.GetOutPort( 'DoLoop' ) + OLoopGatesIndex = LoopGates.GetOutPort( 'Index' ) + OLoopGatesMax = LoopGates.GetOutPort( 'Max' ) + OLoopGatesMin = LoopGates.GetOutPort( 'Min' ) + IEndLoopGatesDoLoop = EndLoopGates.GetInPort( 'DoLoop' ) + IEndLoopGatesIndex = EndLoopGates.GetInPort( 'Index' ) + IEndLoopGatesMax = EndLoopGates.GetInPort( 'Max' ) + IEndLoopGatesMin = EndLoopGates.GetInPort( 'Min' ) + IEndLoopGatesGate = EndLoopGates.GetInPort( 'Gate' ) + OEndLoopGatesDoLoop = EndLoopGates.GetOutPort( 'DoLoop' ) + OEndLoopGatesIndex = EndLoopGates.GetOutPort( 'Index' ) + OEndLoopGatesMax = EndLoopGates.GetOutPort( 'Max' ) + OEndLoopGatesMin = EndLoopGates.GetOutPort( 'Min' ) + OEndLoopGatesGate = EndLoopGates.GetOutPort( 'Gate' ) + LoopGates.SetName( 'LoopGates' ) + LoopGates.SetAuthor( '' ) + LoopGates.SetComment( 'Compute Node' ) + LoopGates.Coords( 13 , 236 ) + + # Creation of Switch Nodes + PySwitchGates = [] + PySwitchGates.append( 'def SwitchGates(Index) : ' ) + PySwitchGates.append( ' Odd = 0 ' ) + PySwitchGates.append( ' Even = 0 ' ) + PySwitchGates.append( ' if Index > 0 : ' ) + PySwitchGates.append( ' if (Index & 1) == 1 : ' ) + PySwitchGates.append( ' Odd = 1 ' ) + PySwitchGates.append( ' if (Index & 1) == 0 : ' ) + PySwitchGates.append( ' Even = 1 ' ) + PySwitchGates.append( ' return Odd,Even ' ) + SwitchGates,EndSwitchGates = GraphSwitchGatesDefault.SNode( 'SwitchGates' , PySwitchGates ) + EndSwitchGates.SetName( 'EndSwitchGates' ) + EndSwitchGates.SetAuthor( '' ) + EndSwitchGates.SetComment( 'Compute Node' ) + EndSwitchGates.Coords( 648 , 276 ) + PyEndSwitchGates = [] + PyEndSwitchGates.append( 'from time import * ' ) + PyEndSwitchGates.append( 'def EndSwitchGates() : ' ) + PyEndSwitchGates.append( ' sleep(1) ' ) + PyEndSwitchGates.append( ' return ' ) + PyEndSwitchGates.append( '' ) + EndSwitchGates.SetPyFunction( 'EndSwitchGates' , PyEndSwitchGates ) + IEndSwitchGatesDefault = EndSwitchGates.GetInPort( 'Default' ) + OEndSwitchGatesGate = EndSwitchGates.GetOutPort( 'Gate' ) + SwitchGates.SetName( 'SwitchGates' ) + SwitchGates.SetAuthor( '' ) + SwitchGates.SetComment( 'Compute Node' ) + SwitchGates.Coords( 204 , 236 ) + ISwitchGatesIndex = SwitchGates.InPort( 'Index' , 'long' ) + ISwitchGatesGate = SwitchGates.GetInPort( 'Gate' ) + OSwitchGatesOdd = SwitchGates.OutPort( 'Odd' , 'long' ) + OSwitchGatesEven = SwitchGates.OutPort( 'Even' , 'long' ) + OSwitchGatesDefault = SwitchGates.GetOutPort( 'Default' ) + + # Creation of Links + LLoopGatesIndexEndLoopGatesIndex = GraphSwitchGatesDefault.Link( OLoopGatesIndex , IEndLoopGatesIndex ) + + LLoopGatesIndexSwitchGatesIndex = GraphSwitchGatesDefault.Link( OLoopGatesIndex , ISwitchGatesIndex ) + + LLoopGatesMaxEndLoopGatesMax = GraphSwitchGatesDefault.Link( OLoopGatesMax , IEndLoopGatesMax ) + + LLoopGatesMinEndLoopGatesMin = GraphSwitchGatesDefault.Link( OLoopGatesMin , IEndLoopGatesMin ) + + LSwitchGatesOddIsOddGate = GraphSwitchGatesDefault.Link( OSwitchGatesOdd , IIsOddGate ) + + LSwitchGatesEvenIsEvenGate = GraphSwitchGatesDefault.Link( OSwitchGatesEven , IIsEvenGate ) + + LSwitchGatesDefaultEndSwitchGatesDefault = GraphSwitchGatesDefault.Link( OSwitchGatesDefault , IEndSwitchGatesDefault ) + + LEndSwitchGatesGateEndLoopGatesGate = GraphSwitchGatesDefault.Link( OEndSwitchGatesGate , IEndLoopGatesGate ) + + LIsOddGateEndSwitchGatesDefault = GraphSwitchGatesDefault.Link( OIsOddGate , IEndSwitchGatesDefault ) + + LIsEvenGateEndSwitchGatesDefault = GraphSwitchGatesDefault.Link( OIsEvenGate , IEndSwitchGatesDefault ) + + # Input datas + ILoopGatesIndex.Input( 0 ) + ILoopGatesMax.Input( 13 ) + ILoopGatesMin.Input( -7 ) + + # Output Ports of the graph + #OEndLoopGatesIndex = EndLoopGates.GetOutPort( 'Index' ) + #OEndLoopGatesMax = EndLoopGates.GetOutPort( 'Max' ) + #OEndLoopGatesMin = EndLoopGates.GetOutPort( 'Min' ) + return GraphSwitchGatesDefault + + +GraphSwitchGatesDefault = DefGraphSwitchGatesDefault() diff --git a/examples/GraphSwitchGatesDefault.xml b/examples/GraphSwitchGatesDefault.xml new file mode 100644 index 0000000..2dbc8c8 --- /dev/null +++ b/examples/GraphSwitchGatesDefault.xml @@ -0,0 +1,361 @@ + + + + + +? + ? + GraphSwitchGatesDefault + 1 + ? + +GraphSwitchGatesDefault_1 + + +long + LoopGates__Index + +long + LoopGates__Max + +long + LoopGates__Min + + +long + EndLoopGates__Index + +long + EndLoopGates__Max + +long + EndLoopGates__Min + + + 16/2/2005 - 10:40:8 + 16/2/2005 - 11:46:44 + 2.0 + JR + ? + ? + 0 + 0 + + +? + ? + LoopGates + 4 + EndLoopGates + +LoopGates + + +long + Index + +long + Max + +long + Min + + +long + Index + +long + Max + +long + Min + + + +InitLoop + + + + +MoreLoop + + + + + = Min : ]]> + + + +NextLoop + + + + 16/2/2005 - 11:46:44 + 16/2/2005 - 11:46:44 + 2.0 + ? + ? + Compute Node + 13 + 236 + +? + ? + EndLoopGates + 5 + LoopGates + +EndLoopGates + + +long + Index + +long + Max + +long + Min + + +long + Index + +long + Max + +long + Min + + + +EndLoopGates + + 16/2/2005 - 11:46:44 + 16/2/2005 - 11:46:44 + 2.0 + ? + ? + Compute Node + 875 + 216 + +? + ? + SwitchGates + 6 + EndSwitchGates + +SwitchGates + + +long + Index + + +long + Odd + +long + Even + + + +SwitchGates + + + + 0 : ]]> + + + + + + 16/2/2005 - 11:46:44 + 16/2/2005 - 11:46:44 + 2.0 + ? + ? + Compute Node + 204 + 236 + +? + ? + EndSwitchGates + 7 + SwitchGates + +EndSwitchGates + + + + + +EndSwitchGates + + + + + + 16/2/2005 - 11:46:44 + 16/2/2005 - 11:46:44 + 2.0 + ? + ? + Compute Node + 648 + 276 + +? + ? + IsOdd + 3 + ? + +IsOdd + + + + + +IsOdd + + + + + 16/2/2005 - 11:46:44 + 16/2/2005 - 11:46:44 + 2.0 + ? + ? + Compute Node + 424 + 116 + +? + ? + IsEven + 3 + ? + +IsEven + + + + + +IsEven + + + + + 16/2/2005 - 11:46:44 + 16/2/2005 - 11:46:44 + 2.0 + ? + ? + Compute Node + 428 + 345 + + +LoopGates + DoLoop + EndLoopGates + DoLoop + + +LoopGates + Index + EndLoopGates + Index + + +LoopGates + Index + SwitchGates + Index + + +LoopGates + Max + EndLoopGates + Max + + +LoopGates + Min + EndLoopGates + Min + + +EndLoopGates + DoLoop + LoopGates + DoLoop + + +SwitchGates + Odd + IsOdd + Gate + + +SwitchGates + Even + IsEven + Gate + + +SwitchGates + Default + EndSwitchGates + Default + + +EndSwitchGates + Gate + EndLoopGates + Gate + + +IsOdd + Gate + EndSwitchGates + Default + + +IsEven + Gate + EndSwitchGates + Default + + + +GraphSwitchGatesDefault + LoopGates__Index + LoopGates + Index + +3 + 0 + + +GraphSwitchGatesDefault + LoopGates__Max + LoopGates + Max + +3 + 13 + + +GraphSwitchGatesDefault + LoopGates__Min + LoopGates + Min + +3 + -7 + diff --git a/examples/GraphSwitchGatesNoDefaultAborted.py b/examples/GraphSwitchGatesNoDefaultAborted.py new file mode 100644 index 0000000..cccfc8f --- /dev/null +++ b/examples/GraphSwitchGatesNoDefaultAborted.py @@ -0,0 +1,157 @@ + +# Generated python file of Graph GraphSwitchGatesNoDefaultAborted + +from SuperV import * + +# Graph creation of GraphSwitchGatesNoDefaultAborted +def DefGraphSwitchGatesNoDefaultAborted() : + GraphSwitchGatesNoDefaultAborted = Graph( 'GraphSwitchGatesNoDefaultAborted' ) + GraphSwitchGatesNoDefaultAborted.SetName( 'GraphSwitchGatesNoDefaultAborted' ) + GraphSwitchGatesNoDefaultAborted.SetAuthor( 'JR' ) + GraphSwitchGatesNoDefaultAborted.SetComment( '' ) + GraphSwitchGatesNoDefaultAborted.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsOdd = [] + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd() : ' ) + PyIsOdd.append( ' sleep(1) ' ) + PyIsOdd.append( ' return ' ) + IsOdd = GraphSwitchGatesNoDefaultAborted.INode( 'IsOdd' , PyIsOdd ) + IsOdd.SetName( 'IsOdd' ) + IsOdd.SetAuthor( '' ) + IsOdd.SetComment( 'Compute Node' ) + IsOdd.Coords( 424 , 116 ) + IIsOddGate = IsOdd.GetInPort( 'Gate' ) + OIsOddGate = IsOdd.GetOutPort( 'Gate' ) + + PyIsEven = [] + PyIsEven.append( 'from time import * ' ) + PyIsEven.append( 'def IsEven() : ' ) + PyIsEven.append( ' sleep(1) ' ) + PyIsEven.append( ' return ' ) + IsEven = GraphSwitchGatesNoDefaultAborted.INode( 'IsEven' , PyIsEven ) + IsEven.SetName( 'IsEven' ) + IsEven.SetAuthor( '' ) + IsEven.SetComment( 'Compute Node' ) + IsEven.Coords( 428 , 345 ) + IIsEvenGate = IsEven.GetInPort( 'Gate' ) + OIsEvenGate = IsEven.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyLoopGates = [] + PyLoopGates.append( 'def InitLoop(Index,Max,Min) : ' ) + PyLoopGates.append( ' Index = Max ' ) + PyLoopGates.append( ' return Index,Max,Min ' ) + PyMoreLoopGates = [] + PyMoreLoopGates.append( 'from time import * ' ) + PyMoreLoopGates.append( 'def MoreLoop(Index,Max,Min) : ' ) + PyMoreLoopGates.append( ' sleep(1) ' ) + PyMoreLoopGates.append( ' DoLoop = 0 ' ) + PyMoreLoopGates.append( ' if Index >= Min : ' ) + PyMoreLoopGates.append( ' DoLoop = 1 ' ) + PyMoreLoopGates.append( ' return DoLoop,Index,Max,Min ' ) + PyNextLoopGates = [] + PyNextLoopGates.append( 'def NextLoop(Index,Max,Min) : ' ) + PyNextLoopGates.append( ' Index = Index - 1 ' ) + PyNextLoopGates.append( ' return Index,Max,Min ' ) + LoopGates,EndLoopGates = GraphSwitchGatesNoDefaultAborted.LNode( 'InitLoop' , PyLoopGates , 'MoreLoop' , PyMoreLoopGates , 'NextLoop' , PyNextLoopGates ) + EndLoopGates.SetName( 'EndLoopGates' ) + EndLoopGates.SetAuthor( '' ) + EndLoopGates.SetComment( 'Compute Node' ) + EndLoopGates.Coords( 875 , 216 ) + PyEndLoopGates = [] + EndLoopGates.SetPyFunction( 'EndLoopGates' , PyEndLoopGates ) + ILoopGatesDoLoop = LoopGates.GetInPort( 'DoLoop' ) + ILoopGatesIndex = LoopGates.InPort( 'Index' , 'long' ) + ILoopGatesMax = LoopGates.InPort( 'Max' , 'long' ) + ILoopGatesMin = LoopGates.InPort( 'Min' , 'long' ) + ILoopGatesGate = LoopGates.GetInPort( 'Gate' ) + OLoopGatesDoLoop = LoopGates.GetOutPort( 'DoLoop' ) + OLoopGatesIndex = LoopGates.GetOutPort( 'Index' ) + OLoopGatesMax = LoopGates.GetOutPort( 'Max' ) + OLoopGatesMin = LoopGates.GetOutPort( 'Min' ) + IEndLoopGatesDoLoop = EndLoopGates.GetInPort( 'DoLoop' ) + IEndLoopGatesIndex = EndLoopGates.GetInPort( 'Index' ) + IEndLoopGatesMax = EndLoopGates.GetInPort( 'Max' ) + IEndLoopGatesMin = EndLoopGates.GetInPort( 'Min' ) + IEndLoopGatesGate = EndLoopGates.GetInPort( 'Gate' ) + OEndLoopGatesDoLoop = EndLoopGates.GetOutPort( 'DoLoop' ) + OEndLoopGatesIndex = EndLoopGates.GetOutPort( 'Index' ) + OEndLoopGatesMax = EndLoopGates.GetOutPort( 'Max' ) + OEndLoopGatesMin = EndLoopGates.GetOutPort( 'Min' ) + OEndLoopGatesGate = EndLoopGates.GetOutPort( 'Gate' ) + LoopGates.SetName( 'LoopGates' ) + LoopGates.SetAuthor( '' ) + LoopGates.SetComment( 'Compute Node' ) + LoopGates.Coords( 13 , 236 ) + + # Creation of Switch Nodes + PySwitchGates = [] + PySwitchGates.append( 'def SwitchGates(Index) : ' ) + PySwitchGates.append( ' Odd = 0 ' ) + PySwitchGates.append( ' Even = 0 ' ) + PySwitchGates.append( ' if Index > 0 : ' ) + PySwitchGates.append( ' if (Index & 1) == 1 : ' ) + PySwitchGates.append( ' Odd = 1 ' ) + PySwitchGates.append( ' if (Index & 1) == 0 : ' ) + PySwitchGates.append( ' Even = 1 ' ) + PySwitchGates.append( ' return Odd,Even ' ) + SwitchGates,EndSwitchGates = GraphSwitchGatesNoDefaultAborted.SNode( 'SwitchGates' , PySwitchGates ) + EndSwitchGates.SetName( 'EndSwitchGates' ) + EndSwitchGates.SetAuthor( '' ) + EndSwitchGates.SetComment( 'Compute Node' ) + EndSwitchGates.Coords( 648 , 276 ) + PyEndSwitchGates = [] + PyEndSwitchGates.append( 'from time import * ' ) + PyEndSwitchGates.append( 'def EndSwitchGates() : ' ) + PyEndSwitchGates.append( ' sleep(1) ' ) + PyEndSwitchGates.append( ' return ' ) + PyEndSwitchGates.append( '' ) + EndSwitchGates.SetPyFunction( 'EndSwitchGates' , PyEndSwitchGates ) + IEndSwitchGatesDefault = EndSwitchGates.GetInPort( 'Default' ) + OEndSwitchGatesGate = EndSwitchGates.GetOutPort( 'Gate' ) + SwitchGates.SetName( 'SwitchGates' ) + SwitchGates.SetAuthor( '' ) + SwitchGates.SetComment( 'Compute Node' ) + SwitchGates.Coords( 204 , 236 ) + ISwitchGatesIndex = SwitchGates.InPort( 'Index' , 'long' ) + ISwitchGatesGate = SwitchGates.GetInPort( 'Gate' ) + OSwitchGatesOdd = SwitchGates.OutPort( 'Odd' , 'long' ) + OSwitchGatesEven = SwitchGates.OutPort( 'Even' , 'long' ) + OSwitchGatesDefault = SwitchGates.GetOutPort( 'Default' ) + + # Creation of Links + LLoopGatesIndexEndLoopGatesIndex = GraphSwitchGatesNoDefaultAborted.Link( OLoopGatesIndex , IEndLoopGatesIndex ) + + LLoopGatesIndexSwitchGatesIndex = GraphSwitchGatesNoDefaultAborted.Link( OLoopGatesIndex , ISwitchGatesIndex ) + + LLoopGatesMaxEndLoopGatesMax = GraphSwitchGatesNoDefaultAborted.Link( OLoopGatesMax , IEndLoopGatesMax ) + + LLoopGatesMinEndLoopGatesMin = GraphSwitchGatesNoDefaultAborted.Link( OLoopGatesMin , IEndLoopGatesMin ) + + LSwitchGatesOddIsOddGate = GraphSwitchGatesNoDefaultAborted.Link( OSwitchGatesOdd , IIsOddGate ) + + LSwitchGatesEvenIsEvenGate = GraphSwitchGatesNoDefaultAborted.Link( OSwitchGatesEven , IIsEvenGate ) + + LEndSwitchGatesGateEndLoopGatesGate = GraphSwitchGatesNoDefaultAborted.Link( OEndSwitchGatesGate , IEndLoopGatesGate ) + + LIsOddGateEndSwitchGatesDefault = GraphSwitchGatesNoDefaultAborted.Link( OIsOddGate , IEndSwitchGatesDefault ) + + LIsEvenGateEndSwitchGatesDefault = GraphSwitchGatesNoDefaultAborted.Link( OIsEvenGate , IEndSwitchGatesDefault ) + + # Input datas + ILoopGatesIndex.Input( 0 ) + ILoopGatesMax.Input( 13 ) + ILoopGatesMin.Input( -7 ) + + # Output Ports of the graph + #OEndLoopGatesIndex = EndLoopGates.GetOutPort( 'Index' ) + #OEndLoopGatesMax = EndLoopGates.GetOutPort( 'Max' ) + #OEndLoopGatesMin = EndLoopGates.GetOutPort( 'Min' ) + return GraphSwitchGatesNoDefaultAborted + + +GraphSwitchGatesNoDefaultAborted = DefGraphSwitchGatesNoDefaultAborted() diff --git a/examples/GraphSwitchGatesNoDefaultAborted.xml b/examples/GraphSwitchGatesNoDefaultAborted.xml new file mode 100644 index 0000000..76ee607 --- /dev/null +++ b/examples/GraphSwitchGatesNoDefaultAborted.xml @@ -0,0 +1,355 @@ + + + + + +? + ? + GraphSwitchGatesNoDefaultAborted + 1 + ? + +GraphSwitchGatesDefault_1 + + +long + LoopGates__Index + +long + LoopGates__Max + +long + LoopGates__Min + + +long + EndLoopGates__Index + +long + EndLoopGates__Max + +long + EndLoopGates__Min + + + 16/2/2005 - 10:40:8 + 16/2/2005 - 12:12:25 + 2.0 + JR + ? + ? + 0 + 0 + + +? + ? + LoopGates + 4 + EndLoopGates + +LoopGates + + +long + Index + +long + Max + +long + Min + + +long + Index + +long + Max + +long + Min + + + +InitLoop + + + + +MoreLoop + + + + + = Min : ]]> + + + +NextLoop + + + + 16/2/2005 - 12:12:25 + 16/2/2005 - 12:12:25 + 2.0 + ? + ? + Compute Node + 13 + 236 + +? + ? + EndLoopGates + 5 + LoopGates + +EndLoopGates + + +long + Index + +long + Max + +long + Min + + +long + Index + +long + Max + +long + Min + + + +EndLoopGates + + 16/2/2005 - 12:12:25 + 16/2/2005 - 12:12:25 + 2.0 + ? + ? + Compute Node + 875 + 216 + +? + ? + SwitchGates + 6 + EndSwitchGates + +SwitchGates + + +long + Index + + +long + Odd + +long + Even + + + +SwitchGates + + + + 0 : ]]> + + + + + + 16/2/2005 - 12:12:25 + 16/2/2005 - 12:12:25 + 2.0 + ? + ? + Compute Node + 204 + 236 + +? + ? + EndSwitchGates + 7 + SwitchGates + +EndSwitchGates + + + + + +EndSwitchGates + + + + + + 16/2/2005 - 12:12:25 + 16/2/2005 - 12:12:25 + 2.0 + ? + ? + Compute Node + 648 + 276 + +? + ? + IsOdd + 3 + ? + +IsOdd + + + + + +IsOdd + + + + + 16/2/2005 - 12:12:25 + 16/2/2005 - 12:12:25 + 2.0 + ? + ? + Compute Node + 424 + 116 + +? + ? + IsEven + 3 + ? + +IsEven + + + + + +IsEven + + + + + 16/2/2005 - 12:12:25 + 16/2/2005 - 12:12:25 + 2.0 + ? + ? + Compute Node + 428 + 345 + + +LoopGates + DoLoop + EndLoopGates + DoLoop + + +LoopGates + Index + EndLoopGates + Index + + +LoopGates + Index + SwitchGates + Index + + +LoopGates + Max + EndLoopGates + Max + + +LoopGates + Min + EndLoopGates + Min + + +EndLoopGates + DoLoop + LoopGates + DoLoop + + +SwitchGates + Odd + IsOdd + Gate + + +SwitchGates + Even + IsEven + Gate + + +EndSwitchGates + Gate + EndLoopGates + Gate + + +IsOdd + Gate + EndSwitchGates + Default + + +IsEven + Gate + EndSwitchGates + Default + + + +GraphSwitchGatesNoDefaultAborted + LoopGates__Index + LoopGates + Index + +3 + 0 + + +GraphSwitchGatesNoDefaultAborted + LoopGates__Max + LoopGates + Max + +3 + 13 + + +GraphSwitchGatesNoDefaultAborted + LoopGates__Min + LoopGates + Min + +3 + -7 + diff --git a/examples/GraphSwitchGatesdefault.py b/examples/GraphSwitchGatesdefault.py new file mode 100644 index 0000000..0a5ccdf --- /dev/null +++ b/examples/GraphSwitchGatesdefault.py @@ -0,0 +1,163 @@ + +# Generated python file of Graph GraphSwitchGatesdefault + +from SuperV import * + +# Graph creation of GraphSwitchGatesdefault +def DefGraphSwitchGatesdefault() : + GraphSwitchGatesdefault = Graph( 'GraphSwitchGatesdefault' ) + GraphSwitchGatesdefault.SetName( 'GraphSwitchGatesdefault' ) + GraphSwitchGatesdefault.SetAuthor( 'JR' ) + GraphSwitchGatesdefault.SetComment( '' ) + GraphSwitchGatesdefault.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsOdd = [] + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd() : ' ) + PyIsOdd.append( ' sleep(1) ' ) + PyIsOdd.append( ' return ' ) + IsOdd = GraphSwitchGatesdefault.INode( 'IsOdd' , PyIsOdd ) + IsOdd.SetName( 'IsOdd' ) + IsOdd.SetAuthor( '' ) + IsOdd.SetComment( 'Compute Node' ) + IsOdd.Coords( 424 , 116 ) + IIsOddGate = IsOdd.GetInPort( 'Gate' ) + OIsOddGate = IsOdd.GetOutPort( 'Gate' ) + + PyIsEven = [] + PyIsEven.append( 'from time import * ' ) + PyIsEven.append( 'def IsEven() : ' ) + PyIsEven.append( ' sleep(1) ' ) + PyIsEven.append( ' return ' ) + IsEven = GraphSwitchGatesdefault.INode( 'IsEven' , PyIsEven ) + IsEven.SetName( 'IsEven' ) + IsEven.SetAuthor( '' ) + IsEven.SetComment( 'Compute Node' ) + IsEven.Coords( 428 , 345 ) + IIsEvenGate = IsEven.GetInPort( 'Gate' ) + OIsEvenGate = IsEven.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyLoopGates = [] + PyLoopGates.append( 'def InitLoop(Index,Max,Min) : ' ) + PyLoopGates.append( ' Index = Max ' ) + PyLoopGates.append( ' return Index,Max,Min ' ) + PyMoreLoopGates = [] + PyMoreLoopGates.append( 'from time import * ' ) + PyMoreLoopGates.append( 'def MoreLoop(Index,Max,Min) : ' ) + PyMoreLoopGates.append( ' sleep(1) ' ) + PyMoreLoopGates.append( ' DoLoop = 0 ' ) + PyMoreLoopGates.append( ' if Index >= Min : ' ) + PyMoreLoopGates.append( ' DoLoop = 1 ' ) + PyMoreLoopGates.append( ' return DoLoop,Index,Max,Min ' ) + PyNextLoopGates = [] + PyNextLoopGates.append( 'def NextLoop(Index,Max,Min) : ' ) + PyNextLoopGates.append( ' Index = Index - 1 ' ) + PyNextLoopGates.append( ' return Index,Max,Min ' ) + LoopGates,EndLoopGates = GraphSwitchGatesdefault.LNode( 'InitLoop' , PyLoopGates , 'MoreLoop' , PyMoreLoopGates , 'NextLoop' , PyNextLoopGates ) + EndLoopGates.SetName( 'EndLoopGates' ) + EndLoopGates.SetAuthor( '' ) + EndLoopGates.SetComment( 'Compute Node' ) + EndLoopGates.Coords( 875 , 216 ) + PyEndLoopGates = [] + EndLoopGates.SetPyFunction( 'EndLoopGates' , PyEndLoopGates ) + ILoopGatesDoLoop = LoopGates.GetInPort( 'DoLoop' ) + ILoopGatesIndex = LoopGates.InPort( 'Index' , 'long' ) + ILoopGatesMax = LoopGates.InPort( 'Max' , 'long' ) + ILoopGatesMin = LoopGates.InPort( 'Min' , 'long' ) + ILoopGatesGate = LoopGates.GetInPort( 'Gate' ) + OLoopGatesDoLoop = LoopGates.GetOutPort( 'DoLoop' ) + OLoopGatesIndex = LoopGates.GetOutPort( 'Index' ) + OLoopGatesMax = LoopGates.GetOutPort( 'Max' ) + OLoopGatesMin = LoopGates.GetOutPort( 'Min' ) + IEndLoopGatesDoLoop = EndLoopGates.GetInPort( 'DoLoop' ) + IEndLoopGatesIndex = EndLoopGates.GetInPort( 'Index' ) + IEndLoopGatesMax = EndLoopGates.GetInPort( 'Max' ) + IEndLoopGatesMin = EndLoopGates.GetInPort( 'Min' ) + IEndLoopGatesGate = EndLoopGates.GetInPort( 'Gate' ) + OEndLoopGatesDoLoop = EndLoopGates.GetOutPort( 'DoLoop' ) + OEndLoopGatesIndex = EndLoopGates.GetOutPort( 'Index' ) + OEndLoopGatesMax = EndLoopGates.GetOutPort( 'Max' ) + OEndLoopGatesMin = EndLoopGates.GetOutPort( 'Min' ) + OEndLoopGatesGate = EndLoopGates.GetOutPort( 'Gate' ) + LoopGates.SetName( 'LoopGates' ) + LoopGates.SetAuthor( '' ) + LoopGates.SetComment( 'Compute Node' ) + LoopGates.Coords( 13 , 236 ) + + # Creation of Switch Nodes + PySwitchGates = [] + PySwitchGates.append( 'def SwitchGates(Index) : ' ) + PySwitchGates.append( ' Odd = 0 ' ) + PySwitchGates.append( ' Even = 0 ' ) + PySwitchGates.append( ' default = 0 ' ) + PySwitchGates.append( ' if Index > 0 : ' ) + PySwitchGates.append( ' if (Index & 1) == 1 : ' ) + PySwitchGates.append( ' Odd = 1 ' ) + PySwitchGates.append( ' if (Index & 1) == 0 : ' ) + PySwitchGates.append( ' Even = 1 ' ) + PySwitchGates.append( ' else : ' ) + PySwitchGates.append( ' default = 1 ' ) + PySwitchGates.append( ' return Odd,Even,default ' ) + SwitchGates,EndSwitchGates = GraphSwitchGatesdefault.SNode( 'SwitchGates' , PySwitchGates ) + EndSwitchGates.SetName( 'EndSwitchGates' ) + EndSwitchGates.SetAuthor( '' ) + EndSwitchGates.SetComment( 'Compute Node' ) + EndSwitchGates.Coords( 648 , 276 ) + PyEndSwitchGates = [] + PyEndSwitchGates.append( 'from time import * ' ) + PyEndSwitchGates.append( 'def EndSwitchGates() : ' ) + PyEndSwitchGates.append( ' sleep(1) ' ) + PyEndSwitchGates.append( ' return ' ) + PyEndSwitchGates.append( '' ) + EndSwitchGates.SetPyFunction( 'EndSwitchGates' , PyEndSwitchGates ) + IEndSwitchGatesDefault = EndSwitchGates.GetInPort( 'Default' ) + OEndSwitchGatesGate = EndSwitchGates.GetOutPort( 'Gate' ) + SwitchGates.SetName( 'SwitchGates' ) + SwitchGates.SetAuthor( '' ) + SwitchGates.SetComment( 'Compute Node' ) + SwitchGates.Coords( 204 , 236 ) + ISwitchGatesIndex = SwitchGates.InPort( 'Index' , 'long' ) + ISwitchGatesGate = SwitchGates.GetInPort( 'Gate' ) + OSwitchGatesOdd = SwitchGates.OutPort( 'Odd' , 'long' ) + OSwitchGatesEven = SwitchGates.OutPort( 'Even' , 'long' ) + OSwitchGatesdefault = SwitchGates.OutPort( 'default' , 'long' ) + OSwitchGatesDefault = SwitchGates.GetOutPort( 'Default' ) + + # Creation of Links + LLoopGatesIndexEndLoopGatesIndex = GraphSwitchGatesdefault.Link( OLoopGatesIndex , IEndLoopGatesIndex ) + + LLoopGatesIndexSwitchGatesIndex = GraphSwitchGatesdefault.Link( OLoopGatesIndex , ISwitchGatesIndex ) + + LLoopGatesMaxEndLoopGatesMax = GraphSwitchGatesdefault.Link( OLoopGatesMax , IEndLoopGatesMax ) + + LLoopGatesMinEndLoopGatesMin = GraphSwitchGatesdefault.Link( OLoopGatesMin , IEndLoopGatesMin ) + + LSwitchGatesOddIsOddGate = GraphSwitchGatesdefault.Link( OSwitchGatesOdd , IIsOddGate ) + + LSwitchGatesEvenIsEvenGate = GraphSwitchGatesdefault.Link( OSwitchGatesEven , IIsEvenGate ) + + LSwitchGatesdefaultEndSwitchGatesDefault = GraphSwitchGatesdefault.Link( OSwitchGatesdefault , IEndSwitchGatesDefault ) + + LEndSwitchGatesGateEndLoopGatesGate = GraphSwitchGatesdefault.Link( OEndSwitchGatesGate , IEndLoopGatesGate ) + + LIsOddGateEndSwitchGatesDefault = GraphSwitchGatesdefault.Link( OIsOddGate , IEndSwitchGatesDefault ) + + LIsEvenGateEndSwitchGatesDefault = GraphSwitchGatesdefault.Link( OIsEvenGate , IEndSwitchGatesDefault ) + + # Input datas + ILoopGatesIndex.Input( 0 ) + ILoopGatesMax.Input( 13 ) + ILoopGatesMin.Input( -7 ) + + # Output Ports of the graph + #OEndLoopGatesIndex = EndLoopGates.GetOutPort( 'Index' ) + #OEndLoopGatesMax = EndLoopGates.GetOutPort( 'Max' ) + #OEndLoopGatesMin = EndLoopGates.GetOutPort( 'Min' ) + return GraphSwitchGatesdefault + + +GraphSwitchGatesdefault = DefGraphSwitchGatesdefault() diff --git a/examples/GraphSwitchGatesdefault.xml b/examples/GraphSwitchGatesdefault.xml new file mode 100644 index 0000000..e4a0692 --- /dev/null +++ b/examples/GraphSwitchGatesdefault.xml @@ -0,0 +1,367 @@ + + + + + +? + ? + GraphSwitchGatesdefault + 1 + ? + +GraphSwitchGatesdefault + + +long + LoopGates__Index + +long + LoopGates__Max + +long + LoopGates__Min + + +long + EndLoopGates__Index + +long + EndLoopGates__Max + +long + EndLoopGates__Min + + + 16/2/2005 - 10:40:8 + 16/2/2005 - 12:13:31 + 2.0 + JR + ? + ? + 0 + 0 + + +? + ? + LoopGates + 4 + EndLoopGates + +LoopGates + + +long + Index + +long + Max + +long + Min + + +long + Index + +long + Max + +long + Min + + + +InitLoop + + + + +MoreLoop + + + + + = Min : ]]> + + + +NextLoop + + + + 16/2/2005 - 12:13:25 + 16/2/2005 - 12:13:25 + 2.0 + ? + ? + Compute Node + 13 + 236 + +? + ? + EndLoopGates + 5 + LoopGates + +EndLoopGates + + +long + Index + +long + Max + +long + Min + + +long + Index + +long + Max + +long + Min + + + +EndLoopGates + + 16/2/2005 - 12:13:25 + 16/2/2005 - 12:13:25 + 2.0 + ? + ? + Compute Node + 875 + 216 + +? + ? + SwitchGates + 6 + EndSwitchGates + +SwitchGates + + +long + Index + + +long + Odd + +long + Even + +long + default + + + +SwitchGates + + + + + 0 : ]]> + + + + + + + + 16/2/2005 - 12:13:25 + 16/2/2005 - 12:13:25 + 2.0 + ? + ? + Compute Node + 204 + 236 + +? + ? + EndSwitchGates + 7 + SwitchGates + +EndSwitchGates + + + + + +EndSwitchGates + + + + + + 16/2/2005 - 12:13:25 + 16/2/2005 - 12:13:25 + 2.0 + ? + ? + Compute Node + 648 + 276 + +? + ? + IsOdd + 3 + ? + +IsOdd + + + + + +IsOdd + + + + + 16/2/2005 - 12:13:25 + 16/2/2005 - 12:13:25 + 2.0 + ? + ? + Compute Node + 424 + 116 + +? + ? + IsEven + 3 + ? + +IsEven + + + + + +IsEven + + + + + 16/2/2005 - 12:13:25 + 16/2/2005 - 12:13:25 + 2.0 + ? + ? + Compute Node + 428 + 345 + + +LoopGates + DoLoop + EndLoopGates + DoLoop + + +LoopGates + Index + EndLoopGates + Index + + +LoopGates + Index + SwitchGates + Index + + +LoopGates + Max + EndLoopGates + Max + + +LoopGates + Min + EndLoopGates + Min + + +EndLoopGates + DoLoop + LoopGates + DoLoop + + +SwitchGates + Odd + IsOdd + Gate + + +SwitchGates + Even + IsEven + Gate + + +SwitchGates + default + EndSwitchGates + Default + + +EndSwitchGates + Gate + EndLoopGates + Gate + + +IsOdd + Gate + EndSwitchGates + Default + + +IsEven + Gate + EndSwitchGates + Default + + + +GraphSwitchGatesdefault + LoopGates__Index + LoopGates + Index + +3 + 0 + + +GraphSwitchGatesdefault + LoopGates__Max + LoopGates + Max + +3 + 13 + + +GraphSwitchGatesdefault + LoopGates__Min + LoopGates + Min + +3 + -7 + diff --git a/examples/GraphSwitchGatesdefaultBranch.py b/examples/GraphSwitchGatesdefaultBranch.py new file mode 100644 index 0000000..14b03d0 --- /dev/null +++ b/examples/GraphSwitchGatesdefaultBranch.py @@ -0,0 +1,178 @@ + +# Generated python file of Graph GraphSwitchGatesdefaultBranch + +from SuperV import * + +# Graph creation of GraphSwitchGatesdefaultBranch +def DefGraphSwitchGatesdefaultBranch() : + GraphSwitchGatesdefaultBranch = Graph( 'GraphSwitchGatesdefaultBranch' ) + GraphSwitchGatesdefaultBranch.SetName( 'GraphSwitchGatesdefaultBranch' ) + GraphSwitchGatesdefaultBranch.SetAuthor( 'JR' ) + GraphSwitchGatesdefaultBranch.SetComment( '' ) + GraphSwitchGatesdefaultBranch.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsOdd = [] + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd() : ' ) + PyIsOdd.append( ' sleep(1) ' ) + PyIsOdd.append( ' return ' ) + IsOdd = GraphSwitchGatesdefaultBranch.INode( 'IsOdd' , PyIsOdd ) + IsOdd.SetName( 'IsOdd' ) + IsOdd.SetAuthor( '' ) + IsOdd.SetComment( 'Compute Node' ) + IsOdd.Coords( 424 , 116 ) + IIsOddGate = IsOdd.GetInPort( 'Gate' ) + OIsOddGate = IsOdd.GetOutPort( 'Gate' ) + + PyIsEven = [] + PyIsEven.append( 'from time import * ' ) + PyIsEven.append( 'def IsEven() : ' ) + PyIsEven.append( ' sleep(1) ' ) + PyIsEven.append( ' return ' ) + IsEven = GraphSwitchGatesdefaultBranch.INode( 'IsEven' , PyIsEven ) + IsEven.SetName( 'IsEven' ) + IsEven.SetAuthor( '' ) + IsEven.SetComment( 'Compute Node' ) + IsEven.Coords( 428 , 345 ) + IIsEvenGate = IsEven.GetInPort( 'Gate' ) + OIsEvenGate = IsEven.GetOutPort( 'Gate' ) + + PydefaultNode = [] + PydefaultNode.append( 'from time import * ' ) + PydefaultNode.append( 'def defaultNode() : ' ) + PydefaultNode.append( ' sleep(1) ' ) + PydefaultNode.append( ' return ' ) + defaultNode = GraphSwitchGatesdefaultBranch.INode( 'defaultNode' , PydefaultNode ) + defaultNode.SetName( 'defaultNode' ) + defaultNode.SetAuthor( '' ) + defaultNode.SetComment( 'Compute Node' ) + defaultNode.Coords( 425 , 232 ) + IdefaultNodeGate = defaultNode.GetInPort( 'Gate' ) + OdefaultNodeGate = defaultNode.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyLoopGates = [] + PyLoopGates.append( 'def InitLoop(Index,Max,Min) : ' ) + PyLoopGates.append( ' Index = Max ' ) + PyLoopGates.append( ' return Index,Max,Min ' ) + PyMoreLoopGates = [] + PyMoreLoopGates.append( 'from time import * ' ) + PyMoreLoopGates.append( 'def MoreLoop(Index,Max,Min) : ' ) + PyMoreLoopGates.append( ' sleep(1) ' ) + PyMoreLoopGates.append( ' DoLoop = 0 ' ) + PyMoreLoopGates.append( ' if Index >= Min : ' ) + PyMoreLoopGates.append( ' DoLoop = 1 ' ) + PyMoreLoopGates.append( ' return DoLoop,Index,Max,Min ' ) + PyNextLoopGates = [] + PyNextLoopGates.append( 'def NextLoop(Index,Max,Min) : ' ) + PyNextLoopGates.append( ' Index = Index - 1 ' ) + PyNextLoopGates.append( ' return Index,Max,Min ' ) + LoopGates,EndLoopGates = GraphSwitchGatesdefaultBranch.LNode( 'InitLoop' , PyLoopGates , 'MoreLoop' , PyMoreLoopGates , 'NextLoop' , PyNextLoopGates ) + EndLoopGates.SetName( 'EndLoopGates' ) + EndLoopGates.SetAuthor( '' ) + EndLoopGates.SetComment( 'Compute Node' ) + EndLoopGates.Coords( 875 , 216 ) + PyEndLoopGates = [] + EndLoopGates.SetPyFunction( 'EndLoopGates' , PyEndLoopGates ) + ILoopGatesDoLoop = LoopGates.GetInPort( 'DoLoop' ) + ILoopGatesIndex = LoopGates.InPort( 'Index' , 'long' ) + ILoopGatesMax = LoopGates.InPort( 'Max' , 'long' ) + ILoopGatesMin = LoopGates.InPort( 'Min' , 'long' ) + ILoopGatesGate = LoopGates.GetInPort( 'Gate' ) + OLoopGatesDoLoop = LoopGates.GetOutPort( 'DoLoop' ) + OLoopGatesIndex = LoopGates.GetOutPort( 'Index' ) + OLoopGatesMax = LoopGates.GetOutPort( 'Max' ) + OLoopGatesMin = LoopGates.GetOutPort( 'Min' ) + IEndLoopGatesDoLoop = EndLoopGates.GetInPort( 'DoLoop' ) + IEndLoopGatesIndex = EndLoopGates.GetInPort( 'Index' ) + IEndLoopGatesMax = EndLoopGates.GetInPort( 'Max' ) + IEndLoopGatesMin = EndLoopGates.GetInPort( 'Min' ) + IEndLoopGatesGate = EndLoopGates.GetInPort( 'Gate' ) + OEndLoopGatesDoLoop = EndLoopGates.GetOutPort( 'DoLoop' ) + OEndLoopGatesIndex = EndLoopGates.GetOutPort( 'Index' ) + OEndLoopGatesMax = EndLoopGates.GetOutPort( 'Max' ) + OEndLoopGatesMin = EndLoopGates.GetOutPort( 'Min' ) + OEndLoopGatesGate = EndLoopGates.GetOutPort( 'Gate' ) + LoopGates.SetName( 'LoopGates' ) + LoopGates.SetAuthor( '' ) + LoopGates.SetComment( 'Compute Node' ) + LoopGates.Coords( 13 , 236 ) + + # Creation of Switch Nodes + PySwitchGates = [] + PySwitchGates.append( 'def SwitchGates(Index) : ' ) + PySwitchGates.append( ' Odd = 0 ' ) + PySwitchGates.append( ' Even = 0 ' ) + PySwitchGates.append( ' default = 0 ' ) + PySwitchGates.append( ' if Index > 0 : ' ) + PySwitchGates.append( ' if (Index & 1) == 1 : ' ) + PySwitchGates.append( ' Odd = 1 ' ) + PySwitchGates.append( ' if (Index & 1) == 0 : ' ) + PySwitchGates.append( ' Even = 1 ' ) + PySwitchGates.append( ' else : ' ) + PySwitchGates.append( ' default = 1 ' ) + PySwitchGates.append( ' return Odd,Even,default ' ) + SwitchGates,EndSwitchGates = GraphSwitchGatesdefaultBranch.SNode( 'SwitchGates' , PySwitchGates ) + EndSwitchGates.SetName( 'EndSwitchGates' ) + EndSwitchGates.SetAuthor( '' ) + EndSwitchGates.SetComment( 'Compute Node' ) + EndSwitchGates.Coords( 647 , 272 ) + PyEndSwitchGates = [] + PyEndSwitchGates.append( 'from time import * ' ) + PyEndSwitchGates.append( 'def EndSwitchGates() : ' ) + PyEndSwitchGates.append( ' sleep(1) ' ) + PyEndSwitchGates.append( ' return ' ) + PyEndSwitchGates.append( '' ) + EndSwitchGates.SetPyFunction( 'EndSwitchGates' , PyEndSwitchGates ) + IEndSwitchGatesDefault = EndSwitchGates.GetInPort( 'Default' ) + OEndSwitchGatesGate = EndSwitchGates.GetOutPort( 'Gate' ) + SwitchGates.SetName( 'SwitchGates' ) + SwitchGates.SetAuthor( '' ) + SwitchGates.SetComment( 'Compute Node' ) + SwitchGates.Coords( 204 , 236 ) + ISwitchGatesIndex = SwitchGates.InPort( 'Index' , 'long' ) + ISwitchGatesGate = SwitchGates.GetInPort( 'Gate' ) + OSwitchGatesOdd = SwitchGates.OutPort( 'Odd' , 'long' ) + OSwitchGatesEven = SwitchGates.OutPort( 'Even' , 'long' ) + OSwitchGatesdefault = SwitchGates.OutPort( 'default' , 'long' ) + OSwitchGatesDefault = SwitchGates.GetOutPort( 'Default' ) + + # Creation of Links + LLoopGatesIndexEndLoopGatesIndex = GraphSwitchGatesdefaultBranch.Link( OLoopGatesIndex , IEndLoopGatesIndex ) + + LLoopGatesIndexSwitchGatesIndex = GraphSwitchGatesdefaultBranch.Link( OLoopGatesIndex , ISwitchGatesIndex ) + + LLoopGatesMaxEndLoopGatesMax = GraphSwitchGatesdefaultBranch.Link( OLoopGatesMax , IEndLoopGatesMax ) + + LLoopGatesMinEndLoopGatesMin = GraphSwitchGatesdefaultBranch.Link( OLoopGatesMin , IEndLoopGatesMin ) + + LSwitchGatesOddIsOddGate = GraphSwitchGatesdefaultBranch.Link( OSwitchGatesOdd , IIsOddGate ) + + LSwitchGatesEvenIsEvenGate = GraphSwitchGatesdefaultBranch.Link( OSwitchGatesEven , IIsEvenGate ) + + LSwitchGatesdefaultdefaultNodeGate = GraphSwitchGatesdefaultBranch.Link( OSwitchGatesdefault , IdefaultNodeGate ) + + LEndSwitchGatesGateEndLoopGatesGate = GraphSwitchGatesdefaultBranch.Link( OEndSwitchGatesGate , IEndLoopGatesGate ) + + LIsOddGateEndSwitchGatesDefault = GraphSwitchGatesdefaultBranch.Link( OIsOddGate , IEndSwitchGatesDefault ) + + LIsEvenGateEndSwitchGatesDefault = GraphSwitchGatesdefaultBranch.Link( OIsEvenGate , IEndSwitchGatesDefault ) + + LdefaultNodeGateEndSwitchGatesDefault = GraphSwitchGatesdefaultBranch.Link( OdefaultNodeGate , IEndSwitchGatesDefault ) + + # Input datas + ILoopGatesIndex.Input( 0 ) + ILoopGatesMax.Input( 13 ) + ILoopGatesMin.Input( -7 ) + + # Output Ports of the graph + #OEndLoopGatesIndex = EndLoopGates.GetOutPort( 'Index' ) + #OEndLoopGatesMax = EndLoopGates.GetOutPort( 'Max' ) + #OEndLoopGatesMin = EndLoopGates.GetOutPort( 'Min' ) + return GraphSwitchGatesdefaultBranch + + +GraphSwitchGatesdefaultBranch = DefGraphSwitchGatesdefaultBranch() diff --git a/examples/GraphSwitchGatesdefaultBranch.xml b/examples/GraphSwitchGatesdefaultBranch.xml new file mode 100644 index 0000000..811665e --- /dev/null +++ b/examples/GraphSwitchGatesdefaultBranch.xml @@ -0,0 +1,399 @@ + + + + + +? + ? + GraphSwitchGatesdefaultBranch + 1 + ? + +GraphSwitchGatesdefaultBranch + + +long + LoopGates__Index + +long + LoopGates__Max + +long + LoopGates__Min + + +long + EndLoopGates__Index + +long + EndLoopGates__Max + +long + EndLoopGates__Min + + + 16/2/2005 - 10:40:8 + 16/2/2005 - 15:13:4 + 2.0 + JR + ? + ? + 0 + 0 + + +? + ? + LoopGates + 4 + EndLoopGates + +LoopGates + + +long + Index + +long + Max + +long + Min + + +long + Index + +long + Max + +long + Min + + + +InitLoop + + + + +MoreLoop + + + + + = Min : ]]> + + + +NextLoop + + + + 16/2/2005 - 15:4:47 + 16/2/2005 - 15:4:47 + 2.0 + ? + ? + Compute Node + 13 + 236 + +? + ? + EndLoopGates + 5 + LoopGates + +EndLoopGates + + +long + Index + +long + Max + +long + Min + + +long + Index + +long + Max + +long + Min + + + +EndLoopGates + + 16/2/2005 - 15:4:47 + 16/2/2005 - 15:4:47 + 2.0 + ? + ? + Compute Node + 875 + 216 + +? + ? + SwitchGates + 6 + EndSwitchGates + +SwitchGates + + +long + Index + + +long + Odd + +long + Even + +long + default + + + +SwitchGates + + + + + 0 : ]]> + + + + + + + + 16/2/2005 - 15:4:47 + 16/2/2005 - 15:4:47 + 2.0 + ? + ? + Compute Node + 204 + 236 + +? + ? + EndSwitchGates + 7 + SwitchGates + +EndSwitchGates + + + + + +EndSwitchGates + + + + + + 16/2/2005 - 15:4:47 + 16/2/2005 - 15:4:47 + 2.0 + ? + ? + Compute Node + 647 + 272 + +? + ? + IsOdd + 3 + ? + +IsOdd + + + + + +IsOdd + + + + + 16/2/2005 - 15:4:47 + 16/2/2005 - 15:4:47 + 2.0 + ? + ? + Compute Node + 424 + 116 + +? + ? + IsEven + 3 + ? + +IsEven + + + + + +IsEven + + + + + 16/2/2005 - 15:4:47 + 16/2/2005 - 15:4:47 + 2.0 + ? + ? + Compute Node + 428 + 345 + +? + ? + defaultNode + 3 + ? + +defaultNode + + + + + +defaultNode + + + + + 16/2/2005 - 15:12:49 + 16/2/2005 - 15:12:49 + 2.0 + ? + ? + Compute Node + 425 + 232 + + +LoopGates + DoLoop + EndLoopGates + DoLoop + + +LoopGates + Index + EndLoopGates + Index + + +LoopGates + Index + SwitchGates + Index + + +LoopGates + Max + EndLoopGates + Max + + +LoopGates + Min + EndLoopGates + Min + + +EndLoopGates + DoLoop + LoopGates + DoLoop + + +SwitchGates + Odd + IsOdd + Gate + + +SwitchGates + Even + IsEven + Gate + + +SwitchGates + default + defaultNode + Gate + + +EndSwitchGates + Gate + EndLoopGates + Gate + + +IsOdd + Gate + EndSwitchGates + Default + + +IsEven + Gate + EndSwitchGates + Default + + +defaultNode + Gate + EndSwitchGates + Default + + + +GraphSwitchGatesdefaultBranch + LoopGates__Index + LoopGates + Index + +3 + 0 + + +GraphSwitchGatesdefaultBranch + LoopGates__Max + LoopGates + Max + +3 + 13 + + +GraphSwitchGatesdefaultBranch + LoopGates__Min + LoopGates + Min + +3 + -7 + diff --git a/examples/GraphSwitchManyCases.py b/examples/GraphSwitchManyCases.py new file mode 100644 index 0000000..8482780 --- /dev/null +++ b/examples/GraphSwitchManyCases.py @@ -0,0 +1,233 @@ + +# Generated python file of Graph GraphSwitchManyCases + +from SuperV import * + +# Graph creation of GraphSwitchManyCases +def DefGraphSwitchManyCases() : + GraphSwitchManyCases = Graph( 'GraphSwitchManyCases' ) + GraphSwitchManyCases.SetName( 'GraphSwitchManyCases' ) + GraphSwitchManyCases.SetAuthor( 'JR' ) + GraphSwitchManyCases.SetComment( '' ) + GraphSwitchManyCases.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyCase1 = [] + PyCase1.append( 'from time import * ' ) + PyCase1.append( 'def Case1(a) : ' ) + PyCase1.append( ' sleep(1) ' ) + PyCase1.append( ' return a ' ) + Case1 = GraphSwitchManyCases.INode( 'Case1' , PyCase1 ) + Case1.SetName( 'Case1' ) + Case1.SetAuthor( '' ) + Case1.SetComment( 'Compute Node' ) + Case1.Coords( 448 , 13 ) + ICase1a = Case1.InPort( 'a' , 'long' ) + ICase1Gate = Case1.GetInPort( 'Gate' ) + OCase1a = Case1.OutPort( 'a' , 'long' ) + OCase1Gate = Case1.GetOutPort( 'Gate' ) + + PyCase3 = [] + PyCase3.append( 'from time import * ' ) + PyCase3.append( 'def Case3(b) : ' ) + PyCase3.append( ' sleep(1) ' ) + PyCase3.append( ' return b ' ) + Case3 = GraphSwitchManyCases.INode( 'Case3' , PyCase3 ) + Case3.SetName( 'Case3' ) + Case3.SetAuthor( '' ) + Case3.SetComment( 'Compute Node' ) + Case3.Coords( 458 , 286 ) + ICase3b = Case3.InPort( 'b' , 'long' ) + ICase3Gate = Case3.GetInPort( 'Gate' ) + OCase3b = Case3.OutPort( 'b' , 'long' ) + OCase3Gate = Case3.GetOutPort( 'Gate' ) + + PyCase4 = [] + PyCase4.append( 'from time import * ' ) + PyCase4.append( 'def Case4(c) : ' ) + PyCase4.append( ' sleep(1) ' ) + PyCase4.append( ' return ' ) + Case4 = GraphSwitchManyCases.INode( 'Case4' , PyCase4 ) + Case4.SetName( 'Case4' ) + Case4.SetAuthor( '' ) + Case4.SetComment( 'Compute Node' ) + Case4.Coords( 459 , 493 ) + ICase4c = Case4.InPort( 'c' , 'long' ) + ICase4Gate = Case4.GetInPort( 'Gate' ) + OCase4Gate = Case4.GetOutPort( 'Gate' ) + + PyCase2a = [] + PyCase2a.append( 'from time import * ' ) + PyCase2a.append( 'def Case2a(a) : ' ) + PyCase2a.append( ' sleep(1) ' ) + PyCase2a.append( ' return a ' ) + Case2a = GraphSwitchManyCases.INode( 'Case2a' , PyCase2a ) + Case2a.SetName( 'Case2a' ) + Case2a.SetAuthor( '' ) + Case2a.SetComment( 'Compute Node' ) + Case2a.Coords( 453 , 154 ) + ICase2aa = Case2a.InPort( 'a' , 'long' ) + ICase2aGate = Case2a.GetInPort( 'Gate' ) + OCase2aa = Case2a.OutPort( 'a' , 'long' ) + OCase2aGate = Case2a.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyLoop = [] + PyLoop.append( 'def Init(Index,Max,Min) : ' ) + PyLoop.append( ' Index = Max ' ) + PyLoop.append( ' return Index,Max,Min ' ) + PyMoreLoop = [] + PyMoreLoop.append( 'def More(Index,Max,Min) : ' ) + PyMoreLoop.append( ' if Index >= Min : ' ) + PyMoreLoop.append( ' DoLoop = 1 ' ) + PyMoreLoop.append( ' else : ' ) + PyMoreLoop.append( ' DoLoop = 0 ' ) + PyMoreLoop.append( ' return DoLoop,Index,Max,Min ' ) + PyNextLoop = [] + PyNextLoop.append( 'def Next(Index,Max,Min) : ' ) + PyNextLoop.append( ' Index = Index - 1 ' ) + PyNextLoop.append( ' return Index,Max,Min ' ) + Loop,EndLoop = GraphSwitchManyCases.LNode( 'Init' , PyLoop , 'More' , PyMoreLoop , 'Next' , PyNextLoop ) + EndLoop.SetName( 'EndLoop' ) + EndLoop.SetAuthor( '' ) + EndLoop.SetComment( 'Compute Node' ) + EndLoop.Coords( 972 , 344 ) + PyEndLoop = [] + EndLoop.SetPyFunction( 'EndLoop' , PyEndLoop ) + ILoopDoLoop = Loop.GetInPort( 'DoLoop' ) + ILoopIndex = Loop.InPort( 'Index' , 'long' ) + ILoopMax = Loop.InPort( 'Max' , 'long' ) + ILoopMin = Loop.InPort( 'Min' , 'long' ) + ILoopGate = Loop.GetInPort( 'Gate' ) + OLoopDoLoop = Loop.GetOutPort( 'DoLoop' ) + OLoopIndex = Loop.GetOutPort( 'Index' ) + OLoopMax = Loop.GetOutPort( 'Max' ) + OLoopMin = Loop.GetOutPort( 'Min' ) + IEndLoopDoLoop = EndLoop.GetInPort( 'DoLoop' ) + IEndLoopIndex = EndLoop.GetInPort( 'Index' ) + IEndLoopMax = EndLoop.GetInPort( 'Max' ) + IEndLoopMin = EndLoop.GetInPort( 'Min' ) + IEndLoopGate = EndLoop.GetInPort( 'Gate' ) + OEndLoopDoLoop = EndLoop.GetOutPort( 'DoLoop' ) + OEndLoopIndex = EndLoop.GetOutPort( 'Index' ) + OEndLoopMax = EndLoop.GetOutPort( 'Max' ) + OEndLoopMin = EndLoop.GetOutPort( 'Min' ) + OEndLoopGate = EndLoop.GetOutPort( 'Gate' ) + Loop.SetName( 'Loop' ) + Loop.SetAuthor( '' ) + Loop.SetComment( 'Compute Node' ) + Loop.Coords( 15 , 336 ) + + # Creation of Switch Nodes + PySwitch = [] + PySwitch.append( 'from time import * ' ) + PySwitch.append( 'def Switch(Index) : ' ) + PySwitch.append( ' sleep(1) ' ) + PySwitch.append( ' SB1 = 0 ' ) + PySwitch.append( ' SB2 = 0 ' ) + PySwitch.append( ' if (Index & 3) == 3 : ' ) + PySwitch.append( ' SB1 = 1 ' ) + PySwitch.append( ' elif (Index & 3) == 0 : ' ) + PySwitch.append( ' SB2 = 1 ' ) + PySwitch.append( ' return SB1,SB2,Index,Index+1,Index+2,Index+3,Index+4,Index+5 ' ) + Switch,EndSwitch = GraphSwitchManyCases.SNode( 'Switch' , PySwitch ) + EndSwitch.SetName( 'EndSwitch' ) + EndSwitch.SetAuthor( '' ) + EndSwitch.SetComment( 'Compute Node' ) + EndSwitch.Coords( 732 , 344 ) + PyEndSwitch = [] + PyEndSwitch.append( 'from time import * ' ) + PyEndSwitch.append( 'def EndSwitch(a,b,dd,e,f) : ' ) + PyEndSwitch.append( ' sleep(1) ' ) + PyEndSwitch.append( ' if b != (a+1) : ' ) + PyEndSwitch.append( ' print 'EndSwitch ERROR' ' ) + PyEndSwitch.append( ' pass ' ) + PyEndSwitch.append( ' if dd != (a+3) : ' ) + PyEndSwitch.append( ' print 'EndSwitch ERROR' ' ) + PyEndSwitch.append( ' pass ' ) + PyEndSwitch.append( ' if e != (a+4) : ' ) + PyEndSwitch.append( ' print 'EndSwitch ERROR' ' ) + PyEndSwitch.append( ' pass ' ) + PyEndSwitch.append( ' if f != (a+5) : ' ) + PyEndSwitch.append( ' print 'EndSwitch ERROR' ' ) + PyEndSwitch.append( ' pass ' ) + PyEndSwitch.append( ' return a ' ) + EndSwitch.SetPyFunction( 'EndSwitch' , PyEndSwitch ) + IEndSwitcha = EndSwitch.InPort( 'a' , 'long' ) + IEndSwitchb = EndSwitch.InPort( 'b' , 'long' ) + IEndSwitchdd = EndSwitch.InPort( 'dd' , 'long' ) + IEndSwitche = EndSwitch.InPort( 'e' , 'long' ) + IEndSwitchf = EndSwitch.InPort( 'f' , 'long' ) + IEndSwitchDefault = EndSwitch.GetInPort( 'Default' ) + OEndSwitchIndex = EndSwitch.OutPort( 'Index' , 'long' ) + OEndSwitchGate = EndSwitch.GetOutPort( 'Gate' ) + Switch.SetName( 'Switch' ) + Switch.SetAuthor( '' ) + Switch.SetComment( 'Compute Node' ) + Switch.Coords( 232 , 285 ) + ISwitchIndex = Switch.InPort( 'Index' , 'long' ) + ISwitchGate = Switch.GetInPort( 'Gate' ) + OSwitchSB1 = Switch.OutPort( 'SB1' , 'long' ) + OSwitchSB2 = Switch.OutPort( 'SB2' , 'long' ) + OSwitcha = Switch.OutPort( 'a' , 'long' ) + OSwitchb = Switch.OutPort( 'b' , 'long' ) + OSwitchc = Switch.OutPort( 'c' , 'long' ) + OSwitchd = Switch.OutPort( 'd' , 'long' ) + OSwitche = Switch.OutPort( 'e' , 'long' ) + OSwitchf = Switch.OutPort( 'f' , 'long' ) + OSwitchDefault = Switch.GetOutPort( 'Default' ) + + # Creation of Links + LLoopIndexSwitchIndex = GraphSwitchManyCases.Link( OLoopIndex , ISwitchIndex ) + + LLoopMaxEndLoopMax = GraphSwitchManyCases.Link( OLoopMax , IEndLoopMax ) + + LLoopMinEndLoopMin = GraphSwitchManyCases.Link( OLoopMin , IEndLoopMin ) + + LSwitchSB1Case1Gate = GraphSwitchManyCases.Link( OSwitchSB1 , ICase1Gate ) + + LSwitchSB2Case2aGate = GraphSwitchManyCases.Link( OSwitchSB2 , ICase2aGate ) + + LSwitchaCase1a = GraphSwitchManyCases.Link( OSwitcha , ICase1a ) + + LSwitchaCase2aa = GraphSwitchManyCases.Link( OSwitcha , ICase2aa ) + + LSwitchbCase3b = GraphSwitchManyCases.Link( OSwitchb , ICase3b ) + + LSwitchcCase4c = GraphSwitchManyCases.Link( OSwitchc , ICase4c ) + + LSwitchdEndSwitchdd = GraphSwitchManyCases.Link( OSwitchd , IEndSwitchdd ) + + LSwitcheEndSwitche = GraphSwitchManyCases.Link( OSwitche , IEndSwitche ) + + LSwitchDefaultEndSwitchDefault = GraphSwitchManyCases.Link( OSwitchDefault , IEndSwitchDefault ) + + LEndSwitchIndexEndLoopIndex = GraphSwitchManyCases.Link( OEndSwitchIndex , IEndLoopIndex ) + + LCase1aEndSwitcha = GraphSwitchManyCases.Link( OCase1a , IEndSwitcha ) + + LCase3bEndSwitchb = GraphSwitchManyCases.Link( OCase3b , IEndSwitchb ) + + LCase4GateEndSwitchDefault = GraphSwitchManyCases.Link( OCase4Gate , IEndSwitchDefault ) + + LCase2aaEndSwitcha = GraphSwitchManyCases.Link( OCase2aa , IEndSwitcha ) + + # Input datas + ILoopIndex.Input( 0 ) + ILoopMax.Input( 23 ) + ILoopMin.Input( -7 ) + + # Input Ports of the graph + #IEndSwitchf = EndSwitch.GetInPort( 'f' ) + + # Output Ports of the graph + #OEndLoopIndex = EndLoop.GetOutPort( 'Index' ) + #OEndLoopMax = EndLoop.GetOutPort( 'Max' ) + #OEndLoopMin = EndLoop.GetOutPort( 'Min' ) + #OSwitchf = Switch.GetOutPort( 'f' ) + return GraphSwitchManyCases + + +GraphSwitchManyCases = DefGraphSwitchManyCases() diff --git a/examples/GraphSwitchManyCases.xml b/examples/GraphSwitchManyCases.xml new file mode 100644 index 0000000..da68705 --- /dev/null +++ b/examples/GraphSwitchManyCases.xml @@ -0,0 +1,656 @@ + + + + + + ? + ? + GraphSwitchManyCases + 1 + ? + + GraphSwitchManyCases_1 + + + long + Loop__Index + + + long + Loop__Max + + + long + Loop__Min + + + long + EndSwitch__f + + + + + long + EndLoop__Index + + + long + EndLoop__Max + + + long + EndLoop__Min + + + long + Switch__f + + + + + + 29/6/2005 - 16:32:43 + 25/8/2005 - 12:41:10 + 2.0 + JR + ? + ? + 0 + 0 + + + + + ? + ? + Loop + 4 + EndLoop + + Loop + + + long + Index + + + long + Max + + + long + Min + + + + + long + Index + + + long + Max + + + long + Min + + + + + + + Init + + + + + + More + + = Min : ]]> + + + + + + + Next + + + + + + 25/8/2005 - 12:41:10 + 25/8/2005 - 12:41:10 + 2.0 + ? + ? + Compute Node + 15 + 336 + + + ? + ? + EndLoop + 5 + Loop + + EndLoop + + + long + Index + + + long + Max + + + long + Min + + + + + long + Index + + + long + Max + + + long + Min + + + + + + + EndLoop + + + + 25/8/2005 - 12:41:10 + 25/8/2005 - 12:41:10 + 2.0 + ? + ? + Compute Node + 972 + 344 + + + ? + ? + Switch + 6 + EndSwitch + + Switch + + + long + Index + + + + + long + SB1 + + + long + SB2 + + + long + a + + + long + b + + + long + c + + + long + d + + + long + e + + + long + f + + + + + + + Switch + + + + + + + + + + + + + 25/8/2005 - 12:41:10 + 25/8/2005 - 12:41:10 + 2.0 + ? + ? + Compute Node + 232 + 285 + + + ? + ? + EndSwitch + 7 + Switch + + EndSwitch + + + long + a + + + long + b + + + long + dd + + + long + e + + + long + f + + + + + long + Index + + + + + + + EndSwitch + + + + + + + + + + + + + + + + + + + 25/8/2005 - 12:41:10 + 25/8/2005 - 12:41:10 + 2.0 + ? + ? + Compute Node + 732 + 344 + + + ? + ? + Case1 + 3 + ? + + Case1 + + + long + a + + + + + long + a + + + + + + + Case1 + + + + + + + 25/8/2005 - 12:41:10 + 25/8/2005 - 12:41:10 + 2.0 + ? + ? + Compute Node + 448 + 13 + + + ? + ? + Case3 + 3 + ? + + Case3 + + + long + b + + + + + long + b + + + + + + + Case3 + + + + + + + 25/8/2005 - 12:41:10 + 25/8/2005 - 12:41:10 + 2.0 + ? + ? + Compute Node + 458 + 286 + + + ? + ? + Case4 + 3 + ? + + Case4 + + + long + c + + + + + + + + Case4 + + + + + + + 25/8/2005 - 12:41:10 + 25/8/2005 - 12:41:10 + 2.0 + ? + ? + Compute Node + 459 + 493 + + + ? + ? + Case2a + 3 + ? + + Case2a + + + long + a + + + + + long + a + + + + + + + Case2a + + + + + + + 25/8/2005 - 12:41:10 + 25/8/2005 - 12:41:10 + 2.0 + ? + ? + Compute Node + 453 + 154 + + + + + Loop + DoLoop + EndLoop + DoLoop + + + + Loop + Index + Switch + Index + + + + Loop + Max + EndLoop + Max + + + + Loop + Min + EndLoop + Min + + + + EndLoop + DoLoop + Loop + DoLoop + + + + Switch + SB1 + Case1 + Gate + + + + Switch + SB2 + Case2a + Gate + + + + Switch + a + Case1 + a + + + + Switch + a + Case2a + a + + + + Switch + b + Case3 + b + + + + Switch + c + Case4 + c + + + + Switch + d + EndSwitch + dd + + + + Switch + e + EndSwitch + e + + + + Switch + Default + EndSwitch + Default + + + + EndSwitch + Index + EndLoop + Index + + + + Case1 + a + EndSwitch + a + + + + Case3 + b + EndSwitch + b + + + + Case4 + Gate + EndSwitch + Default + + + + Case2a + a + EndSwitch + a + + + + + + GraphSwitchManyCases + Loop__Index + Loop + Index + + 3 + 0 + + + + + GraphSwitchManyCases + Loop__Max + Loop + Max + + 3 + 23 + + + + + GraphSwitchManyCases + Loop__Min + Loop + Min + + 3 + -7 + + + + + + + diff --git a/examples/GraphSwitchManyCasesNOTValid.py b/examples/GraphSwitchManyCasesNOTValid.py new file mode 100644 index 0000000..ff312e3 --- /dev/null +++ b/examples/GraphSwitchManyCasesNOTValid.py @@ -0,0 +1,250 @@ + +# Generated python file of Graph GraphSwitchManyCasesNOTValid + +from SuperV import * + +# Graph creation of GraphSwitchManyCasesNOTValid +def DefGraphSwitchManyCasesNOTValid() : + GraphSwitchManyCasesNOTValid = Graph( 'GraphSwitchManyCasesNOTValid' ) + GraphSwitchManyCasesNOTValid.SetName( 'GraphSwitchManyCasesNOTValid' ) + GraphSwitchManyCasesNOTValid.SetAuthor( 'JR' ) + GraphSwitchManyCasesNOTValid.SetComment( '' ) + GraphSwitchManyCasesNOTValid.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyCase1 = [] + PyCase1.append( 'from time import * ' ) + PyCase1.append( 'def Case1(a) : ' ) + PyCase1.append( ' sleep(1) ' ) + PyCase1.append( ' return a ' ) + Case1 = GraphSwitchManyCasesNOTValid.INode( 'Case1' , PyCase1 ) + Case1.SetName( 'Case1' ) + Case1.SetAuthor( '' ) + Case1.SetComment( 'Compute Node' ) + Case1.Coords( 448 , 13 ) + ICase1a = Case1.InPort( 'a' , 'long' ) + ICase1Gate = Case1.GetInPort( 'Gate' ) + OCase1a = Case1.OutPort( 'a' , 'long' ) + OCase1Gate = Case1.GetOutPort( 'Gate' ) + + PyCase3 = [] + PyCase3.append( 'from time import * ' ) + PyCase3.append( 'def Case3(b) : ' ) + PyCase3.append( ' sleep(1) ' ) + PyCase3.append( ' return b ' ) + Case3 = GraphSwitchManyCasesNOTValid.INode( 'Case3' , PyCase3 ) + Case3.SetName( 'Case3' ) + Case3.SetAuthor( '' ) + Case3.SetComment( 'Compute Node' ) + Case3.Coords( 461 , 500 ) + ICase3b = Case3.InPort( 'b' , 'long' ) + ICase3Gate = Case3.GetInPort( 'Gate' ) + OCase3b = Case3.OutPort( 'b' , 'long' ) + OCase3Gate = Case3.GetOutPort( 'Gate' ) + + PyCase4 = [] + PyCase4.append( 'from time import * ' ) + PyCase4.append( 'def Case4(c) : ' ) + PyCase4.append( ' sleep(1) ' ) + PyCase4.append( ' return ' ) + Case4 = GraphSwitchManyCasesNOTValid.INode( 'Case4' , PyCase4 ) + Case4.SetName( 'Case4' ) + Case4.SetAuthor( '' ) + Case4.SetComment( 'Compute Node' ) + Case4.Coords( 455 , 647 ) + ICase4c = Case4.InPort( 'c' , 'long' ) + ICase4Gate = Case4.GetInPort( 'Gate' ) + OCase4Gate = Case4.GetOutPort( 'Gate' ) + + PyCase2 = [] + PyCase2.append( 'from time import * ' ) + PyCase2.append( 'def Case2() : ' ) + PyCase2.append( ' sleep(1) ' ) + PyCase2.append( ' return ' ) + Case2 = GraphSwitchManyCasesNOTValid.INode( 'Case2' , PyCase2 ) + Case2.SetName( 'Case2' ) + Case2.SetAuthor( '' ) + Case2.SetComment( 'Compute Node' ) + Case2.Coords( 455 , 179 ) + ICase2Gate = Case2.GetInPort( 'Gate' ) + OCase2Gate = Case2.GetOutPort( 'Gate' ) + + PyCase2a = [] + PyCase2a.append( 'from time import * ' ) + PyCase2a.append( 'def Case2a(a) : ' ) + PyCase2a.append( ' sleep(1) ' ) + PyCase2a.append( ' return a ' ) + Case2a = GraphSwitchManyCasesNOTValid.INode( 'Case2a' , PyCase2a ) + Case2a.SetName( 'Case2a' ) + Case2a.SetAuthor( '' ) + Case2a.SetComment( 'Compute Node' ) + Case2a.Coords( 456 , 304 ) + ICase2aa = Case2a.InPort( 'a' , 'long' ) + ICase2aGate = Case2a.GetInPort( 'Gate' ) + OCase2aa = Case2a.OutPort( 'a' , 'long' ) + OCase2aGate = Case2a.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyLoop = [] + PyLoop.append( 'def Init(Index,Max,Min) : ' ) + PyLoop.append( ' Index = Max ' ) + PyLoop.append( ' return Index,Max,Min ' ) + PyMoreLoop = [] + PyMoreLoop.append( 'def More(Index,Max,Min) : ' ) + PyMoreLoop.append( ' if Index >= Min : ' ) + PyMoreLoop.append( ' DoLoop = 1 ' ) + PyMoreLoop.append( ' else : ' ) + PyMoreLoop.append( ' DoLoop = 0 ' ) + PyMoreLoop.append( ' return DoLoop,Index,Max,Min ' ) + PyNextLoop = [] + PyNextLoop.append( 'def Next(Index,Max,Min) : ' ) + PyNextLoop.append( ' Index = Index - 1 ' ) + PyNextLoop.append( ' return Index,Max,Min ' ) + Loop,EndLoop = GraphSwitchManyCasesNOTValid.LNode( 'Init' , PyLoop , 'More' , PyMoreLoop , 'Next' , PyNextLoop ) + EndLoop.SetName( 'EndLoop' ) + EndLoop.SetAuthor( '' ) + EndLoop.SetComment( 'Compute Node' ) + EndLoop.Coords( 972 , 344 ) + PyEndLoop = [] + EndLoop.SetPyFunction( 'EndLoop' , PyEndLoop ) + ILoopDoLoop = Loop.GetInPort( 'DoLoop' ) + ILoopIndex = Loop.InPort( 'Index' , 'long' ) + ILoopMax = Loop.InPort( 'Max' , 'long' ) + ILoopMin = Loop.InPort( 'Min' , 'long' ) + ILoopGate = Loop.GetInPort( 'Gate' ) + OLoopDoLoop = Loop.GetOutPort( 'DoLoop' ) + OLoopIndex = Loop.GetOutPort( 'Index' ) + OLoopMax = Loop.GetOutPort( 'Max' ) + OLoopMin = Loop.GetOutPort( 'Min' ) + IEndLoopDoLoop = EndLoop.GetInPort( 'DoLoop' ) + IEndLoopIndex = EndLoop.GetInPort( 'Index' ) + IEndLoopMax = EndLoop.GetInPort( 'Max' ) + IEndLoopMin = EndLoop.GetInPort( 'Min' ) + IEndLoopGate = EndLoop.GetInPort( 'Gate' ) + OEndLoopDoLoop = EndLoop.GetOutPort( 'DoLoop' ) + OEndLoopIndex = EndLoop.GetOutPort( 'Index' ) + OEndLoopMax = EndLoop.GetOutPort( 'Max' ) + OEndLoopMin = EndLoop.GetOutPort( 'Min' ) + OEndLoopGate = EndLoop.GetOutPort( 'Gate' ) + Loop.SetName( 'Loop' ) + Loop.SetAuthor( '' ) + Loop.SetComment( 'Compute Node' ) + Loop.Coords( 15 , 336 ) + + # Creation of Switch Nodes + PySwitch = [] + PySwitch.append( 'from time import * ' ) + PySwitch.append( 'def Switch(Index) : ' ) + PySwitch.append( ' sleep(1) ' ) + PySwitch.append( ' SB1 = 0 ' ) + PySwitch.append( ' SB2 = 0 ' ) + PySwitch.append( ' if (Index & 3) == 3 : ' ) + PySwitch.append( ' SB1 = 1 ' ) + PySwitch.append( ' elif (Index & 3) == 0 : ' ) + PySwitch.append( ' SB2 = 1 ' ) + PySwitch.append( ' return SB1,SB2,Index,Index+1,Index+2,Index+3,Index+4,Index+5 ' ) + Switch,EndSwitch = GraphSwitchManyCasesNOTValid.SNode( 'Switch' , PySwitch ) + EndSwitch.SetName( 'EndSwitch' ) + EndSwitch.SetAuthor( '' ) + EndSwitch.SetComment( 'Compute Node' ) + EndSwitch.Coords( 732 , 344 ) + PyEndSwitch = [] + PyEndSwitch.append( 'from time import * ' ) + PyEndSwitch.append( 'def EndSwitch(a,b,dd,e,f) : ' ) + PyEndSwitch.append( ' sleep(1) ' ) + PyEndSwitch.append( ' if b != (a+1) : ' ) + PyEndSwitch.append( ' print 'EndSwitch ERROR' ' ) + PyEndSwitch.append( ' pass ' ) + PyEndSwitch.append( ' if dd != (a+3) : ' ) + PyEndSwitch.append( ' print 'EndSwitch ERROR' ' ) + PyEndSwitch.append( ' pass ' ) + PyEndSwitch.append( ' if e != (a+4) : ' ) + PyEndSwitch.append( ' print 'EndSwitch ERROR' ' ) + PyEndSwitch.append( ' pass ' ) + PyEndSwitch.append( ' if f != (a+5) : ' ) + PyEndSwitch.append( ' print 'EndSwitch ERROR' ' ) + PyEndSwitch.append( ' pass ' ) + PyEndSwitch.append( ' return a ' ) + EndSwitch.SetPyFunction( 'EndSwitch' , PyEndSwitch ) + IEndSwitcha = EndSwitch.InPort( 'a' , 'long' ) + IEndSwitchb = EndSwitch.InPort( 'b' , 'long' ) + IEndSwitchdd = EndSwitch.InPort( 'dd' , 'long' ) + IEndSwitche = EndSwitch.InPort( 'e' , 'long' ) + IEndSwitchf = EndSwitch.InPort( 'f' , 'long' ) + IEndSwitchDefault = EndSwitch.GetInPort( 'Default' ) + OEndSwitchIndex = EndSwitch.OutPort( 'Index' , 'long' ) + OEndSwitchGate = EndSwitch.GetOutPort( 'Gate' ) + Switch.SetName( 'Switch' ) + Switch.SetAuthor( '' ) + Switch.SetComment( 'Compute Node' ) + Switch.Coords( 232 , 285 ) + ISwitchIndex = Switch.InPort( 'Index' , 'long' ) + ISwitchGate = Switch.GetInPort( 'Gate' ) + OSwitchSB1 = Switch.OutPort( 'SB1' , 'long' ) + OSwitchSB2 = Switch.OutPort( 'SB2' , 'long' ) + OSwitcha = Switch.OutPort( 'a' , 'long' ) + OSwitchb = Switch.OutPort( 'b' , 'long' ) + OSwitchc = Switch.OutPort( 'c' , 'long' ) + OSwitchd = Switch.OutPort( 'd' , 'long' ) + OSwitche = Switch.OutPort( 'e' , 'long' ) + OSwitchf = Switch.OutPort( 'f' , 'long' ) + OSwitchDefault = Switch.GetOutPort( 'Default' ) + + # Creation of Links + LLoopIndexSwitchIndex = GraphSwitchManyCasesNOTValid.Link( OLoopIndex , ISwitchIndex ) + + LLoopMaxEndLoopMax = GraphSwitchManyCasesNOTValid.Link( OLoopMax , IEndLoopMax ) + + LLoopMinEndLoopMin = GraphSwitchManyCasesNOTValid.Link( OLoopMin , IEndLoopMin ) + + LSwitchSB1Case1Gate = GraphSwitchManyCasesNOTValid.Link( OSwitchSB1 , ICase1Gate ) + + LSwitchSB2Case2Gate = GraphSwitchManyCasesNOTValid.Link( OSwitchSB2 , ICase2Gate ) + + LSwitchSB2Case2aGate = GraphSwitchManyCasesNOTValid.Link( OSwitchSB2 , ICase2aGate ) + + LSwitchaCase1a = GraphSwitchManyCasesNOTValid.Link( OSwitcha , ICase1a ) + + LSwitchaCase2aa = GraphSwitchManyCasesNOTValid.Link( OSwitcha , ICase2aa ) + + LSwitchbCase3b = GraphSwitchManyCasesNOTValid.Link( OSwitchb , ICase3b ) + + LSwitchcCase4c = GraphSwitchManyCasesNOTValid.Link( OSwitchc , ICase4c ) + + LSwitchdEndSwitchdd = GraphSwitchManyCasesNOTValid.Link( OSwitchd , IEndSwitchdd ) + + LSwitcheEndSwitche = GraphSwitchManyCasesNOTValid.Link( OSwitche , IEndSwitche ) + + LSwitchDefaultEndSwitchDefault = GraphSwitchManyCasesNOTValid.Link( OSwitchDefault , IEndSwitchDefault ) + + LEndSwitchIndexEndLoopIndex = GraphSwitchManyCasesNOTValid.Link( OEndSwitchIndex , IEndLoopIndex ) + + LCase1aEndSwitcha = GraphSwitchManyCasesNOTValid.Link( OCase1a , IEndSwitcha ) + + LCase3bEndSwitchb = GraphSwitchManyCasesNOTValid.Link( OCase3b , IEndSwitchb ) + + LCase4GateEndSwitchDefault = GraphSwitchManyCasesNOTValid.Link( OCase4Gate , IEndSwitchDefault ) + + LCase2GateEndSwitchDefault = GraphSwitchManyCasesNOTValid.Link( OCase2Gate , IEndSwitchDefault ) + + LCase2aaEndSwitcha = GraphSwitchManyCasesNOTValid.Link( OCase2aa , IEndSwitcha ) + + # Input datas + ILoopIndex.Input( 0 ) + ILoopMax.Input( 23 ) + ILoopMin.Input( -7 ) + + # Input Ports of the graph + #IEndSwitchf = EndSwitch.GetInPort( 'f' ) + + # Output Ports of the graph + #OEndLoopIndex = EndLoop.GetOutPort( 'Index' ) + #OEndLoopMax = EndLoop.GetOutPort( 'Max' ) + #OEndLoopMin = EndLoop.GetOutPort( 'Min' ) + #OSwitchf = Switch.GetOutPort( 'f' ) + return GraphSwitchManyCasesNOTValid + + +GraphSwitchManyCasesNOTValid = DefGraphSwitchManyCasesNOTValid() diff --git a/examples/GraphSwitchManyCasesNOTValid.xml b/examples/GraphSwitchManyCasesNOTValid.xml new file mode 100644 index 0000000..4883fb3 --- /dev/null +++ b/examples/GraphSwitchManyCasesNOTValid.xml @@ -0,0 +1,567 @@ + + + + + +? + ? + GraphSwitchManyCasesNOTValid + 1 + ? + +GraphSwitchManyCases_1_1_1 + + +long + Loop__Index + +long + Loop__Max + +long + Loop__Min + +long + EndSwitch__f + + +long + EndLoop__Index + +long + EndLoop__Max + +long + EndLoop__Min + +long + Switch__f + + + 29/6/2005 - 16:32:43 + 8/7/2005 - 15:6:33 + 2.0 + JR + ? + ? + 0 + 0 + + +? + ? + Loop + 4 + EndLoop + +Loop + + +long + Index + +long + Max + +long + Min + + +long + Index + +long + Max + +long + Min + + + +Init + + + + +More + + = Min : ]]> + + + + + +Next + + + + 8/7/2005 - 15:6:33 + 8/7/2005 - 15:6:33 + 2.0 + ? + ? + Compute Node + 15 + 336 + +? + ? + EndLoop + 5 + Loop + +EndLoop + + +long + Index + +long + Max + +long + Min + + +long + Index + +long + Max + +long + Min + + + +EndLoop + + 8/7/2005 - 15:6:33 + 8/7/2005 - 15:6:33 + 2.0 + ? + ? + Compute Node + 972 + 344 + +? + ? + Switch + 6 + EndSwitch + +Switch + + +long + Index + + +long + SB1 + +long + SB2 + +long + a + +long + b + +long + c + +long + d + +long + e + +long + f + + + +Switch + + + + + + + + + + + 8/7/2005 - 15:6:33 + 8/7/2005 - 15:6:33 + 2.0 + ? + ? + Compute Node + 232 + 285 + +? + ? + EndSwitch + 7 + Switch + +EndSwitch + + +long + a + +long + b + +long + dd + +long + e + +long + f + + +long + Index + + + +EndSwitch + + + + + + + + + + + + + + + + + 8/7/2005 - 15:6:33 + 8/7/2005 - 15:6:33 + 2.0 + ? + ? + Compute Node + 732 + 344 + +? + ? + Case1 + 3 + ? + +Case1 + + +long + a + + +long + a + + + +Case1 + + + + + 8/7/2005 - 15:6:33 + 8/7/2005 - 15:6:33 + 2.0 + ? + ? + Compute Node + 448 + 13 + +? + ? + Case3 + 3 + ? + +Case3 + + +long + b + + +long + b + + + +Case3 + + + + + 8/7/2005 - 15:6:33 + 8/7/2005 - 15:6:33 + 2.0 + ? + ? + Compute Node + 461 + 500 + +? + ? + Case4 + 3 + ? + +Case4 + + +long + c + + + + +Case4 + + + + + 8/7/2005 - 15:6:33 + 8/7/2005 - 15:6:33 + 2.0 + ? + ? + Compute Node + 455 + 647 + +? + ? + Case2 + 3 + ? + +Case2 + + + + + +Case2 + + + + + 8/7/2005 - 15:6:33 + 8/7/2005 - 15:6:33 + 2.0 + ? + ? + Compute Node + 455 + 179 + +? + ? + Case2a + 3 + ? + +Case2a + + +long + a + + +long + a + + + +Case2a + + + + + 8/7/2005 - 15:6:33 + 8/7/2005 - 15:6:33 + 2.0 + ? + ? + Compute Node + 456 + 304 + + +Loop + DoLoop + EndLoop + DoLoop + + +Loop + Index + Switch + Index + + +Loop + Max + EndLoop + Max + + +Loop + Min + EndLoop + Min + + +EndLoop + DoLoop + Loop + DoLoop + + +Switch + SB1 + Case1 + Gate + + +Switch + SB2 + Case2 + Gate + + +Switch + SB2 + Case2a + Gate + + +Switch + a + Case1 + a + + +Switch + a + Case2a + a + + +Switch + b + Case3 + b + + +Switch + c + Case4 + c + + +Switch + d + EndSwitch + dd + + +Switch + e + EndSwitch + e + + +Switch + Default + EndSwitch + Default + + +EndSwitch + Index + EndLoop + Index + + +Case1 + a + EndSwitch + a + + +Case3 + b + EndSwitch + b + + +Case4 + Gate + EndSwitch + Default + + +Case2 + Gate + EndSwitch + Default + + +Case2a + a + EndSwitch + a + + + +GraphSwitchManyCasesNOTValid + Loop__Index + Loop + Index + +3 + 0 + + +GraphSwitchManyCasesNOTValid + Loop__Max + Loop + Max + +3 + 23 + + +GraphSwitchManyCasesNOTValid + Loop__Min + Loop + Min + +3 + -7 + diff --git a/examples/GraphSwitchNOTExecutable.py b/examples/GraphSwitchNOTExecutable.py new file mode 100644 index 0000000..028cb26 --- /dev/null +++ b/examples/GraphSwitchNOTExecutable.py @@ -0,0 +1,142 @@ + +# Generated python file of Graph GraphSwitchNOTExecutable + +from SuperV import * + +# Graph creation of GraphSwitchNOTExecutable +def DefGraphSwitchNOTExecutable() : + GraphSwitchNOTExecutable = Graph( 'GraphSwitchNOTExecutable' ) + GraphSwitchNOTExecutable.SetName( 'GraphSwitchNOTExecutable' ) + GraphSwitchNOTExecutable.SetAuthor( '' ) + GraphSwitchNOTExecutable.SetComment( '' ) + GraphSwitchNOTExecutable.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsOdd = [] + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd(a) : ' ) + PyIsOdd.append( ' print a,"IsOdd (GraphSwitch)" ' ) + PyIsOdd.append( ' sleep( 1 ) ' ) + PyIsOdd.append( ' return a ' ) + IsOdd = GraphSwitchNOTExecutable.INode( 'IsOdd' , PyIsOdd ) + IsOdd.SetName( 'IsOdd' ) + IsOdd.SetAuthor( '' ) + IsOdd.SetComment( 'Python function' ) + IsOdd.Coords( 389 , 65 ) + IIsOdda = IsOdd.InPort( 'a' , 'long' ) + IIsOddGate = IsOdd.GetInPort( 'Gate' ) + OIsOdda = IsOdd.OutPort( 'a' , 'long' ) + OIsOddGate = IsOdd.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyInitLoopSwitch = [] + PyInitLoopSwitch.append( 'def InitLoop(Index,Min,Max) : ' ) + PyInitLoopSwitch.append( ' return Index,Min,Max ' ) + PyMoreInitLoopSwitch = [] + PyMoreInitLoopSwitch.append( 'def MoreLoop(Index,Min,Max) : ' ) + PyMoreInitLoopSwitch.append( ' if Index <= Max : ' ) + PyMoreInitLoopSwitch.append( ' DoLoop = 1 ' ) + PyMoreInitLoopSwitch.append( ' else : ' ) + PyMoreInitLoopSwitch.append( ' DoLoop = 0 ' ) + PyMoreInitLoopSwitch.append( ' return DoLoop,Index,Min,Max ' ) + PyNextInitLoopSwitch = [] + PyNextInitLoopSwitch.append( 'def NextLoop(Index,Min,Max) : ' ) + PyNextInitLoopSwitch.append( ' Index = Index + 1 ' ) + PyNextInitLoopSwitch.append( ' return Index,Min,Max ' ) + InitLoopSwitch,EndOfInitLoopSwitch = GraphSwitchNOTExecutable.LNode( 'InitLoop' , PyInitLoopSwitch , 'MoreLoop' , PyMoreInitLoopSwitch , 'NextLoop' , PyNextInitLoopSwitch ) + EndOfInitLoopSwitch.SetName( 'EndOfInitLoopSwitch' ) + EndOfInitLoopSwitch.SetAuthor( '' ) + EndOfInitLoopSwitch.SetComment( 'Compute Node' ) + EndOfInitLoopSwitch.Coords( 776 , 170 ) + PyEndOfInitLoopSwitch = [] + EndOfInitLoopSwitch.SetPyFunction( '' , PyEndOfInitLoopSwitch ) + IInitLoopSwitchDoLoop = InitLoopSwitch.GetInPort( 'DoLoop' ) + IInitLoopSwitchIndex = InitLoopSwitch.InPort( 'Index' , 'long' ) + IInitLoopSwitchMin = InitLoopSwitch.InPort( 'Min' , 'long' ) + IInitLoopSwitchMax = InitLoopSwitch.InPort( 'Max' , 'long' ) + IInitLoopSwitchGate = InitLoopSwitch.GetInPort( 'Gate' ) + OInitLoopSwitchDoLoop = InitLoopSwitch.GetOutPort( 'DoLoop' ) + OInitLoopSwitchIndex = InitLoopSwitch.GetOutPort( 'Index' ) + OInitLoopSwitchMin = InitLoopSwitch.GetOutPort( 'Min' ) + OInitLoopSwitchMax = InitLoopSwitch.GetOutPort( 'Max' ) + IEndOfInitLoopSwitchDoLoop = EndOfInitLoopSwitch.GetInPort( 'DoLoop' ) + IEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetInPort( 'Index' ) + IEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetInPort( 'Min' ) + IEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetInPort( 'Max' ) + IEndOfInitLoopSwitchGate = EndOfInitLoopSwitch.GetInPort( 'Gate' ) + OEndOfInitLoopSwitchDoLoop = EndOfInitLoopSwitch.GetOutPort( 'DoLoop' ) + OEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetOutPort( 'Index' ) + OEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetOutPort( 'Min' ) + OEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetOutPort( 'Max' ) + OEndOfInitLoopSwitchGate = EndOfInitLoopSwitch.GetOutPort( 'Gate' ) + InitLoopSwitch.SetName( 'InitLoopSwitch' ) + InitLoopSwitch.SetAuthor( '' ) + InitLoopSwitch.SetComment( 'Compute Node' ) + InitLoopSwitch.Coords( 10 , 129 ) + + # Creation of Switch Nodes + PySwitch = [] + PySwitch.append( 'from time import * ' ) + PySwitch.append( 'def Switch(a) : ' ) + PySwitch.append( ' if ( a & 1 ) == 0 : ' ) + PySwitch.append( ' sleep(1) ' ) + PySwitch.append( ' return a & 1,1-(a&1),a ' ) + Switch,EndOfSwitch = GraphSwitchNOTExecutable.SNode( 'Switch' , PySwitch ) + EndOfSwitch.SetName( 'EndOfSwitch' ) + EndOfSwitch.SetAuthor( '' ) + EndOfSwitch.SetComment( 'Compute Node' ) + EndOfSwitch.Coords( 582 , 170 ) + PyEndOfSwitch = [] + EndOfSwitch.SetPyFunction( '' , PyEndOfSwitch ) + IEndOfSwitcha = EndOfSwitch.InPort( 'a' , 'long' ) + IEndOfSwitchDefault = EndOfSwitch.GetInPort( 'Default' ) + OEndOfSwitcha = EndOfSwitch.OutPort( 'a' , 'long' ) + OEndOfSwitchGate = EndOfSwitch.GetOutPort( 'Gate' ) + Switch.SetName( 'Switch' ) + Switch.SetAuthor( '' ) + Switch.SetComment( 'Compute Node' ) + Switch.Coords( 194 , 129 ) + ISwitcha = Switch.InPort( 'a' , 'long' ) + ISwitchGate = Switch.GetInPort( 'Gate' ) + OSwitchOdd = Switch.OutPort( 'Odd' , 'long' ) + OSwitchEven = Switch.OutPort( 'Even' , 'int' ) + OSwitchn = Switch.OutPort( 'n' , 'int' ) + OSwitchDefault = Switch.GetOutPort( 'Default' ) + + # Creation of Links + LIsOddaEndOfSwitcha = GraphSwitchNOTExecutable.Link( OIsOdda , IEndOfSwitcha ) + LIsOddaEndOfSwitcha.AddCoord( 1 , 564 , 201 ) + LIsOddaEndOfSwitcha.AddCoord( 2 , 564 , 137 ) + + LInitLoopSwitchIndexSwitcha = GraphSwitchNOTExecutable.Link( OInitLoopSwitchIndex , ISwitcha ) + + LInitLoopSwitchMinEndOfInitLoopSwitchMin = GraphSwitchNOTExecutable.Link( OInitLoopSwitchMin , IEndOfInitLoopSwitchMin ) + + LInitLoopSwitchMaxEndOfInitLoopSwitchMax = GraphSwitchNOTExecutable.Link( OInitLoopSwitchMax , IEndOfInitLoopSwitchMax ) + + LSwitchOddIsOddGate = GraphSwitchNOTExecutable.Link( OSwitchOdd , IIsOddGate ) + + LSwitchnIsOdda = GraphSwitchNOTExecutable.Link( OSwitchn , IIsOdda ) + LSwitchnIsOdda.AddCoord( 1 , 371 , 136 ) + LSwitchnIsOdda.AddCoord( 2 , 371 , 200 ) + + LSwitchDefaultEndOfSwitchDefault = GraphSwitchNOTExecutable.Link( OSwitchDefault , IEndOfSwitchDefault ) + + LEndOfSwitchaEndOfInitLoopSwitchIndex = GraphSwitchNOTExecutable.Link( OEndOfSwitcha , IEndOfInitLoopSwitchIndex ) + + # Input datas + IInitLoopSwitchIndex.Input( 0 ) + IInitLoopSwitchMin.Input( 0 ) + IInitLoopSwitchMax.Input( 100 ) + + # Output Ports of the graph + #OEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetOutPort( 'Index' ) + #OEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetOutPort( 'Min' ) + #OEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetOutPort( 'Max' ) + #OSwitchEven = Switch.GetOutPort( 'Even' ) + return GraphSwitchNOTExecutable + + +GraphSwitchNOTExecutable = DefGraphSwitchNOTExecutable() diff --git a/examples/GraphSwitchNOTExecutable.xml b/examples/GraphSwitchNOTExecutable.xml new file mode 100644 index 0000000..9efc0a7 --- /dev/null +++ b/examples/GraphSwitchNOTExecutable.xml @@ -0,0 +1,344 @@ + + + + + +? + ? + GraphSwitchNOTExecutable + 1 + ? + +GraphSwitch_3 + + +long + InitLoopSwitch__Index + +long + InitLoopSwitch__Min + +long + InitLoopSwitch__Max + + +long + EndOfInitLoopSwitch__Index + +long + EndOfInitLoopSwitch__Min + +long + EndOfInitLoopSwitch__Max + +int + Switch__Even + + + 1/10/2003 - 17:23:54 + 22/6/2005 - 16:49:45 + 1.05 + ? + ? + ? + 0 + 0 + + +? + ? + IsOdd + 3 + ? + +IsOdd + + +long + a + + +long + a + + + +IsOdd + + + + + + 22/6/2005 - 16:49:45 + 22/6/2005 - 16:49:45 + 1.05 + ? + ? + Python function + 389 + 65 + +? + ? + InitLoopSwitch + 4 + EndOfInitLoopSwitch + +InitLoopSwitch + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +InitLoop + + + +MoreLoop + + + + + + + +NextLoop + + + + 22/6/2005 - 16:49:45 + 22/6/2005 - 16:49:45 + 1.05 + ? + ? + Compute Node + 10 + 129 + +? + ? + EndOfInitLoopSwitch + 5 + InitLoopSwitch + +EndOfInitLoopSwitch + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +? + + 22/6/2005 - 16:49:45 + 22/6/2005 - 16:49:45 + 1.05 + ? + ? + Compute Node + 776 + 170 + +? + ? + Switch + 6 + EndOfSwitch + +Switch + + +long + a + + +long + Odd + +int + Even + +int + n + + + +Switch + + + + + + 22/6/2005 - 16:49:45 + 22/6/2005 - 16:49:45 + 1.05 + ? + ? + Compute Node + 194 + 129 + +? + ? + EndOfSwitch + 7 + Switch + +EndOfSwitch + + +long + a + + +long + a + + + +? + + 22/6/2005 - 16:49:45 + 22/6/2005 - 16:49:45 + 1.05 + ? + ? + Compute Node + 582 + 170 + + +IsOdd + a + EndOfSwitch + a + + +564 + 201 + +564 + 137 + +InitLoopSwitch + DoLoop + EndOfInitLoopSwitch + DoLoop + + +InitLoopSwitch + Index + Switch + a + + +InitLoopSwitch + Min + EndOfInitLoopSwitch + Min + + +InitLoopSwitch + Max + EndOfInitLoopSwitch + Max + + +EndOfInitLoopSwitch + DoLoop + InitLoopSwitch + DoLoop + + +Switch + Odd + IsOdd + Gate + + +Switch + n + IsOdd + a + + +371 + 136 + +371 + 200 + +Switch + Default + EndOfSwitch + Default + + +EndOfSwitch + a + EndOfInitLoopSwitch + Index + + + +GraphSwitchNOTExecutable + InitLoopSwitch__Index + InitLoopSwitch + Index + +3 + 0 + + +GraphSwitchNOTExecutable + InitLoopSwitch__Min + InitLoopSwitch + Min + +3 + 0 + + +GraphSwitchNOTExecutable + InitLoopSwitch__Max + InitLoopSwitch + Max + +3 + 100 + diff --git a/examples/GraphSwitchNOTExecutable1.py b/examples/GraphSwitchNOTExecutable1.py new file mode 100644 index 0000000..7849487 --- /dev/null +++ b/examples/GraphSwitchNOTExecutable1.py @@ -0,0 +1,144 @@ + +# Generated python file of Graph GraphSwitchNOTExecutable1 + +from SuperV import * + +# Graph creation of GraphSwitchNOTExecutable1 +def DefGraphSwitchNOTExecutable1() : + GraphSwitchNOTExecutable1 = Graph( 'GraphSwitchNOTExecutable1' ) + GraphSwitchNOTExecutable1.SetName( 'GraphSwitchNOTExecutable1' ) + GraphSwitchNOTExecutable1.SetAuthor( '' ) + GraphSwitchNOTExecutable1.SetComment( '' ) + GraphSwitchNOTExecutable1.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsOdd = [] + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd(a) : ' ) + PyIsOdd.append( ' print a,"IsOdd (GraphSwitch)" ' ) + PyIsOdd.append( ' sleep( 1 ) ' ) + PyIsOdd.append( ' return a ' ) + IsOdd = GraphSwitchNOTExecutable1.INode( 'IsOdd' , PyIsOdd ) + IsOdd.SetName( 'IsOdd' ) + IsOdd.SetAuthor( '' ) + IsOdd.SetComment( 'Python function' ) + IsOdd.Coords( 389 , 65 ) + IIsOdda = IsOdd.InPort( 'a' , 'long' ) + IIsOddGate = IsOdd.GetInPort( 'Gate' ) + OIsOdda = IsOdd.OutPort( 'a' , 'long' ) + OIsOddGate = IsOdd.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyInitLoopSwitch = [] + PyInitLoopSwitch.append( 'def InitLoop(Index,Min,Max) : ' ) + PyInitLoopSwitch.append( ' return Index,Min,Max ' ) + PyMoreInitLoopSwitch = [] + PyMoreInitLoopSwitch.append( 'def MoreLoop(Index,Min,Max) : ' ) + PyMoreInitLoopSwitch.append( ' if Index <= Max : ' ) + PyMoreInitLoopSwitch.append( ' DoLoop = 1 ' ) + PyMoreInitLoopSwitch.append( ' else : ' ) + PyMoreInitLoopSwitch.append( ' DoLoop = 0 ' ) + PyMoreInitLoopSwitch.append( ' return DoLoop,Index,Min,Max ' ) + PyNextInitLoopSwitch = [] + PyNextInitLoopSwitch.append( 'def NextLoop(Index,Min,Max) : ' ) + PyNextInitLoopSwitch.append( ' Index = Index + 1 ' ) + PyNextInitLoopSwitch.append( ' return Index,Min,Max ' ) + InitLoopSwitch,EndOfInitLoopSwitch = GraphSwitchNOTExecutable1.LNode( 'InitLoop' , PyInitLoopSwitch , 'MoreLoop' , PyMoreInitLoopSwitch , 'NextLoop' , PyNextInitLoopSwitch ) + EndOfInitLoopSwitch.SetName( 'EndOfInitLoopSwitch' ) + EndOfInitLoopSwitch.SetAuthor( '' ) + EndOfInitLoopSwitch.SetComment( 'Compute Node' ) + EndOfInitLoopSwitch.Coords( 776 , 170 ) + PyEndOfInitLoopSwitch = [] + EndOfInitLoopSwitch.SetPyFunction( '' , PyEndOfInitLoopSwitch ) + IInitLoopSwitchDoLoop = InitLoopSwitch.GetInPort( 'DoLoop' ) + IInitLoopSwitchIndex = InitLoopSwitch.InPort( 'Index' , 'long' ) + IInitLoopSwitchMin = InitLoopSwitch.InPort( 'Min' , 'long' ) + IInitLoopSwitchMax = InitLoopSwitch.InPort( 'Max' , 'long' ) + IInitLoopSwitchGate = InitLoopSwitch.GetInPort( 'Gate' ) + OInitLoopSwitchDoLoop = InitLoopSwitch.GetOutPort( 'DoLoop' ) + OInitLoopSwitchIndex = InitLoopSwitch.GetOutPort( 'Index' ) + OInitLoopSwitchMin = InitLoopSwitch.GetOutPort( 'Min' ) + OInitLoopSwitchMax = InitLoopSwitch.GetOutPort( 'Max' ) + IEndOfInitLoopSwitchDoLoop = EndOfInitLoopSwitch.GetInPort( 'DoLoop' ) + IEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetInPort( 'Index' ) + IEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetInPort( 'Min' ) + IEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetInPort( 'Max' ) + IEndOfInitLoopSwitchGate = EndOfInitLoopSwitch.GetInPort( 'Gate' ) + OEndOfInitLoopSwitchDoLoop = EndOfInitLoopSwitch.GetOutPort( 'DoLoop' ) + OEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetOutPort( 'Index' ) + OEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetOutPort( 'Min' ) + OEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetOutPort( 'Max' ) + OEndOfInitLoopSwitchGate = EndOfInitLoopSwitch.GetOutPort( 'Gate' ) + InitLoopSwitch.SetName( 'InitLoopSwitch' ) + InitLoopSwitch.SetAuthor( '' ) + InitLoopSwitch.SetComment( 'Compute Node' ) + InitLoopSwitch.Coords( 10 , 129 ) + + # Creation of Switch Nodes + PySwitch = [] + PySwitch.append( 'from time import * ' ) + PySwitch.append( 'def Switch(a) : ' ) + PySwitch.append( ' if ( a & 1 ) == 0 : ' ) + PySwitch.append( ' sleep(1) ' ) + PySwitch.append( ' return a & 1,1-(a&1),a ' ) + Switch,EndOfSwitch = GraphSwitchNOTExecutable1.SNode( 'Switch' , PySwitch ) + EndOfSwitch.SetName( 'EndOfSwitch' ) + EndOfSwitch.SetAuthor( '' ) + EndOfSwitch.SetComment( 'Compute Node' ) + EndOfSwitch.Coords( 582 , 170 ) + PyEndOfSwitch = [] + EndOfSwitch.SetPyFunction( '' , PyEndOfSwitch ) + IEndOfSwitcha = EndOfSwitch.InPort( 'a' , 'long' ) + IEndOfSwitchDefault = EndOfSwitch.GetInPort( 'Default' ) + OEndOfSwitcha = EndOfSwitch.OutPort( 'a' , 'long' ) + OEndOfSwitchGate = EndOfSwitch.GetOutPort( 'Gate' ) + Switch.SetName( 'Switch' ) + Switch.SetAuthor( '' ) + Switch.SetComment( 'Compute Node' ) + Switch.Coords( 194 , 129 ) + ISwitcha = Switch.InPort( 'a' , 'long' ) + ISwitchGate = Switch.GetInPort( 'Gate' ) + OSwitchOdd = Switch.OutPort( 'Odd' , 'long' ) + OSwitchEven = Switch.OutPort( 'Even' , 'int' ) + OSwitchn = Switch.OutPort( 'n' , 'int' ) + OSwitchDefault = Switch.GetOutPort( 'Default' ) + + # Creation of Links + LIsOddaEndOfSwitcha = GraphSwitchNOTExecutable1.Link( OIsOdda , IEndOfSwitcha ) + LIsOddaEndOfSwitcha.AddCoord( 1 , 564 , 201 ) + LIsOddaEndOfSwitcha.AddCoord( 2 , 564 , 137 ) + + LInitLoopSwitchIndexSwitcha = GraphSwitchNOTExecutable1.Link( OInitLoopSwitchIndex , ISwitcha ) + + LInitLoopSwitchMinEndOfInitLoopSwitchMin = GraphSwitchNOTExecutable1.Link( OInitLoopSwitchMin , IEndOfInitLoopSwitchMin ) + + LInitLoopSwitchMaxEndOfInitLoopSwitchMax = GraphSwitchNOTExecutable1.Link( OInitLoopSwitchMax , IEndOfInitLoopSwitchMax ) + + LSwitchOddIsOddGate = GraphSwitchNOTExecutable1.Link( OSwitchOdd , IIsOddGate ) + + LSwitchnIsOdda = GraphSwitchNOTExecutable1.Link( OSwitchn , IIsOdda ) + LSwitchnIsOdda.AddCoord( 1 , 371 , 136 ) + LSwitchnIsOdda.AddCoord( 2 , 371 , 200 ) + + LSwitchnEndOfSwitcha = GraphSwitchNOTExecutable1.Link( OSwitchn , IEndOfSwitcha ) + + LSwitchDefaultEndOfSwitchDefault = GraphSwitchNOTExecutable1.Link( OSwitchDefault , IEndOfSwitchDefault ) + + LEndOfSwitchaEndOfInitLoopSwitchIndex = GraphSwitchNOTExecutable1.Link( OEndOfSwitcha , IEndOfInitLoopSwitchIndex ) + + # Input datas + IInitLoopSwitchIndex.Input( 0 ) + IInitLoopSwitchMin.Input( 0 ) + IInitLoopSwitchMax.Input( 100 ) + + # Output Ports of the graph + #OEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetOutPort( 'Index' ) + #OEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetOutPort( 'Min' ) + #OEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetOutPort( 'Max' ) + #OSwitchEven = Switch.GetOutPort( 'Even' ) + return GraphSwitchNOTExecutable1 + + +GraphSwitchNOTExecutable1 = DefGraphSwitchNOTExecutable1() diff --git a/examples/GraphSwitchNOTExecutable1.xml b/examples/GraphSwitchNOTExecutable1.xml new file mode 100644 index 0000000..186c069 --- /dev/null +++ b/examples/GraphSwitchNOTExecutable1.xml @@ -0,0 +1,350 @@ + + + + + +? + ? + GraphSwitchNOTExecutable1 + 1 + ? + +GraphSwitchExecutable_1 + + +long + InitLoopSwitch__Index + +long + InitLoopSwitch__Min + +long + InitLoopSwitch__Max + + +long + EndOfInitLoopSwitch__Index + +long + EndOfInitLoopSwitch__Min + +long + EndOfInitLoopSwitch__Max + +int + Switch__Even + + + 1/10/2003 - 17:23:54 + 22/6/2005 - 16:57:22 + 1.05 + ? + ? + ? + 0 + 0 + + +? + ? + IsOdd + 3 + ? + +IsOdd + + +long + a + + +long + a + + + +IsOdd + + + + + + 22/6/2005 - 16:57:22 + 22/6/2005 - 16:57:22 + 1.05 + ? + ? + Python function + 389 + 65 + +? + ? + InitLoopSwitch + 4 + EndOfInitLoopSwitch + +InitLoopSwitch + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +InitLoop + + + +MoreLoop + + + + + + + +NextLoop + + + + 22/6/2005 - 16:57:22 + 22/6/2005 - 16:57:22 + 1.05 + ? + ? + Compute Node + 10 + 129 + +? + ? + EndOfInitLoopSwitch + 5 + InitLoopSwitch + +EndOfInitLoopSwitch + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +? + + 22/6/2005 - 16:57:22 + 22/6/2005 - 16:57:22 + 1.05 + ? + ? + Compute Node + 776 + 170 + +? + ? + Switch + 6 + EndOfSwitch + +Switch + + +long + a + + +long + Odd + +int + Even + +int + n + + + +Switch + + + + + + 22/6/2005 - 16:57:22 + 22/6/2005 - 16:57:22 + 1.05 + ? + ? + Compute Node + 194 + 129 + +? + ? + EndOfSwitch + 7 + Switch + +EndOfSwitch + + +long + a + + +long + a + + + +? + + 22/6/2005 - 16:57:22 + 22/6/2005 - 16:57:22 + 1.05 + ? + ? + Compute Node + 582 + 170 + + +IsOdd + a + EndOfSwitch + a + + +564 + 201 + +564 + 137 + +InitLoopSwitch + DoLoop + EndOfInitLoopSwitch + DoLoop + + +InitLoopSwitch + Index + Switch + a + + +InitLoopSwitch + Min + EndOfInitLoopSwitch + Min + + +InitLoopSwitch + Max + EndOfInitLoopSwitch + Max + + +EndOfInitLoopSwitch + DoLoop + InitLoopSwitch + DoLoop + + +Switch + Odd + IsOdd + Gate + + +Switch + n + IsOdd + a + + +371 + 136 + +371 + 200 + +Switch + n + EndOfSwitch + a + + +Switch + Default + EndOfSwitch + Default + + +EndOfSwitch + a + EndOfInitLoopSwitch + Index + + + +GraphSwitchNOTExecutable1 + InitLoopSwitch__Index + InitLoopSwitch + Index + +3 + 0 + + +GraphSwitchNOTExecutable1 + InitLoopSwitch__Min + InitLoopSwitch + Min + +3 + 0 + + +GraphSwitchNOTExecutable1 + InitLoopSwitch__Max + InitLoopSwitch + Max + +3 + 100 + diff --git a/examples/GraphSwitchNOTExecutable2.py b/examples/GraphSwitchNOTExecutable2.py new file mode 100644 index 0000000..ae08f73 --- /dev/null +++ b/examples/GraphSwitchNOTExecutable2.py @@ -0,0 +1,147 @@ + +# Generated python file of Graph GraphSwitchNOTExecutable2 + +from SuperV import * + +# Graph creation of GraphSwitchNOTExecutable2 +def DefGraphSwitchNOTExecutable2() : + GraphSwitchNOTExecutable2 = Graph( 'GraphSwitchNOTExecutable2' ) + GraphSwitchNOTExecutable2.SetName( 'GraphSwitchNOTExecutable2' ) + GraphSwitchNOTExecutable2.SetAuthor( 'JR' ) + GraphSwitchNOTExecutable2.SetComment( '' ) + GraphSwitchNOTExecutable2.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsOdd = [] + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd(a) : ' ) + PyIsOdd.append( ' print a,"IsOdd (GraphSwitch)" ' ) + PyIsOdd.append( ' sleep( 1 ) ' ) + PyIsOdd.append( ' return a ' ) + IsOdd = GraphSwitchNOTExecutable2.INode( 'IsOdd' , PyIsOdd ) + IsOdd.SetName( 'IsOdd' ) + IsOdd.SetAuthor( '' ) + IsOdd.SetComment( 'Python function' ) + IsOdd.Coords( 389 , 65 ) + IIsOdda = IsOdd.InPort( 'a' , 'long' ) + IIsOddGate = IsOdd.GetInPort( 'Gate' ) + OIsOdda = IsOdd.OutPort( 'a' , 'long' ) + OIsOddGate = IsOdd.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyInitLoopSwitch = [] + PyInitLoopSwitch.append( 'def InitLoop(Index,Min,Max) : ' ) + PyInitLoopSwitch.append( ' return Index,Min,Max ' ) + PyMoreInitLoopSwitch = [] + PyMoreInitLoopSwitch.append( 'def MoreLoop(Index,Min,Max) : ' ) + PyMoreInitLoopSwitch.append( ' if Index <= Max : ' ) + PyMoreInitLoopSwitch.append( ' DoLoop = 1 ' ) + PyMoreInitLoopSwitch.append( ' else : ' ) + PyMoreInitLoopSwitch.append( ' DoLoop = 0 ' ) + PyMoreInitLoopSwitch.append( ' return DoLoop,Index,Min,Max ' ) + PyNextInitLoopSwitch = [] + PyNextInitLoopSwitch.append( 'def NextLoop(Index,Min,Max) : ' ) + PyNextInitLoopSwitch.append( ' Index = Index + 1 ' ) + PyNextInitLoopSwitch.append( ' return Index,Min,Max ' ) + InitLoopSwitch,EndOfInitLoopSwitch = GraphSwitchNOTExecutable2.LNode( 'InitLoop' , PyInitLoopSwitch , 'MoreLoop' , PyMoreInitLoopSwitch , 'NextLoop' , PyNextInitLoopSwitch ) + EndOfInitLoopSwitch.SetName( 'EndOfInitLoopSwitch' ) + EndOfInitLoopSwitch.SetAuthor( '' ) + EndOfInitLoopSwitch.SetComment( 'Compute Node' ) + EndOfInitLoopSwitch.Coords( 772 , 132 ) + PyEndOfInitLoopSwitch = [] + EndOfInitLoopSwitch.SetPyFunction( '' , PyEndOfInitLoopSwitch ) + IInitLoopSwitchDoLoop = InitLoopSwitch.GetInPort( 'DoLoop' ) + IInitLoopSwitchIndex = InitLoopSwitch.InPort( 'Index' , 'long' ) + IInitLoopSwitchMin = InitLoopSwitch.InPort( 'Min' , 'long' ) + IInitLoopSwitchMax = InitLoopSwitch.InPort( 'Max' , 'long' ) + IInitLoopSwitchGate = InitLoopSwitch.GetInPort( 'Gate' ) + OInitLoopSwitchDoLoop = InitLoopSwitch.GetOutPort( 'DoLoop' ) + OInitLoopSwitchIndex = InitLoopSwitch.GetOutPort( 'Index' ) + OInitLoopSwitchMin = InitLoopSwitch.GetOutPort( 'Min' ) + OInitLoopSwitchMax = InitLoopSwitch.GetOutPort( 'Max' ) + IEndOfInitLoopSwitchDoLoop = EndOfInitLoopSwitch.GetInPort( 'DoLoop' ) + IEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetInPort( 'Index' ) + IEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetInPort( 'Min' ) + IEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetInPort( 'Max' ) + IEndOfInitLoopSwitchGate = EndOfInitLoopSwitch.GetInPort( 'Gate' ) + OEndOfInitLoopSwitchDoLoop = EndOfInitLoopSwitch.GetOutPort( 'DoLoop' ) + OEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetOutPort( 'Index' ) + OEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetOutPort( 'Min' ) + OEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetOutPort( 'Max' ) + OEndOfInitLoopSwitchGate = EndOfInitLoopSwitch.GetOutPort( 'Gate' ) + InitLoopSwitch.SetName( 'InitLoopSwitch' ) + InitLoopSwitch.SetAuthor( '' ) + InitLoopSwitch.SetComment( 'Compute Node' ) + InitLoopSwitch.Coords( 10 , 129 ) + + # Creation of Switch Nodes + PySwitch = [] + PySwitch.append( 'from time import * ' ) + PySwitch.append( 'def Switch(a) : ' ) + PySwitch.append( ' if ( a & 1 ) == 0 : ' ) + PySwitch.append( ' sleep(1) ' ) + PySwitch.append( ' return a & 1,1-(a&1),a ' ) + Switch,EndOfSwitch = GraphSwitchNOTExecutable2.SNode( 'Switch' , PySwitch ) + EndOfSwitch.SetName( 'EndOfSwitch' ) + EndOfSwitch.SetAuthor( '' ) + EndOfSwitch.SetComment( 'Compute Node' ) + EndOfSwitch.Coords( 581 , 132 ) + PyEndOfSwitch = [] + EndOfSwitch.SetPyFunction( '' , PyEndOfSwitch ) + IEndOfSwitcha = EndOfSwitch.InPort( 'a' , 'long' ) + IEndOfSwitchEven = EndOfSwitch.InPort( 'Even' , 'long' ) + IEndOfSwitchk = EndOfSwitch.InPort( 'k' , 'long' ) + IEndOfSwitchDefault = EndOfSwitch.GetInPort( 'Default' ) + OEndOfSwitcha = EndOfSwitch.OutPort( 'a' , 'long' ) + OEndOfSwitchGate = EndOfSwitch.GetOutPort( 'Gate' ) + Switch.SetName( 'Switch' ) + Switch.SetAuthor( '' ) + Switch.SetComment( 'Compute Node' ) + Switch.Coords( 194 , 129 ) + ISwitcha = Switch.InPort( 'a' , 'long' ) + ISwitchGate = Switch.GetInPort( 'Gate' ) + OSwitchOdd = Switch.OutPort( 'Odd' , 'long' ) + OSwitchEven = Switch.OutPort( 'Even' , 'int' ) + OSwitchn = Switch.OutPort( 'n' , 'int' ) + OSwitchDefault = Switch.GetOutPort( 'Default' ) + + # Creation of Links + LIsOddaEndOfSwitcha = GraphSwitchNOTExecutable2.Link( OIsOdda , IEndOfSwitcha ) + + LInitLoopSwitchIndexSwitcha = GraphSwitchNOTExecutable2.Link( OInitLoopSwitchIndex , ISwitcha ) + + LInitLoopSwitchMinEndOfInitLoopSwitchMin = GraphSwitchNOTExecutable2.Link( OInitLoopSwitchMin , IEndOfInitLoopSwitchMin ) + + LInitLoopSwitchMaxEndOfInitLoopSwitchMax = GraphSwitchNOTExecutable2.Link( OInitLoopSwitchMax , IEndOfInitLoopSwitchMax ) + + LSwitchOddIsOddGate = GraphSwitchNOTExecutable2.Link( OSwitchOdd , IIsOddGate ) + + LSwitchnIsOdda = GraphSwitchNOTExecutable2.Link( OSwitchn , IIsOdda ) + LSwitchnIsOdda.AddCoord( 1 , 371 , 136 ) + LSwitchnIsOdda.AddCoord( 2 , 371 , 200 ) + + LSwitchnEndOfSwitchk = GraphSwitchNOTExecutable2.Link( OSwitchn , IEndOfSwitchk ) + + LSwitchDefaultEndOfSwitchDefault = GraphSwitchNOTExecutable2.Link( OSwitchDefault , IEndOfSwitchDefault ) + + LEndOfSwitchaEndOfInitLoopSwitchIndex = GraphSwitchNOTExecutable2.Link( OEndOfSwitcha , IEndOfInitLoopSwitchIndex ) + + # Input datas + IInitLoopSwitchIndex.Input( 0 ) + IInitLoopSwitchMin.Input( 0 ) + IInitLoopSwitchMax.Input( 100 ) + + # Input Ports of the graph + #IEndOfSwitchEven = EndOfSwitch.GetInPort( 'Even' ) + + # Output Ports of the graph + #OEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetOutPort( 'Index' ) + #OEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetOutPort( 'Min' ) + #OEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetOutPort( 'Max' ) + #OSwitchEven = Switch.GetOutPort( 'Even' ) + return GraphSwitchNOTExecutable2 + + +GraphSwitchNOTExecutable2 = DefGraphSwitchNOTExecutable2() diff --git a/examples/GraphSwitchNOTExecutable2.xml b/examples/GraphSwitchNOTExecutable2.xml new file mode 100644 index 0000000..71efb27 --- /dev/null +++ b/examples/GraphSwitchNOTExecutable2.xml @@ -0,0 +1,353 @@ + + + + + +? + ? + GraphSwitchNOTExecutable2 + 1 + ? + +GraphSwitchExecutable + + +long + InitLoopSwitch__Index + +long + InitLoopSwitch__Min + +long + InitLoopSwitch__Max + +long + EndOfSwitch__Even + + +long + EndOfInitLoopSwitch__Index + +long + EndOfInitLoopSwitch__Min + +long + EndOfInitLoopSwitch__Max + +int + Switch__Even + + + 1/10/2003 - 17:23:54 + 23/6/2005 - 10:53:15 + 1.05 + JR + ? + ? + 0 + 0 + + +? + ? + IsOdd + 3 + ? + +IsOdd + + +long + a + + +long + a + + + +IsOdd + + + + + + 23/6/2005 - 10:53:15 + 23/6/2005 - 10:53:15 + 1.05 + ? + ? + Python function + 389 + 65 + +? + ? + InitLoopSwitch + 4 + EndOfInitLoopSwitch + +InitLoopSwitch + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +InitLoop + + + +MoreLoop + + + + + + + +NextLoop + + + + 23/6/2005 - 10:53:15 + 23/6/2005 - 10:53:15 + 1.05 + ? + ? + Compute Node + 10 + 129 + +? + ? + EndOfInitLoopSwitch + 5 + InitLoopSwitch + +EndOfInitLoopSwitch + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +? + + 23/6/2005 - 10:53:15 + 23/6/2005 - 10:53:15 + 1.05 + ? + ? + Compute Node + 772 + 132 + +? + ? + Switch + 6 + EndOfSwitch + +Switch + + +long + a + + +long + Odd + +int + Even + +int + n + + + +Switch + + + + + + 23/6/2005 - 10:53:15 + 23/6/2005 - 10:53:15 + 1.05 + ? + ? + Compute Node + 194 + 129 + +? + ? + EndOfSwitch + 7 + Switch + +EndOfSwitch + + +long + a + +long + Even + +long + k + + +long + a + + + +? + + 23/6/2005 - 10:53:15 + 23/6/2005 - 10:53:15 + 1.05 + ? + ? + Compute Node + 581 + 132 + + +IsOdd + a + EndOfSwitch + a + + +InitLoopSwitch + DoLoop + EndOfInitLoopSwitch + DoLoop + + +InitLoopSwitch + Index + Switch + a + + +InitLoopSwitch + Min + EndOfInitLoopSwitch + Min + + +InitLoopSwitch + Max + EndOfInitLoopSwitch + Max + + +EndOfInitLoopSwitch + DoLoop + InitLoopSwitch + DoLoop + + +Switch + Odd + IsOdd + Gate + + +Switch + n + IsOdd + a + + +371 + 136 + +371 + 200 + +Switch + n + EndOfSwitch + k + + +Switch + Default + EndOfSwitch + Default + + +EndOfSwitch + a + EndOfInitLoopSwitch + Index + + + +GraphSwitchNOTExecutable2 + InitLoopSwitch__Index + InitLoopSwitch + Index + +3 + 0 + + +GraphSwitchNOTExecutable2 + InitLoopSwitch__Min + InitLoopSwitch + Min + +3 + 0 + + +GraphSwitchNOTExecutable2 + InitLoopSwitch__Max + InitLoopSwitch + Max + +3 + 100 + diff --git a/examples/GraphSwitchOutputNOTValid.py b/examples/GraphSwitchOutputNOTValid.py index 94ae98d..bf061a1 100644 --- a/examples/GraphSwitchOutputNOTValid.py +++ b/examples/GraphSwitchOutputNOTValid.py @@ -1,15 +1,15 @@ -# Generated python file of Graph GraphSwitch_1_1_1 +# Generated python file of Graph GraphSwitchOutputNOTValid from SuperV import * -# Graph creation of GraphSwitch_1_1_1 -def DefGraphSwitch_1_1_1() : - GraphSwitch_1_1_1 = Graph( 'GraphSwitch_1_1_1' ) - GraphSwitch_1_1_1.SetName( 'GraphSwitch_1_1_1' ) - GraphSwitch_1_1_1.SetAuthor( '' ) - GraphSwitch_1_1_1.SetComment( '' ) - GraphSwitch_1_1_1.Coords( 0 , 0 ) +# Graph creation of GraphSwitchOutputNOTValid +def DefGraphSwitchOutputNOTValid() : + GraphSwitchOutputNOTValid = Graph( 'GraphSwitchOutputNOTValid' ) + GraphSwitchOutputNOTValid.SetName( 'GraphSwitchOutputNOTValid' ) + GraphSwitchOutputNOTValid.SetAuthor( 'JR' ) + GraphSwitchOutputNOTValid.SetComment( '' ) + GraphSwitchOutputNOTValid.Coords( 0 , 0 ) # Creation of Factory Nodes @@ -20,7 +20,7 @@ def DefGraphSwitch_1_1_1() : PyIsOdd.append( ' print a,"IsOdd (GraphSwitch)" ' ) PyIsOdd.append( ' sleep( 1 ) ' ) PyIsOdd.append( ' return a ' ) - IsOdd = GraphSwitch_1_1_1.INode( 'IsOdd' , PyIsOdd ) + IsOdd = GraphSwitchOutputNOTValid.INode( 'IsOdd' , PyIsOdd ) IsOdd.SetName( 'IsOdd' ) IsOdd.SetAuthor( '' ) IsOdd.SetComment( 'Python function' ) @@ -36,11 +36,11 @@ def DefGraphSwitch_1_1_1() : PyIsEven.append( ' print a,"IsEven (GraphSwitch)" ' ) PyIsEven.append( ' sleep( 1 ) ' ) PyIsEven.append( ' return a ' ) - IsEven = GraphSwitch_1_1_1.INode( 'IsEven' , PyIsEven ) + IsEven = GraphSwitchOutputNOTValid.INode( 'IsEven' , PyIsEven ) IsEven.SetName( 'IsEven' ) IsEven.SetAuthor( '' ) IsEven.SetComment( 'Compute Node' ) - IsEven.Coords( 395 , 334 ) + IsEven.Coords( 432 , 337 ) IIsEvena = IsEven.InPort( 'a' , 'long' ) IIsEvenGate = IsEven.GetInPort( 'Gate' ) OIsEvena = IsEven.OutPort( 'a' , 'long' ) @@ -50,11 +50,11 @@ def DefGraphSwitch_1_1_1() : PyPrint.append( 'def Print(a,Branch) : ' ) PyPrint.append( ' print "Print ",Branch ' ) PyPrint.append( ' return a,Branch ' ) - Print = GraphSwitch_1_1_1.INode( 'Print' , PyPrint ) + Print = GraphSwitchOutputNOTValid.INode( 'Print' , PyPrint ) Print.SetName( 'Print' ) Print.SetAuthor( '' ) Print.SetComment( 'Compute Node' ) - Print.Coords( 639 , 63 ) + Print.Coords( 639 , 50 ) IPrinta = Print.InPort( 'a' , 'long' ) IPrintBranch = Print.InPort( 'Branch' , 'string' ) IPrintGate = Print.GetInPort( 'Gate' ) @@ -66,11 +66,11 @@ def DefGraphSwitch_1_1_1() : PyPrint_1.append( 'def Print_1(a,Branch) : ' ) PyPrint_1.append( ' print "Print ",Branch ' ) PyPrint_1.append( ' return a,Branch ' ) - Print_1 = GraphSwitch_1_1_1.INode( 'Print_1' , PyPrint_1 ) + Print_1 = GraphSwitchOutputNOTValid.INode( 'Print_1' , PyPrint_1 ) Print_1.SetName( 'Print_1' ) Print_1.SetAuthor( '' ) Print_1.SetComment( 'Compute Node' ) - Print_1.Coords( 639 , 263 ) + Print_1.Coords( 645 , 250 ) IPrint_1a = Print_1.InPort( 'a' , 'long' ) IPrint_1Branch = Print_1.InPort( 'Branch' , 'string' ) IPrint_1Gate = Print_1.GetInPort( 'Gate' ) @@ -94,7 +94,7 @@ def DefGraphSwitch_1_1_1() : PyNextInitLoopSwitch.append( 'def NextLoop(Index,Min,Max) : ' ) PyNextInitLoopSwitch.append( ' Index = Index - 1 ' ) PyNextInitLoopSwitch.append( ' return Index,Min,Max ' ) - InitLoopSwitch,EndOfInitLoopSwitch = GraphSwitch_1_1_1.LNode( 'InitLoop' , PyInitLoopSwitch , 'MoreLoop' , PyMoreInitLoopSwitch , 'NextLoop' , PyNextInitLoopSwitch ) + InitLoopSwitch,EndOfInitLoopSwitch = GraphSwitchOutputNOTValid.LNode( 'InitLoop' , PyInitLoopSwitch , 'MoreLoop' , PyMoreInitLoopSwitch , 'NextLoop' , PyNextInitLoopSwitch ) EndOfInitLoopSwitch.SetName( 'EndOfInitLoopSwitch' ) EndOfInitLoopSwitch.SetAuthor( '' ) EndOfInitLoopSwitch.SetComment( 'Compute Node' ) @@ -138,7 +138,7 @@ def DefGraphSwitch_1_1_1() : PySwitch.append( ' Branch = 'Odd' ' ) PySwitch.append( ' sleep(1) ' ) PySwitch.append( ' return a & 1,1-(a&1),a,Branch,0 ' ) - Switch,EndOfSwitch = GraphSwitch_1_1_1.SNode( 'Switch' , PySwitch ) + Switch,EndOfSwitch = GraphSwitchOutputNOTValid.SNode( 'Switch' , PySwitch ) EndOfSwitch.SetName( 'EndOfSwitch' ) EndOfSwitch.SetAuthor( '' ) EndOfSwitch.SetComment( 'Compute Node' ) @@ -163,35 +163,35 @@ def DefGraphSwitch_1_1_1() : OSwitchDefault = Switch.GetOutPort( 'Default' ) # Creation of Links - LIsOddaPrinta = GraphSwitch_1_1_1.Link( OIsOdda , IPrinta ) + LIsOddaPrinta = GraphSwitchOutputNOTValid.Link( OIsOdda , IPrinta ) - LInitLoopSwitchIndexSwitcha = GraphSwitch_1_1_1.Link( OInitLoopSwitchIndex , ISwitcha ) + LInitLoopSwitchIndexSwitcha = GraphSwitchOutputNOTValid.Link( OInitLoopSwitchIndex , ISwitcha ) - LInitLoopSwitchMinEndOfInitLoopSwitchMin = GraphSwitch_1_1_1.Link( OInitLoopSwitchMin , IEndOfInitLoopSwitchMin ) + LInitLoopSwitchMinEndOfInitLoopSwitchMin = GraphSwitchOutputNOTValid.Link( OInitLoopSwitchMin , IEndOfInitLoopSwitchMin ) - LInitLoopSwitchMaxEndOfInitLoopSwitchMax = GraphSwitch_1_1_1.Link( OInitLoopSwitchMax , IEndOfInitLoopSwitchMax ) + LInitLoopSwitchMaxEndOfInitLoopSwitchMax = GraphSwitchOutputNOTValid.Link( OInitLoopSwitchMax , IEndOfInitLoopSwitchMax ) - LIsEvenaPrint_1a = GraphSwitch_1_1_1.Link( OIsEvena , IPrint_1a ) + LIsEvenaPrint_1a = GraphSwitchOutputNOTValid.Link( OIsEvena , IPrint_1a ) - LSwitchOddIsOddGate = GraphSwitch_1_1_1.Link( OSwitchOdd , IIsOddGate ) + LSwitchOddIsOddGate = GraphSwitchOutputNOTValid.Link( OSwitchOdd , IIsOddGate ) - LSwitchEvenIsEvenGate = GraphSwitch_1_1_1.Link( OSwitchEven , IIsEvenGate ) + LSwitchEvenIsEvenGate = GraphSwitchOutputNOTValid.Link( OSwitchEven , IIsEvenGate ) - LSwitchaIsOdda = GraphSwitch_1_1_1.Link( OSwitcha , IIsOdda ) + LSwitchaIsOdda = GraphSwitchOutputNOTValid.Link( OSwitcha , IIsOdda ) - LSwitchaIsEvena = GraphSwitch_1_1_1.Link( OSwitcha , IIsEvena ) + LSwitchaIsEvena = GraphSwitchOutputNOTValid.Link( OSwitcha , IIsEvena ) - LSwitchBranchPrintBranch = GraphSwitch_1_1_1.Link( OSwitchBranch , IPrintBranch ) + LSwitchBranchPrintBranch = GraphSwitchOutputNOTValid.Link( OSwitchBranch , IPrintBranch ) - LSwitchBranchPrint_1Branch = GraphSwitch_1_1_1.Link( OSwitchBranch , IPrint_1Branch ) + LSwitchBranchPrint_1Branch = GraphSwitchOutputNOTValid.Link( OSwitchBranch , IPrint_1Branch ) - LSwitchDefaultEndOfSwitchDefault = GraphSwitch_1_1_1.Link( OSwitchDefault , IEndOfSwitchDefault ) + LSwitchDefaultEndOfSwitchDefault = GraphSwitchOutputNOTValid.Link( OSwitchDefault , IEndOfSwitchDefault ) - LEndOfSwitchaEndOfInitLoopSwitchIndex = GraphSwitch_1_1_1.Link( OEndOfSwitcha , IEndOfInitLoopSwitchIndex ) + LEndOfSwitchaEndOfInitLoopSwitchIndex = GraphSwitchOutputNOTValid.Link( OEndOfSwitcha , IEndOfInitLoopSwitchIndex ) - LPrintaEndOfSwitcha = GraphSwitch_1_1_1.Link( OPrinta , IEndOfSwitcha ) + LPrintaEndOfSwitcha = GraphSwitchOutputNOTValid.Link( OPrinta , IEndOfSwitcha ) - LPrint_1aEndOfSwitcha = GraphSwitch_1_1_1.Link( OPrint_1a , IEndOfSwitcha ) + LPrint_1aEndOfSwitcha = GraphSwitchOutputNOTValid.Link( OPrint_1a , IEndOfSwitcha ) # Input datas IInitLoopSwitchIndex.Input( 0 ) @@ -205,7 +205,7 @@ def DefGraphSwitch_1_1_1() : #OSwitchdefault = Switch.GetOutPort( 'default' ) #OPrintBranch = Print.GetOutPort( 'Branch' ) #OPrint_1Branch = Print_1.GetOutPort( 'Branch' ) - return GraphSwitch_1_1_1 + return GraphSwitchOutputNOTValid -GraphSwitch_1_1_1 = DefGraphSwitch_1_1_1() +GraphSwitchOutputNOTValid = DefGraphSwitchOutputNOTValid() diff --git a/examples/GraphSwitchOutputNOTValid.xml b/examples/GraphSwitchOutputNOTValid.xml index 30a7c29..fd5da86 100644 --- a/examples/GraphSwitchOutputNOTValid.xml +++ b/examples/GraphSwitchOutputNOTValid.xml @@ -5,11 +5,11 @@ ? ? - GraphSwitch_1_1_1 + GraphSwitchOutputNOTValid 1 ? -GraphSwitch_1_1_1 +GraphSwitchOutputNOTValid long @@ -42,9 +42,9 @@ 1/10/2003 - 17:23:54 - 20/1/2005 - 12:54:59 + 8/3/2005 - 17:1:28 1.05 - ? + JR ? ? 0 @@ -75,8 +75,8 @@ - 20/1/2005 - 12:54:59 - 20/1/2005 - 12:54:59 + 8/3/2005 - 17:1:28 + 8/3/2005 - 17:1:28 1.05 ? ? @@ -131,8 +131,8 @@ - 20/1/2005 - 12:54:59 - 20/1/2005 - 12:54:59 + 8/3/2005 - 17:1:28 + 8/3/2005 - 17:1:28 1.05 ? ? @@ -172,8 +172,8 @@ ? - 20/1/2005 - 12:54:59 - 20/1/2005 - 12:54:59 + 8/3/2005 - 17:1:28 + 8/3/2005 - 17:1:28 1.05 ? ? @@ -205,14 +205,14 @@ - 20/1/2005 - 12:54:59 - 20/1/2005 - 12:54:59 + 8/3/2005 - 17:1:28 + 8/3/2005 - 17:1:28 2.0 ? ? Compute Node - 395 - 334 + 432 + 337 ? ? @@ -256,8 +256,8 @@ - 20/1/2005 - 12:54:59 - 20/1/2005 - 12:54:59 + 8/3/2005 - 17:1:28 + 8/3/2005 - 17:1:28 2.0 ? ? @@ -285,8 +285,8 @@ EndSwitch_1 - 20/1/2005 - 12:54:59 - 20/1/2005 - 12:54:59 + 8/3/2005 - 17:1:28 + 8/3/2005 - 17:1:28 2.0 ? ? @@ -322,14 +322,14 @@ - 20/1/2005 - 12:54:59 - 20/1/2005 - 12:54:59 + 8/3/2005 - 17:1:28 + 8/3/2005 - 17:1:28 2.0 ? ? Compute Node 639 - 63 + 50 ? ? @@ -359,14 +359,14 @@ - 20/1/2005 - 12:54:59 - 20/1/2005 - 12:54:59 + 8/3/2005 - 17:1:28 + 8/3/2005 - 17:1:28 2.0 ? ? Compute Node - 639 - 263 + 645 + 250 IsOdd @@ -472,7 +472,7 @@ -GraphSwitch_1_1_1 +GraphSwitchOutputNOTValid InitLoopSwitch__Index InitLoopSwitch Index @@ -481,7 +481,7 @@ 0 -GraphSwitch_1_1_1 +GraphSwitchOutputNOTValid InitLoopSwitch__Min InitLoopSwitch Min @@ -490,7 +490,7 @@ -5 -GraphSwitch_1_1_1 +GraphSwitchOutputNOTValid InitLoopSwitch__Max InitLoopSwitch Max diff --git a/examples/GraphSyrControl.py b/examples/GraphSyrControl.py index 08efc0d..84ad8e0 100644 --- a/examples/GraphSyrControl.py +++ b/examples/GraphSyrControl.py @@ -157,8 +157,10 @@ def DefGraphSyrControl() : # Creation of GOTO Nodes Pycontrol_m3p1 = [] - Pycontrol_m3p1.append( 'def control_m3p1( N , K ):' ) - Pycontrol_m3p1.append( ' return 0,1,N,K' ) + Pycontrol_m3p1.append( 'from time import * ' ) + Pycontrol_m3p1.append( 'def control_m3p1( N , K ): ' ) + Pycontrol_m3p1.append( ' sleep(1) ' ) + Pycontrol_m3p1.append( ' return 0,1,N,K ' ) control_m3p1 = GraphSyrControl.GNode( 'control_m3p1' , Pycontrol_m3p1 , 'label_test' ) control_m3p1.SetName( 'control_m3p1' ) control_m3p1.SetAuthor( '' ) @@ -174,8 +176,10 @@ def DefGraphSyrControl() : Ocontrol_m3p1Gate = control_m3p1.GetOutPort( 'Gate' ) Pycontrol_div2 = [] - Pycontrol_div2.append( 'def control_div2( N , NB ) :' ) - Pycontrol_div2.append( ' return N,NB' ) + Pycontrol_div2.append( 'from time import * ' ) + Pycontrol_div2.append( 'def control_div2( N , NB ) : ' ) + Pycontrol_div2.append( ' sleep(1) ' ) + Pycontrol_div2.append( ' return N,NB ' ) control_div2 = GraphSyrControl.GNode( 'control_div2' , Pycontrol_div2 , 'label_begin' ) control_div2.SetName( 'control_div2' ) control_div2.SetAuthor( '' ) diff --git a/examples/GraphSyrControl.xml b/examples/GraphSyrControl.xml index 7736162..16d13ec 100644 --- a/examples/GraphSyrControl.xml +++ b/examples/GraphSyrControl.xml @@ -30,7 +30,7 @@ 11/3/2003 - 18:34:21 - 20/1/2005 - 13:5:41 + 6/7/2005 - 10:21:5 1.04 JR ? @@ -56,8 +56,8 @@ BoolEven - 20/1/2005 - 13:5:14 - 20/1/2005 - 13:5:14 + 6/7/2005 - 10:21:5 + 6/7/2005 - 10:21:5 1.04 ? localhost/FactoryServer @@ -82,8 +82,8 @@ BoolOne - 20/1/2005 - 13:5:14 - 20/1/2005 - 13:5:14 + 6/7/2005 - 10:21:5 + 6/7/2005 - 10:21:5 1.04 ? localhost/FactoryServer @@ -108,8 +108,8 @@ anEvenInteger - 20/1/2005 - 13:5:14 - 20/1/2005 - 13:5:14 + 6/7/2005 - 10:21:5 + 6/7/2005 - 10:21:5 1.04 ? localhost/FactoryServer @@ -134,8 +134,8 @@ anInteger - 20/1/2005 - 13:5:14 - 20/1/2005 - 13:5:14 + 6/7/2005 - 10:21:5 + 6/7/2005 - 10:21:5 1.04 ? localhost/FactoryServer @@ -160,8 +160,8 @@ aNewCount - 20/1/2005 - 13:5:14 - 20/1/2005 - 13:5:14 + 6/7/2005 - 10:21:5 + 6/7/2005 - 10:21:5 1.04 ? localhost/FactoryServer @@ -197,8 +197,8 @@ - 20/1/2005 - 13:5:14 - 20/1/2005 - 13:5:14 + 6/7/2005 - 10:21:5 + 6/7/2005 - 10:21:5 1.04 ? ? @@ -246,8 +246,8 @@ - 20/1/2005 - 13:5:14 - 20/1/2005 - 13:5:14 + 6/7/2005 - 10:21:5 + 6/7/2005 - 10:21:5 1.04 ? ? @@ -313,8 +313,8 @@ - 20/1/2005 - 13:5:14 - 20/1/2005 - 13:5:14 + 6/7/2005 - 10:21:5 + 6/7/2005 - 10:21:5 1.04 ? ? @@ -350,8 +350,8 @@ - 20/1/2005 - 13:5:14 - 20/1/2005 - 13:5:14 + 6/7/2005 - 10:21:5 + 6/7/2005 - 10:21:5 1.04 ? ? @@ -390,10 +390,12 @@ control_m3p1 - - - 20/1/2005 - 13:5:14 - 20/1/2005 - 13:5:14 + + + + + 6/7/2005 - 10:21:5 + 6/7/2005 - 10:21:5 1.04 ? ? @@ -426,10 +428,12 @@ control_div2 - - - 20/1/2005 - 13:5:14 - 20/1/2005 - 13:5:14 + + + + + 6/7/2005 - 10:21:5 + 6/7/2005 - 10:21:5 1.04 ? ? diff --git a/examples/GraphSyrControl1.py b/examples/GraphSyrControl1.py index 77c385d..f5af9ad 100755 --- a/examples/GraphSyrControl1.py +++ b/examples/GraphSyrControl1.py @@ -1,19 +1,19 @@ -# Generated python file of Graph GraphSyrControlGUI +# Generated python file of Graph GraphSyrControl1 from SuperV import * -# Graph creation of GraphSyrControlGUI -def DefGraphSyrControlGUI() : - GraphSyrControlGUI = Graph( 'GraphSyrControlGUI' ) - GraphSyrControlGUI.SetName( 'GraphSyrControlGUI' ) - GraphSyrControlGUI.SetAuthor( 'JR' ) - GraphSyrControlGUI.SetComment( 'Syracuse algorithm' ) - GraphSyrControlGUI.Coords( 0 , 0 ) +# Graph creation of GraphSyrControl1 +def DefGraphSyrControl1() : + GraphSyrControl1 = Graph( 'GraphSyrControl1' ) + GraphSyrControl1.SetName( 'GraphSyrControl1' ) + GraphSyrControl1.SetAuthor( 'JR' ) + GraphSyrControl1.SetComment( 'Syracuse algorithm' ) + GraphSyrControl1.Coords( 0 , 0 ) # Creation of Factory Nodes - test_ISEVEN = GraphSyrControlGUI.FNode( 'SyrComponent' , 'SyrComponent' , 'C_ISEVEN' ) + test_ISEVEN = GraphSyrControl1.FNode( 'SyrComponent' , 'SyrComponent' , 'C_ISEVEN' ) test_ISEVEN.SetName( 'test_ISEVEN' ) test_ISEVEN.SetAuthor( '' ) test_ISEVEN.SetContainer( 'localhost/FactoryServer' ) @@ -24,7 +24,7 @@ def DefGraphSyrControlGUI() : Otest_ISEVENBoolEven = test_ISEVEN.GetOutPort( 'BoolEven' ) Otest_ISEVENGate = test_ISEVEN.GetOutPort( 'Gate' ) - test_ISONE = GraphSyrControlGUI.FNode( 'SyrComponent' , 'SyrComponent' , 'C_ISONE' ) + test_ISONE = GraphSyrControl1.FNode( 'SyrComponent' , 'SyrComponent' , 'C_ISONE' ) test_ISONE.SetName( 'test_ISONE' ) test_ISONE.SetAuthor( '' ) test_ISONE.SetContainer( 'localhost/FactoryServer' ) @@ -35,7 +35,7 @@ def DefGraphSyrControlGUI() : Otest_ISONEBoolOne = test_ISONE.GetOutPort( 'BoolOne' ) Otest_ISONEGate = test_ISONE.GetOutPort( 'Gate' ) - m3p1 = GraphSyrControlGUI.FNode( 'SyrComponent' , 'SyrComponent' , 'C_M3P1' ) + m3p1 = GraphSyrControl1.FNode( 'SyrComponent' , 'SyrComponent' , 'C_M3P1' ) m3p1.SetName( 'm3p1' ) m3p1.SetAuthor( '' ) m3p1.SetContainer( 'localhost/FactoryServer' ) @@ -46,7 +46,7 @@ def DefGraphSyrControlGUI() : Om3p1anEvenInteger = m3p1.GetOutPort( 'anEvenInteger' ) Om3p1Gate = m3p1.GetOutPort( 'Gate' ) - div2 = GraphSyrControlGUI.FNode( 'SyrComponent' , 'SyrComponent' , 'C_DIV2' ) + div2 = GraphSyrControl1.FNode( 'SyrComponent' , 'SyrComponent' , 'C_DIV2' ) div2.SetName( 'div2' ) div2.SetAuthor( '' ) div2.SetContainer( 'localhost/FactoryServer' ) @@ -57,7 +57,7 @@ def DefGraphSyrControlGUI() : Odiv2anInteger = div2.GetOutPort( 'anInteger' ) Odiv2Gate = div2.GetOutPort( 'Gate' ) - incr = GraphSyrControlGUI.FNode( 'SyrComponent' , 'SyrComponent' , 'C_INCR' ) + incr = GraphSyrControl1.FNode( 'SyrComponent' , 'SyrComponent' , 'C_INCR' ) incr.SetName( 'incr' ) incr.SetAuthor( '' ) incr.SetContainer( 'localhost/FactoryServer' ) @@ -72,7 +72,7 @@ def DefGraphSyrControlGUI() : 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 = GraphSyrControl1.INode( 'label_begin' , Pylabel_begin ) label_begin.SetName( 'label_begin' ) label_begin.SetAuthor( '' ) label_begin.SetComment( 'Python function' ) @@ -101,7 +101,7 @@ def DefGraphSyrControlGUI() : 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 ) + label_test,EndL_OneEven = GraphSyrControl1.SNode( 'L_OneEven' , Pylabel_test ) EndL_OneEven.SetName( 'EndL_OneEven' ) EndL_OneEven.SetAuthor( '' ) EndL_OneEven.SetComment( 'Compute Node' ) @@ -131,7 +131,7 @@ def DefGraphSyrControlGUI() : 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 = GraphSyrControl1.GNode( 'C_NotOneIsEven' , Pycontrol_m3p1 , 'label_test' ) control_m3p1.SetName( 'control_m3p1' ) control_m3p1.SetAuthor( '' ) control_m3p1.SetComment( 'Compute Node' ) @@ -148,7 +148,7 @@ def DefGraphSyrControlGUI() : 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 = GraphSyrControl1.GNode( 'control_div2' , Pycontrol_div2 , 'label_begin' ) control_div2.SetName( 'control_div2' ) control_div2.SetAuthor( '' ) control_div2.SetComment( 'Compute Node' ) @@ -161,73 +161,73 @@ def DefGraphSyrControlGUI() : Ocontrol_div2Gate = control_div2.GetOutPort( 'Gate' ) # Creation of Links - Ltest_ISEVENBoolEvenlabel_testValEven = GraphSyrControlGUI.Link( Otest_ISEVENBoolEven , Ilabel_testValEven ) + Ltest_ISEVENBoolEvenlabel_testValEven = GraphSyrControl1.Link( Otest_ISEVENBoolEven , Ilabel_testValEven ) Ltest_ISEVENBoolEvenlabel_testValEven.AddCoord( 1 , 383 , 239 ) Ltest_ISEVENBoolEvenlabel_testValEven.AddCoord( 2 , 382 , 417 ) - Ltest_ISONEBoolOnelabel_testValOne = GraphSyrControlGUI.Link( Otest_ISONEBoolOne , Ilabel_testValOne ) + Ltest_ISONEBoolOnelabel_testValOne = GraphSyrControl1.Link( Otest_ISONEBoolOne , Ilabel_testValOne ) - Lm3p1anEvenIntegercontrol_m3p1N = GraphSyrControlGUI.Link( Om3p1anEvenInteger , Icontrol_m3p1N ) + Lm3p1anEvenIntegercontrol_m3p1N = GraphSyrControl1.Link( Om3p1anEvenInteger , Icontrol_m3p1N ) Lm3p1anEvenIntegercontrol_m3p1N.AddCoord( 1 , 793 , 62 ) Lm3p1anEvenIntegercontrol_m3p1N.AddCoord( 2 , 792 , 111 ) - Ldiv2anIntegercontrol_div2N = GraphSyrControlGUI.Link( Odiv2anInteger , Icontrol_div2N ) + Ldiv2anIntegercontrol_div2N = GraphSyrControl1.Link( Odiv2anInteger , Icontrol_div2N ) Ldiv2anIntegercontrol_div2N.AddCoord( 1 , 797 , 392 ) Ldiv2anIntegercontrol_div2N.AddCoord( 2 , 798 , 471 ) - LincraNewCountcontrol_div2K = GraphSyrControlGUI.Link( OincraNewCount , Icontrol_div2K ) + LincraNewCountcontrol_div2K = GraphSyrControl1.Link( OincraNewCount , Icontrol_div2K ) LincraNewCountcontrol_div2K.AddCoord( 1 , 809 , 420 ) LincraNewCountcontrol_div2K.AddCoord( 2 , 808 , 288 ) - LincraNewCountcontrol_m3p1K = GraphSyrControlGUI.Link( OincraNewCount , Icontrol_m3p1K ) + LincraNewCountcontrol_m3p1K = GraphSyrControl1.Link( OincraNewCount , Icontrol_m3p1K ) LincraNewCountcontrol_m3p1K.AddCoord( 1 , 807 , 91 ) LincraNewCountcontrol_m3p1K.AddCoord( 2 , 808 , 286 ) - Llabel_beginNTtest_ISONEanInteger = GraphSyrControlGUI.Link( Olabel_beginNT , Itest_ISONEanInteger ) + Llabel_beginNTtest_ISONEanInteger = GraphSyrControl1.Link( Olabel_beginNT , Itest_ISONEanInteger ) Llabel_beginNTtest_ISONEanInteger.AddCoord( 1 , 180 , 211 ) Llabel_beginNTtest_ISONEanInteger.AddCoord( 2 , 179 , 269 ) - Llabel_beginNTlabel_testNT = GraphSyrControlGUI.Link( Olabel_beginNT , Ilabel_testNT ) + Llabel_beginNTlabel_testNT = GraphSyrControl1.Link( Olabel_beginNT , Ilabel_testNT ) - Llabel_beginNTtest_ISEVENanInteger = GraphSyrControlGUI.Link( Olabel_beginNT , Itest_ISEVENanInteger ) + Llabel_beginNTtest_ISEVENanInteger = GraphSyrControl1.Link( Olabel_beginNT , Itest_ISEVENanInteger ) Llabel_beginNTtest_ISEVENanInteger.AddCoord( 1 , 179 , 417 ) Llabel_beginNTtest_ISEVENanInteger.AddCoord( 2 , 179 , 271 ) - Llabel_beginKTlabel_testKT = GraphSyrControlGUI.Link( Olabel_beginKT , Ilabel_testKT ) + Llabel_beginKTlabel_testKT = GraphSyrControl1.Link( Olabel_beginKT , Ilabel_testKT ) - Llabel_testEvendiv2Gate = GraphSyrControlGUI.Link( Olabel_testEven , Idiv2Gate ) + Llabel_testEvendiv2Gate = GraphSyrControl1.Link( Olabel_testEven , Idiv2Gate ) Llabel_testEvendiv2Gate.AddCoord( 1 , 583 , 500 ) Llabel_testEvendiv2Gate.AddCoord( 2 , 582 , 269 ) - Llabel_testOddm3p1Gate = GraphSyrControlGUI.Link( Olabel_testOdd , Im3p1Gate ) + Llabel_testOddm3p1Gate = GraphSyrControl1.Link( Olabel_testOdd , Im3p1Gate ) Llabel_testOddm3p1Gate.AddCoord( 1 , 571 , 138 ) Llabel_testOddm3p1Gate.AddCoord( 2 , 573 , 298 ) - Llabel_testNm3p1anOddInteger = GraphSyrControlGUI.Link( Olabel_testN , Im3p1anOddInteger ) + Llabel_testNm3p1anOddInteger = GraphSyrControl1.Link( Olabel_testN , Im3p1anOddInteger ) Llabel_testNm3p1anOddInteger.AddCoord( 1 , 604 , 110 ) Llabel_testNm3p1anOddInteger.AddCoord( 2 , 605 , 328 ) - Llabel_testNdiv2anEvenInteger = GraphSyrControlGUI.Link( Olabel_testN , Idiv2anEvenInteger ) + Llabel_testNdiv2anEvenInteger = GraphSyrControl1.Link( Olabel_testN , Idiv2anEvenInteger ) Llabel_testNdiv2anEvenInteger.AddCoord( 1 , 606 , 471 ) Llabel_testNdiv2anEvenInteger.AddCoord( 2 , 605 , 328 ) - Llabel_testKincraCount = GraphSyrControlGUI.Link( Olabel_testK , IincraCount ) + Llabel_testKincraCount = GraphSyrControl1.Link( Olabel_testK , IincraCount ) Llabel_testKincraCount.AddCoord( 1 , 594 , 287 ) Llabel_testKincraCount.AddCoord( 2 , 595 , 356 ) - Llabel_testDefaultEndL_OneEvenDefault = GraphSyrControlGUI.Link( Olabel_testDefault , IEndL_OneEvenDefault ) + Llabel_testDefaultEndL_OneEvenDefault = GraphSyrControl1.Link( Olabel_testDefault , IEndL_OneEvenDefault ) Llabel_testDefaultEndL_OneEvenDefault.AddCoord( 1 , 1008 , 281 ) Llabel_testDefaultEndL_OneEvenDefault.AddCoord( 2 , 1008 , 560 ) Llabel_testDefaultEndL_OneEvenDefault.AddCoord( 3 , 565 , 559 ) Llabel_testDefaultEndL_OneEvenDefault.AddCoord( 4 , 564 , 385 ) - Lcontrol_m3p1Gatelabel_testGate = GraphSyrControlGUI.Link( Ocontrol_m3p1Gate , Ilabel_testGate ) + Lcontrol_m3p1Gatelabel_testGate = GraphSyrControl1.Link( Ocontrol_m3p1Gate , Ilabel_testGate ) Lcontrol_m3p1Gatelabel_testGate.AddCoord( 1 , 368 , 327 ) Lcontrol_m3p1Gatelabel_testGate.AddCoord( 2 , 369 , 7 ) Lcontrol_m3p1Gatelabel_testGate.AddCoord( 3 , 1009 , 8 ) Lcontrol_m3p1Gatelabel_testGate.AddCoord( 4 , 1009 , 179 ) - Lcontrol_div2Gatelabel_beginGate = GraphSyrControlGUI.Link( Ocontrol_div2Gate , Ilabel_beginGate ) + Lcontrol_div2Gatelabel_beginGate = GraphSyrControl1.Link( Ocontrol_div2Gate , Ilabel_beginGate ) Lcontrol_div2Gatelabel_beginGate.AddCoord( 1 , 3 , 327 ) Lcontrol_div2Gatelabel_beginGate.AddCoord( 2 , 2 , 582 ) Lcontrol_div2Gatelabel_beginGate.AddCoord( 3 , 991 , 583 ) @@ -240,7 +240,7 @@ def DefGraphSyrControlGUI() : # Output Ports of the graph #Olabel_testFinished = label_test.GetOutPort( 'Finished' ) #Olabel_testIncr = label_test.GetOutPort( 'Incr' ) - return GraphSyrControlGUI + return GraphSyrControl1 -GraphSyrControlGUI = DefGraphSyrControlGUI() +GraphSyrControl1 = DefGraphSyrControl1() diff --git a/examples/GraphSyrControl1.xml b/examples/GraphSyrControl1.xml index cca254f..5104d2c 100755 --- a/examples/GraphSyrControl1.xml +++ b/examples/GraphSyrControl1.xml @@ -5,7 +5,7 @@ ? ? - GraphSyrControlGUI + GraphSyrControl1 1 ? @@ -27,7 +27,7 @@ 11/3/2003 - 18:28:48 - 20/1/2005 - 13:12:50 + 6/7/2005 - 10:7:41 1.04 JR ? @@ -53,8 +53,8 @@ BoolEven - 20/1/2005 - 13:12:30 - 20/1/2005 - 13:12:30 + 6/7/2005 - 10:7:41 + 6/7/2005 - 10:7:41 1.04 ? localhost/FactoryServer @@ -79,8 +79,8 @@ BoolOne - 20/1/2005 - 13:12:30 - 20/1/2005 - 13:12:30 + 6/7/2005 - 10:7:41 + 6/7/2005 - 10:7:41 1.04 ? localhost/FactoryServer @@ -105,8 +105,8 @@ anEvenInteger - 20/1/2005 - 13:12:30 - 20/1/2005 - 13:12:30 + 6/7/2005 - 10:7:41 + 6/7/2005 - 10:7:41 1.04 ? localhost/FactoryServer @@ -131,8 +131,8 @@ anInteger - 20/1/2005 - 13:12:30 - 20/1/2005 - 13:12:30 + 6/7/2005 - 10:7:41 + 6/7/2005 - 10:7:41 1.04 ? localhost/FactoryServer @@ -157,8 +157,8 @@ aNewCount - 20/1/2005 - 13:12:30 - 20/1/2005 - 13:12:30 + 6/7/2005 - 10:7:41 + 6/7/2005 - 10:7:41 1.04 ? localhost/FactoryServer @@ -193,8 +193,8 @@ label_begin - 20/1/2005 - 13:12:30 - 20/1/2005 - 13:12:30 + 6/7/2005 - 10:7:41 + 6/7/2005 - 10:7:41 1.04 ? ? @@ -260,8 +260,8 @@ - 20/1/2005 - 13:12:30 - 20/1/2005 - 13:12:30 + 6/7/2005 - 10:7:41 + 6/7/2005 - 10:7:41 1.04 ? ? @@ -283,8 +283,8 @@ ? - 20/1/2005 - 13:12:30 - 20/1/2005 - 13:12:30 + 6/7/2005 - 10:7:41 + 6/7/2005 - 10:7:41 1.04 ? ? @@ -325,8 +325,8 @@ C_NotOneIsEven - 20/1/2005 - 13:12:30 - 20/1/2005 - 13:12:30 + 6/7/2005 - 10:7:41 + 6/7/2005 - 10:7:41 1.04 ? ? @@ -361,8 +361,8 @@ control_div2 - 20/1/2005 - 13:12:30 - 20/1/2005 - 13:12:30 + 6/7/2005 - 10:7:41 + 6/7/2005 - 10:7:41 1.04 ? ? @@ -588,7 +588,7 @@ 451 -GraphSyrControlGUI +GraphSyrControl1 label_begin__NB label_begin NB @@ -597,7 +597,7 @@ 7 -GraphSyrControlGUI +GraphSyrControl1 label_begin__KB label_begin KB diff --git a/examples/GraphSyrControlAborted.py b/examples/GraphSyrControlAborted.py new file mode 100644 index 0000000..c14560c --- /dev/null +++ b/examples/GraphSyrControlAborted.py @@ -0,0 +1,278 @@ + +# Generated python file of Graph GraphSyrControlAborted + +from SuperV import * + +# Graph creation of GraphSyrControlAborted +def DefGraphSyrControlAborted() : + GraphSyrControlAborted = Graph( 'GraphSyrControlAborted' ) + GraphSyrControlAborted.SetName( 'GraphSyrControlAborted' ) + GraphSyrControlAborted.SetAuthor( 'JR' ) + GraphSyrControlAborted.SetComment( 'Syracuse algorithm' ) + GraphSyrControlAborted.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + test_ISEVEN = GraphSyrControlAborted.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 ) + Itest_ISEVENanInteger = test_ISEVEN.GetInPort( 'anInteger' ) + Itest_ISEVENGate = test_ISEVEN.GetInPort( 'Gate' ) + Otest_ISEVENBoolEven = test_ISEVEN.GetOutPort( 'BoolEven' ) + Otest_ISEVENGate = test_ISEVEN.GetOutPort( 'Gate' ) + + test_ISONE = GraphSyrControlAborted.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 ) + Itest_ISONEanInteger = test_ISONE.GetInPort( 'anInteger' ) + Itest_ISONEGate = test_ISONE.GetInPort( 'Gate' ) + Otest_ISONEBoolOne = test_ISONE.GetOutPort( 'BoolOne' ) + Otest_ISONEGate = test_ISONE.GetOutPort( 'Gate' ) + + m3p1 = GraphSyrControlAborted.FNode( 'SyrComponent' , 'SyrComponent' , 'C_M3P1' ) + m3p1.SetName( 'm3p1' ) + m3p1.SetAuthor( '' ) + m3p1.SetContainer( 'localhost/FactoryServer' ) + m3p1.SetComment( 'C_M3P1 from SyrComponent' ) + m3p1.Coords( 788 , 22 ) + Im3p1anOddInteger = m3p1.GetInPort( 'anOddInteger' ) + Im3p1Gate = m3p1.GetInPort( 'Gate' ) + Om3p1anEvenInteger = m3p1.GetOutPort( 'anEvenInteger' ) + Om3p1Gate = m3p1.GetOutPort( 'Gate' ) + + div2 = GraphSyrControlAborted.FNode( 'SyrComponent' , 'SyrComponent' , 'C_DIV2' ) + div2.SetName( 'div2' ) + div2.SetAuthor( '' ) + div2.SetContainer( 'localhost/FactoryServer' ) + div2.SetComment( 'C_DIV2 from SyrComponent' ) + div2.Coords( 794 , 427 ) + Idiv2anEvenInteger = div2.GetInPort( 'anEvenInteger' ) + Idiv2Gate = div2.GetInPort( 'Gate' ) + Odiv2anInteger = div2.GetOutPort( 'anInteger' ) + Odiv2Gate = div2.GetOutPort( 'Gate' ) + + incr = GraphSyrControlAborted.FNode( 'SyrComponent' , 'SyrComponent' , 'C_INCR' ) + incr.SetName( 'incr' ) + incr.SetAuthor( '' ) + incr.SetContainer( 'localhost/FactoryServer' ) + incr.SetComment( 'C_INCR from SyrComponent' ) + incr.Coords( 790 , 158 ) + IincraCount = incr.GetInPort( 'aCount' ) + IincrGate = incr.GetInPort( 'Gate' ) + OincraNewCount = incr.GetOutPort( 'aNewCount' ) + OincrGate = incr.GetOutPort( 'Gate' ) + + # 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 = GraphSyrControlAborted.INode( 'label_begin' , Pylabel_begin ) + label_begin.SetName( 'label_begin' ) + label_begin.SetAuthor( '' ) + label_begin.SetComment( 'Python function' ) + label_begin.Coords( 8 , 205 ) + Ilabel_beginNB = label_begin.InPort( 'NB' , 'long' ) + Ilabel_beginKB = label_begin.InPort( 'KB' , 'long' ) + Ilabel_beginGate = label_begin.GetInPort( 'Gate' ) + Olabel_beginNT = label_begin.OutPort( 'NT' , 'long' ) + Olabel_beginKT = label_begin.OutPort( 'KT' , 'long' ) + Olabel_beginGate = label_begin.GetOutPort( 'Gate' ) + + 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 = GraphSyrControlAborted.INode( 'label_test' , Pylabel_test ) + label_test.SetName( 'label_test' ) + label_test.SetAuthor( '' ) + label_test.SetComment( 'Python function' ) + label_test.Coords( 397 , 165 ) + Ilabel_testValEven = label_test.InPort( 'ValEven' , 'long' ) + Ilabel_testValOne = label_test.InPort( 'ValOne' , 'long' ) + Ilabel_testNT = label_test.InPort( 'NT' , 'long' ) + Ilabel_testKT = label_test.InPort( 'KT' , 'long' ) + Ilabel_testGate = label_test.GetInPort( 'Gate' ) + Olabel_testValEven = label_test.OutPort( 'ValEven' , 'long' ) + Olabel_testValOne = label_test.OutPort( 'ValOne' , 'long' ) + Olabel_testNT = label_test.OutPort( 'NT' , 'long' ) + Olabel_testKT = label_test.OutPort( 'KT' , 'long' ) + Olabel_testGate = label_test.GetOutPort( 'Gate' ) + + # 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 = GraphSyrControlAborted.SNode( 'Switch_OneEven' , Pytest ) + EndSwitch_OneEven.SetName( 'EndSwitch_OneEven' ) + EndSwitch_OneEven.SetAuthor( '' ) + EndSwitch_OneEven.SetComment( 'Compute Node' ) + EndSwitch_OneEven.Coords( 1065 , 356 ) + 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 ) + IEndSwitch_OneEvenFinished = EndSwitch_OneEven.InPort( 'Finished' , 'long' ) + IEndSwitch_OneEvenK = EndSwitch_OneEven.InPort( 'K' , 'long' ) + IEndSwitch_OneEvenDefault = EndSwitch_OneEven.GetInPort( 'Default' ) + OEndSwitch_OneEvenFinished = EndSwitch_OneEven.OutPort( 'Finished' , 'long' ) + OEndSwitch_OneEvenK = EndSwitch_OneEven.OutPort( 'K' , 'long' ) + OEndSwitch_OneEvenGate = EndSwitch_OneEven.GetOutPort( 'Gate' ) + test.SetName( 'test' ) + test.SetAuthor( '' ) + test.SetComment( 'Compute Node' ) + test.Coords( 575 , 205 ) + ItestValOne = test.InPort( 'ValOne' , 'long' ) + ItestValEven = test.InPort( 'ValEven' , 'long' ) + ItestNT = test.InPort( 'NT' , 'long' ) + ItestKT = test.InPort( 'KT' , 'long' ) + ItestGate = test.GetInPort( 'Gate' ) + OtestFinished = test.OutPort( 'Finished' , 'long' ) + OtestIncr = test.OutPort( 'Incr' , 'long' ) + OtestEven = test.OutPort( 'Even' , 'long' ) + OtestOdd = test.OutPort( 'Odd' , 'long' ) + OtestN = test.OutPort( 'N' , 'long' ) + OtestK = test.OutPort( 'K' , 'long' ) + OtestDefault = test.GetOutPort( 'Default' ) + + # Creation of GOTO Nodes + Pycontrol_m3p1 = [] + Pycontrol_m3p1.append( 'def control_m3p1( N , K ):' ) + Pycontrol_m3p1.append( ' return 0,1,N,K' ) + control_m3p1 = GraphSyrControlAborted.GNode( 'control_m3p1' , Pycontrol_m3p1 , 'label_test' ) + control_m3p1.SetName( 'control_m3p1' ) + control_m3p1.SetAuthor( '' ) + control_m3p1.SetComment( 'Compute Node' ) + control_m3p1.Coords( 1013 , 63 ) + Icontrol_m3p1N = control_m3p1.InPort( 'N' , 'long' ) + Icontrol_m3p1K = control_m3p1.InPort( 'K' , 'long' ) + Icontrol_m3p1Gate = control_m3p1.GetInPort( 'Gate' ) + Ocontrol_m3p1ValOne = control_m3p1.OutPort( 'ValOne' , 'long' ) + Ocontrol_m3p1ValEven = control_m3p1.OutPort( 'ValEven' , 'long' ) + Ocontrol_m3p1NT = control_m3p1.OutPort( 'NT' , 'long' ) + Ocontrol_m3p1KT = control_m3p1.OutPort( 'KT' , 'long' ) + Ocontrol_m3p1Gate = control_m3p1.GetOutPort( 'Gate' ) + + Pycontrol_div2 = [] + Pycontrol_div2.append( 'def control_div2( N , NB ) :' ) + Pycontrol_div2.append( ' return N,NB' ) + control_div2 = GraphSyrControlAborted.GNode( 'control_div2' , Pycontrol_div2 , 'label_begin' ) + control_div2.SetName( 'control_div2' ) + control_div2.SetAuthor( '' ) + control_div2.SetComment( 'Compute Node' ) + control_div2.Coords( 1010 , 473 ) + Icontrol_div2N = control_div2.InPort( 'N' , 'long' ) + Icontrol_div2K = control_div2.InPort( 'K' , 'long' ) + Icontrol_div2Gate = control_div2.GetInPort( 'Gate' ) + Ocontrol_div2NB = control_div2.OutPort( 'NB' , 'long' ) + Ocontrol_div2KB = control_div2.OutPort( 'KB' , 'long' ) + Ocontrol_div2Gate = control_div2.GetOutPort( 'Gate' ) + + # Creation of Links + Ltest_ISEVENBoolEvenlabel_testValEven = GraphSyrControlAborted.Link( Otest_ISEVENBoolEven , Ilabel_testValEven ) + Ltest_ISEVENBoolEvenlabel_testValEven.AddCoord( 1 , 381 , 234 ) + Ltest_ISEVENBoolEvenlabel_testValEven.AddCoord( 2 , 381 , 410 ) + + Ltest_ISONEBoolOnelabel_testValOne = GraphSyrControlAborted.Link( Otest_ISONEBoolOne , Ilabel_testValOne ) + Ltest_ISONEBoolOnelabel_testValOne.AddCoord( 1 , 367 , 256 ) + Ltest_ISONEBoolOnelabel_testValOne.AddCoord( 2 , 367 , 201 ) + + Lm3p1anEvenIntegercontrol_m3p1N = GraphSyrControlAborted.Link( Om3p1anEvenInteger , Icontrol_m3p1N ) + + Ldiv2anIntegercontrol_div2N = GraphSyrControlAborted.Link( Odiv2anInteger , Icontrol_div2N ) + + LincraNewCountcontrol_m3p1K = GraphSyrControlAborted.Link( OincraNewCount , Icontrol_m3p1K ) + LincraNewCountcontrol_m3p1K.AddCoord( 1 , 978 , 114 ) + LincraNewCountcontrol_m3p1K.AddCoord( 2 , 978 , 230 ) + + LincraNewCountcontrol_div2K = GraphSyrControlAborted.Link( OincraNewCount , Icontrol_div2K ) + LincraNewCountcontrol_div2K.AddCoord( 1 , 981 , 524 ) + LincraNewCountcontrol_div2K.AddCoord( 2 , 978 , 229 ) + + Llabel_beginNTlabel_testNT = GraphSyrControlAborted.Link( Olabel_beginNT , Ilabel_testNT ) + + Llabel_beginNTtest_ISEVENanInteger = GraphSyrControlAborted.Link( Olabel_beginNT , Itest_ISEVENanInteger ) + Llabel_beginNTtest_ISEVENanInteger.AddCoord( 1 , 179 , 408 ) + Llabel_beginNTtest_ISEVENanInteger.AddCoord( 2 , 179 , 276 ) + + Llabel_beginNTtest_ISONEanInteger = GraphSyrControlAborted.Link( Olabel_beginNT , Itest_ISONEanInteger ) + Llabel_beginNTtest_ISONEanInteger.AddCoord( 1 , 179 , 203 ) + Llabel_beginNTtest_ISONEanInteger.AddCoord( 2 , 180 , 275 ) + + Llabel_beginKTlabel_testKT = GraphSyrControlAborted.Link( Olabel_beginKT , Ilabel_testKT ) + + Llabel_testValEventestValEven = GraphSyrControlAborted.Link( Olabel_testValEven , ItestValEven ) + + Llabel_testValOnetestValOne = GraphSyrControlAborted.Link( Olabel_testValOne , ItestValOne ) + + Llabel_testNTtestNT = GraphSyrControlAborted.Link( Olabel_testNT , ItestNT ) + + Llabel_testKTtestKT = GraphSyrControlAborted.Link( Olabel_testKT , ItestKT ) + + LtestFinishedEndSwitch_OneEvenFinished = GraphSyrControlAborted.Link( OtestFinished , IEndSwitch_OneEvenFinished ) + + LtestEvendiv2Gate = GraphSyrControlAborted.Link( OtestEven , Idiv2Gate ) + LtestEvendiv2Gate.AddCoord( 1 , 763 , 522 ) + LtestEvendiv2Gate.AddCoord( 2 , 763 , 278 ) + + LtestOddm3p1Gate = GraphSyrControlAborted.Link( OtestOdd , Im3p1Gate ) + LtestOddm3p1Gate.AddCoord( 1 , 772 , 117 ) + LtestOddm3p1Gate.AddCoord( 2 , 772 , 297 ) + + LtestNm3p1anOddInteger = GraphSyrControlAborted.Link( OtestN , Im3p1anOddInteger ) + LtestNm3p1anOddInteger.AddCoord( 1 , 751 , 93 ) + LtestNm3p1anOddInteger.AddCoord( 2 , 752 , 317 ) + + LtestNdiv2anEvenInteger = GraphSyrControlAborted.Link( OtestN , Idiv2anEvenInteger ) + LtestNdiv2anEvenInteger.AddCoord( 1 , 751 , 498 ) + LtestNdiv2anEvenInteger.AddCoord( 2 , 752 , 318 ) + + LtestKEndSwitch_OneEvenK = GraphSyrControlAborted.Link( OtestK , IEndSwitch_OneEvenK ) + + LtestKincraCount = GraphSyrControlAborted.Link( OtestK , IincraCount ) + LtestKincraCount.AddCoord( 1 , 779 , 229 ) + LtestKincraCount.AddCoord( 2 , 779 , 336 ) + + Lcontrol_m3p1Gatelabel_testGate = GraphSyrControlAborted.Link( Ocontrol_m3p1Gate , Ilabel_testGate ) + Lcontrol_m3p1Gatelabel_testGate.AddCoord( 1 , 374 , 321 ) + Lcontrol_m3p1Gatelabel_testGate.AddCoord( 2 , 374 , 15 ) + Lcontrol_m3p1Gatelabel_testGate.AddCoord( 3 , 1180 , 9 ) + Lcontrol_m3p1Gatelabel_testGate.AddCoord( 4 , 1181 , 217 ) + + Lcontrol_div2Gatelabel_beginGate = GraphSyrControlAborted.Link( Ocontrol_div2Gate , Ilabel_beginGate ) + Lcontrol_div2Gatelabel_beginGate.AddCoord( 1 , 4 , 608 ) + Lcontrol_div2Gatelabel_beginGate.AddCoord( 2 , 1184 , 604 ) + Lcontrol_div2Gatelabel_beginGate.AddCoord( 3 , 1184 , 548 ) + + # Input datas + Ilabel_beginNB.Input( 7 ) + Ilabel_beginKB.Input( 0 ) + + # Output Ports of the graph + #OtestIncr = test.GetOutPort( 'Incr' ) + #OEndSwitch_OneEvenFinished = EndSwitch_OneEven.GetOutPort( 'Finished' ) + #OEndSwitch_OneEvenK = EndSwitch_OneEven.GetOutPort( 'K' ) + return GraphSyrControlAborted + + +GraphSyrControlAborted = DefGraphSyrControlAborted() diff --git a/examples/GraphSyrControlAborted.xml b/examples/GraphSyrControlAborted.xml new file mode 100644 index 0000000..1ee7050 --- /dev/null +++ b/examples/GraphSyrControlAborted.xml @@ -0,0 +1,683 @@ + + + + + +? + ? + GraphSyrControlAborted + 1 + ? + +GraphSyrControl + + +long + label_begin__NB + +long + label_begin__KB + + +long + test__Incr + +long + EndSwitch_OneEven__Finished + +long + EndSwitch_OneEven__K + + + 11/3/2003 - 18:34:21 + 15/2/2005 - 11:29:21 + 1.04 + JR + ? + Syracuse algorithm + 0 + 0 + + +SyrComponent + SyrComponent + test_ISEVEN + 0 + ? + +C_ISEVEN + + +long + anInteger + + +long + BoolEven + + + 15/2/2005 - 11:4:0 + 15/2/2005 - 11:4:0 + 1.04 + ? + localhost/FactoryServer + C_ISEVEN from SyrComponent + 190 + 338 + +SyrComponent + SyrComponent + test_ISONE + 0 + ? + +C_ISONE + + +long + anInteger + + +long + BoolOne + + + 15/2/2005 - 11:4:1 + 15/2/2005 - 11:4:1 + 1.04 + ? + localhost/FactoryServer + C_ISONE from SyrComponent + 196 + 131 + +SyrComponent + SyrComponent + m3p1 + 0 + ? + +C_M3P1 + + +long + anOddInteger + + +long + anEvenInteger + + + 15/2/2005 - 11:4:1 + 15/2/2005 - 11:4:1 + 1.04 + ? + localhost/FactoryServer + C_M3P1 from SyrComponent + 788 + 22 + +SyrComponent + SyrComponent + div2 + 0 + ? + +C_DIV2 + + +long + anEvenInteger + + +long + anInteger + + + 15/2/2005 - 11:4:1 + 15/2/2005 - 11:4:1 + 1.04 + ? + localhost/FactoryServer + C_DIV2 from SyrComponent + 794 + 427 + +SyrComponent + SyrComponent + incr + 0 + ? + +C_INCR + + +long + aCount + + +long + aNewCount + + + 15/2/2005 - 11:4:1 + 15/2/2005 - 11:4:1 + 1.04 + ? + localhost/FactoryServer + C_INCR from SyrComponent + 790 + 158 + +? + ? + label_begin + 3 + ? + +label_begin + + +long + NB + +long + KB + + +long + NT + +long + KT + + + +label_begin + + + + 15/2/2005 - 11:4:1 + 15/2/2005 - 11:4:1 + 1.04 + ? + ? + Python function + 8 + 205 + +? + ? + label_test + 3 + ? + +label_test + + +long + ValEven + +long + ValOne + +long + NT + +long + KT + + +long + ValEven + +long + ValOne + +long + NT + +long + KT + + + +label_test + + + + 15/2/2005 - 11:4:1 + 15/2/2005 - 11:4:1 + 1.04 + ? + ? + Python function + 397 + 165 + +? + ? + 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 + + + + + + + + + + + + + + + + 15/2/2005 - 11:4:1 + 15/2/2005 - 11:4:1 + 1.04 + ? + ? + Compute Node + 575 + 205 + +? + ? + EndSwitch_OneEven + 7 + test + +EndSwitch_OneEven + + +long + Finished + +long + K + + +long + Finished + +long + K + + + +EndSwitch_OneEven + + + + 15/2/2005 - 11:4:1 + 15/2/2005 - 11:4:1 + 1.04 + ? + ? + Compute Node + 1065 + 356 + +? + ? + control_m3p1 + 8 + label_test + +control_m3p1 + + +long + N + +long + K + + +long + ValOne + +long + ValEven + +long + NT + +long + KT + + + +control_m3p1 + + + 15/2/2005 - 11:4:1 + 15/2/2005 - 11:4:1 + 1.04 + ? + ? + Compute Node + 1013 + 63 + +? + ? + control_div2 + 8 + label_begin + +control_div2 + + +long + N + +long + K + + +long + NB + +long + KB + + + +control_div2 + + + 15/2/2005 - 11:4:1 + 15/2/2005 - 11:4:1 + 1.04 + ? + ? + Compute Node + 1010 + 473 + + +test_ISEVEN + BoolEven + label_test + ValEven + + +381 + 234 + +381 + 410 + +test_ISONE + BoolOne + label_test + ValOne + + +367 + 256 + +367 + 201 + +m3p1 + anEvenInteger + control_m3p1 + N + + +div2 + anInteger + control_div2 + N + + +incr + aNewCount + control_m3p1 + K + + +978 + 114 + +978 + 230 + +incr + aNewCount + control_div2 + K + + +981 + 524 + +978 + 229 + +label_begin + NT + label_test + NT + + +label_begin + NT + test_ISEVEN + anInteger + + +179 + 408 + +179 + 276 + +label_begin + NT + test_ISONE + anInteger + + +179 + 203 + +180 + 275 + +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 + Finished + EndSwitch_OneEven + Finished + + +test + Even + div2 + Gate + + +763 + 522 + +763 + 278 + +test + Odd + m3p1 + Gate + + +772 + 117 + +772 + 297 + +test + N + m3p1 + anOddInteger + + +751 + 93 + +752 + 317 + +test + N + div2 + anEvenInteger + + +751 + 498 + +752 + 318 + +test + K + EndSwitch_OneEven + K + + +test + K + incr + aCount + + +779 + 229 + +779 + 336 + +control_m3p1 + Gate + label_test + Gate + + +374 + 321 + +374 + 15 + +1180 + 9 + +1181 + 217 + +control_div2 + Gate + label_begin + Gate + + +4 + 608 + +1184 + 604 + +1184 + 548 + + +GraphSyrControlAborted + label_begin__NB + label_begin + NB + +3 + 7 + + +GraphSyrControlAborted + label_begin__KB + label_begin + KB + +3 + 0 + diff --git a/examples/GraphSyrControlAve.py b/examples/GraphSyrControlAve.py index e32ea72..323c1e6 100644 --- a/examples/GraphSyrControlAve.py +++ b/examples/GraphSyrControlAve.py @@ -51,7 +51,7 @@ def DefGraphSyrControlAve() : div2.SetAuthor( '' ) div2.SetContainer( 'localhost/FactoryServer' ) div2.SetComment( 'C_DIV2 from SyrComponent' ) - div2.Coords( 789 , 276 ) + div2.Coords( 789 , 255 ) Idiv2anEvenInteger = div2.GetInPort( 'anEvenInteger' ) Idiv2Gate = div2.GetInPort( 'Gate' ) Odiv2anInteger = div2.GetOutPort( 'anInteger' ) @@ -111,7 +111,7 @@ def DefGraphSyrControlAve() : C_LISTOFSYR.SetAuthor( '' ) C_LISTOFSYR.SetContainer( 'localhost/FactoryServer' ) C_LISTOFSYR.SetComment( 'C_LISTOFSYR from SyrComponent' ) - C_LISTOFSYR.Coords( 4 , 363 ) + C_LISTOFSYR.Coords( 5 , 321 ) IC_LISTOFSYRGate = C_LISTOFSYR.GetInPort( 'Gate' ) OC_LISTOFSYRaListOfSyr = C_LISTOFSYR.GetOutPort( 'aListOfSyr' ) OC_LISTOFSYRGate = C_LISTOFSYR.GetOutPort( 'Gate' ) @@ -124,7 +124,7 @@ def DefGraphSyrControlAve() : label_begin.SetName( 'label_begin' ) label_begin.SetAuthor( '' ) label_begin.SetComment( 'Python function' ) - label_begin.Coords( 183 , 219 ) + label_begin.Coords( 183 , 220 ) Ilabel_beginNB = label_begin.InPort( 'NB' , 'long' ) Ilabel_beginKB = label_begin.InPort( 'KB' , 'long' ) Ilabel_beginMINB = label_begin.InPort( 'MINB' , 'long' ) @@ -161,12 +161,12 @@ def DefGraphSyrControlAve() : EndL_OneEven.SetName( 'EndL_OneEven' ) EndL_OneEven.SetAuthor( '' ) EndL_OneEven.SetComment( 'Compute Node' ) - EndL_OneEven.Coords( 1064 , 379 ) + EndL_OneEven.Coords( 1064 , 339 ) PyEndL_OneEven = [] EndL_OneEven.SetPyFunction( '' , PyEndL_OneEven ) - IEndL_OneEvenMIN = EndL_OneEven.InPort( 'MIN' , 'long' ) - IEndL_OneEvenMAX = EndL_OneEven.InPort( 'MAX' , 'long' ) - IEndL_OneEvenAVERAGE = EndL_OneEven.InPort( 'AVERAGE' , 'double' ) + IEndL_OneEvenMINT = EndL_OneEven.InPort( 'MINT' , 'long' ) + IEndL_OneEvenMAXT = EndL_OneEven.InPort( 'MAXT' , 'long' ) + IEndL_OneEvenAVERAGET = EndL_OneEven.InPort( 'AVERAGET' , 'double' ) IEndL_OneEvenDefault = EndL_OneEven.GetInPort( 'Default' ) OEndL_OneEvenMIN = EndL_OneEven.OutPort( 'MIN' , 'long' ) OEndL_OneEvenMAX = EndL_OneEven.OutPort( 'MAX' , 'long' ) @@ -175,7 +175,7 @@ def DefGraphSyrControlAve() : label_test.SetName( 'label_test' ) label_test.SetAuthor( '' ) label_test.SetComment( 'Compute Node' ) - label_test.Coords( 563 , 206 ) + label_test.Coords( 564 , 219 ) Ilabel_testValOne = label_test.InPort( 'ValOne' , 'long' ) Ilabel_testValEven = label_test.InPort( 'ValEven' , 'long' ) Ilabel_testNT = label_test.InPort( 'NT' , 'long' ) @@ -248,78 +248,78 @@ def DefGraphSyrControlAve() : # Creation of Links Ltest_ISEVENBoolEvenlabel_testValEven = GraphSyrControlAve.Link( Otest_ISEVENBoolEven , Ilabel_testValEven ) - Ltest_ISEVENBoolEvenlabel_testValEven.AddCoord( 1 , 545 , 269 ) - Ltest_ISEVENBoolEvenlabel_testValEven.AddCoord( 2 , 545 , 535 ) + Ltest_ISEVENBoolEvenlabel_testValEven.AddCoord( 1 , 544 , 256 ) + Ltest_ISEVENBoolEvenlabel_testValEven.AddCoord( 2 , 544 , 524 ) Ltest_ISONEBoolOnelabel_testValOne = GraphSyrControlAve.Link( Otest_ISONEBoolOne , Ilabel_testValOne ) - Ltest_ISONEBoolOnelabel_testValOne.AddCoord( 1 , 546 , 241 ) - Ltest_ISONEBoolOnelabel_testValOne.AddCoord( 2 , 545 , 208 ) + Ltest_ISONEBoolOnelabel_testValOne.AddCoord( 1 , 546 , 237 ) + Ltest_ISONEBoolOnelabel_testValOne.AddCoord( 2 , 546 , 198 ) Lm3p1anEvenIntegercontrol_m3p1N = GraphSyrControlAve.Link( Om3p1anEvenInteger , Icontrol_m3p1N ) - Lm3p1anEvenIntegercontrol_m3p1N.AddCoord( 1 , 977 , 43 ) + Lm3p1anEvenIntegercontrol_m3p1N.AddCoord( 1 , 975 , 38 ) Lm3p1anEvenIntegercontrol_m3p1N.AddCoord( 2 , 976 , 81 ) Ldiv2anIntegercontrol_div2N = GraphSyrControlAve.Link( Odiv2anInteger , Icontrol_div2N ) - Ldiv2anIntegercontrol_div2N.AddCoord( 1 , 1011 , 590 ) - Ldiv2anIntegercontrol_div2N.AddCoord( 2 , 1010 , 357 ) + Ldiv2anIntegercontrol_div2N.AddCoord( 1 , 1012 , 585 ) + Ldiv2anIntegercontrol_div2N.AddCoord( 2 , 1011 , 346 ) LincraNewCountcontrol_div2K = GraphSyrControlAve.Link( OincraNewCount , Icontrol_div2K ) - LincraNewCountcontrol_div2K.AddCoord( 1 , 964 , 618 ) - LincraNewCountcontrol_div2K.AddCoord( 2 , 966 , 217 ) + LincraNewCountcontrol_div2K.AddCoord( 1 , 966 , 606 ) + LincraNewCountcontrol_div2K.AddCoord( 2 , 968 , 207 ) LincraNewCountcontrol_m3p1K = GraphSyrControlAve.Link( OincraNewCount , Icontrol_m3p1K ) - LincraNewCountcontrol_m3p1K.AddCoord( 1 , 966 , 70 ) - LincraNewCountcontrol_m3p1K.AddCoord( 2 , 966 , 216 ) + LincraNewCountcontrol_m3p1K.AddCoord( 1 , 965 , 59 ) + LincraNewCountcontrol_m3p1K.AddCoord( 2 , 966 , 208 ) LincraNewCountC_AVERAGEaCount = GraphSyrControlAve.Link( OincraNewCount , IC_AVERAGEaCount ) - LincraNewCountC_AVERAGEaCount.AddCoord( 1 , 778 , 615 ) - LincraNewCountC_AVERAGEaCount.AddCoord( 2 , 779 , 462 ) + LincraNewCountC_AVERAGEaCount.AddCoord( 1 , 751 , 588 ) + LincraNewCountC_AVERAGEaCount.AddCoord( 2 , 751 , 460 ) LincraNewCountC_AVERAGEaCount.AddCoord( 3 , 965 , 462 ) - LincraNewCountC_AVERAGEaCount.AddCoord( 4 , 966 , 216 ) + LincraNewCountC_AVERAGEaCount.AddCoord( 4 , 968 , 205 ) LC_MINaNewMinValcontrol_m3p1MINT = GraphSyrControlAve.Link( OC_MINaNewMinVal , Icontrol_m3p1MINT ) - LC_MINaNewMinValcontrol_m3p1MINT.AddCoord( 1 , 991 , 100 ) - LC_MINaNewMinValcontrol_m3p1MINT.AddCoord( 2 , 991 , 913 ) + LC_MINaNewMinValcontrol_m3p1MINT.AddCoord( 1 , 991 , 78 ) + LC_MINaNewMinValcontrol_m3p1MINT.AddCoord( 2 , 991 , 905 ) LC_MINaNewMinValcontrol_div2MINT = GraphSyrControlAve.Link( OC_MINaNewMinVal , Icontrol_div2MINT ) - LC_MINaNewMinValcontrol_div2MINT.AddCoord( 1 , 990 , 646 ) - LC_MINaNewMinValcontrol_div2MINT.AddCoord( 2 , 991 , 912 ) + LC_MINaNewMinValcontrol_div2MINT.AddCoord( 1 , 991 , 626 ) + LC_MINaNewMinValcontrol_div2MINT.AddCoord( 2 , 991 , 905 ) LC_MAXaNewMaxValcontrol_m3p1MAXT = GraphSyrControlAve.Link( OC_MAXaNewMaxVal , Icontrol_m3p1MAXT ) - LC_MAXaNewMaxValcontrol_m3p1MAXT.AddCoord( 1 , 974 , 130 ) - LC_MAXaNewMaxValcontrol_m3p1MAXT.AddCoord( 2 , 974 , 747 ) + LC_MAXaNewMaxValcontrol_m3p1MAXT.AddCoord( 1 , 976 , 98 ) + LC_MAXaNewMaxValcontrol_m3p1MAXT.AddCoord( 2 , 974 , 738 ) LC_MAXaNewMaxValcontrol_div2MAXT = GraphSyrControlAve.Link( OC_MAXaNewMaxVal , Icontrol_div2MAXT ) - LC_MAXaNewMaxValcontrol_div2MAXT.AddCoord( 1 , 973 , 676 ) - LC_MAXaNewMaxValcontrol_div2MAXT.AddCoord( 2 , 974 , 747 ) + LC_MAXaNewMaxValcontrol_div2MAXT.AddCoord( 1 , 972 , 648 ) + LC_MAXaNewMaxValcontrol_div2MAXT.AddCoord( 2 , 974 , 738 ) LC_AVERAGEaNewListOfSyrcontrol_m3p1SYRLISTT = GraphSyrControlAve.Link( OC_AVERAGEaNewListOfSyr , Icontrol_m3p1SYRLISTT ) - LC_AVERAGEaNewListOfSyrcontrol_m3p1SYRLISTT.AddCoord( 1 , 1037 , 188 ) + LC_AVERAGEaNewListOfSyrcontrol_m3p1SYRLISTT.AddCoord( 1 , 1037 , 137 ) LC_AVERAGEaNewListOfSyrcontrol_m3p1SYRLISTT.AddCoord( 2 , 1038 , 556 ) LC_AVERAGEaNewListOfSyrcontrol_div2SYRLISTT = GraphSyrControlAve.Link( OC_AVERAGEaNewListOfSyr , Icontrol_div2SYRLISTT ) - LC_AVERAGEaNewListOfSyrcontrol_div2SYRLISTT.AddCoord( 1 , 1038 , 735 ) + LC_AVERAGEaNewListOfSyrcontrol_div2SYRLISTT.AddCoord( 1 , 1038 , 686 ) LC_AVERAGEaNewListOfSyrcontrol_div2SYRLISTT.AddCoord( 2 , 1038 , 555 ) LC_AVERAGEanAveragecontrol_m3p1AVERAGET = GraphSyrControlAve.Link( OC_AVERAGEanAverage , Icontrol_m3p1AVERAGET ) - LC_AVERAGEanAveragecontrol_m3p1AVERAGET.AddCoord( 1 , 1027 , 158 ) - LC_AVERAGEanAveragecontrol_m3p1AVERAGET.AddCoord( 2 , 1026 , 584 ) + LC_AVERAGEanAveragecontrol_m3p1AVERAGET.AddCoord( 1 , 1026 , 118 ) + LC_AVERAGEanAveragecontrol_m3p1AVERAGET.AddCoord( 2 , 1027 , 567 ) LC_AVERAGEanAveragecontrol_div2AVERAGET = GraphSyrControlAve.Link( OC_AVERAGEanAverage , Icontrol_div2AVERAGET ) - LC_AVERAGEanAveragecontrol_div2AVERAGET.AddCoord( 1 , 1027 , 706 ) - LC_AVERAGEanAveragecontrol_div2AVERAGET.AddCoord( 2 , 1027 , 584 ) + LC_AVERAGEanAveragecontrol_div2AVERAGET.AddCoord( 1 , 1027 , 668 ) + LC_AVERAGEanAveragecontrol_div2AVERAGET.AddCoord( 2 , 1026 , 568 ) LC_LISTOFSYRaListOfSyrlabel_beginSYRLISTB = GraphSyrControlAve.Link( OC_LISTOFSYRaListOfSyr , Ilabel_beginSYRLISTB ) Llabel_beginNTtest_ISONEanInteger = GraphSyrControlAve.Link( Olabel_beginNT , Itest_ISONEanInteger ) - Llabel_beginNTtest_ISONEanInteger.AddCoord( 1 , 362 , 207 ) - Llabel_beginNTtest_ISONEanInteger.AddCoord( 2 , 362 , 299 ) + Llabel_beginNTtest_ISONEanInteger.AddCoord( 1 , 361 , 197 ) + Llabel_beginNTtest_ISONEanInteger.AddCoord( 2 , 360 , 290 ) Llabel_beginNTlabel_testNT = GraphSyrControlAve.Link( Olabel_beginNT , Ilabel_testNT ) Llabel_beginNTtest_ISEVENanInteger = GraphSyrControlAve.Link( Olabel_beginNT , Itest_ISEVENanInteger ) - Llabel_beginNTtest_ISEVENanInteger.AddCoord( 1 , 361 , 534 ) - Llabel_beginNTtest_ISEVENanInteger.AddCoord( 2 , 362 , 299 ) + Llabel_beginNTtest_ISEVENanInteger.AddCoord( 1 , 359 , 525 ) + Llabel_beginNTtest_ISEVENanInteger.AddCoord( 2 , 361 , 291 ) Llabel_beginKTlabel_testKT = GraphSyrControlAve.Link( Olabel_beginKT , Ilabel_testKT ) @@ -331,67 +331,61 @@ def DefGraphSyrControlAve() : Llabel_beginSYRLISTlabel_testSYRLIST = GraphSyrControlAve.Link( Olabel_beginSYRLIST , Ilabel_testSYRLIST ) - Llabel_testFinishedEndL_OneEvenDefault = GraphSyrControlAve.Link( Olabel_testFinished , IEndL_OneEvenDefault ) - Llabel_testEvendiv2Gate = GraphSyrControlAve.Link( Olabel_testEven , Idiv2Gate ) - Llabel_testEvendiv2Gate.AddCoord( 1 , 780 , 387 ) - Llabel_testEvendiv2Gate.AddCoord( 2 , 779 , 299 ) + Llabel_testEvendiv2Gate.AddCoord( 1 , 777 , 351 ) + Llabel_testEvendiv2Gate.AddCoord( 2 , 777 , 286 ) Llabel_testOddm3p1Gate = GraphSyrControlAve.Link( Olabel_testOdd , Im3p1Gate ) - Llabel_testOddm3p1Gate.AddCoord( 1 , 756 , 115 ) - Llabel_testOddm3p1Gate.AddCoord( 2 , 756 , 328 ) + Llabel_testOddm3p1Gate.AddCoord( 1 , 757 , 95 ) + Llabel_testOddm3p1Gate.AddCoord( 2 , 757 , 310 ) Llabel_testNm3p1anOddInteger = GraphSyrControlAve.Link( Olabel_testN , Im3p1anOddInteger ) - Llabel_testNm3p1anOddInteger.AddCoord( 1 , 740 , 80 ) - Llabel_testNm3p1anOddInteger.AddCoord( 2 , 741 , 356 ) + Llabel_testNm3p1anOddInteger.AddCoord( 1 , 741 , 72 ) + Llabel_testNm3p1anOddInteger.AddCoord( 2 , 741 , 331 ) Llabel_testNdiv2anEvenInteger = GraphSyrControlAve.Link( Olabel_testN , Idiv2anEvenInteger ) Llabel_testNC_MINanInteger = GraphSyrControlAve.Link( Olabel_testN , IC_MINanInteger ) - Llabel_testNC_MINanInteger.AddCoord( 1 , 741 , 943 ) - Llabel_testNC_MINanInteger.AddCoord( 2 , 740 , 357 ) + Llabel_testNC_MINanInteger.AddCoord( 1 , 744 , 923 ) + Llabel_testNC_MINanInteger.AddCoord( 2 , 742 , 331 ) Llabel_testNC_MAXanInteger = GraphSyrControlAve.Link( Olabel_testN , IC_MAXanInteger ) - Llabel_testNC_MAXanInteger.AddCoord( 1 , 742 , 778 ) - Llabel_testNC_MAXanInteger.AddCoord( 2 , 741 , 359 ) + Llabel_testNC_MAXanInteger.AddCoord( 1 , 742 , 759 ) + Llabel_testNC_MAXanInteger.AddCoord( 2 , 743 , 332 ) Llabel_testNC_AVERAGEanInteger = GraphSyrControlAve.Link( Olabel_testN , IC_AVERAGEanInteger ) - Llabel_testNC_AVERAGEanInteger.AddCoord( 1 , 742 , 584 ) - Llabel_testNC_AVERAGEanInteger.AddCoord( 2 , 741 , 357 ) + Llabel_testNC_AVERAGEanInteger.AddCoord( 1 , 741 , 568 ) + Llabel_testNC_AVERAGEanInteger.AddCoord( 2 , 742 , 330 ) Llabel_testKincraCount = GraphSyrControlAve.Link( Olabel_testK , IincraCount ) - Llabel_testKincraCount.AddCoord( 1 , 765 , 217 ) - Llabel_testKincraCount.AddCoord( 2 , 764 , 385 ) + Llabel_testKincraCount.AddCoord( 1 , 766 , 207 ) + Llabel_testKincraCount.AddCoord( 2 , 766 , 343 ) Llabel_testMINTC_MINaMinVal = GraphSyrControlAve.Link( Olabel_testMINT , IC_MINaMinVal ) - Llabel_testMINTC_MINaMinVal.AddCoord( 1 , 759 , 914 ) - Llabel_testMINTC_MINaMinVal.AddCoord( 2 , 758 , 414 ) - - Llabel_testMINTEndL_OneEvenMIN = GraphSyrControlAve.Link( Olabel_testMINT , IEndL_OneEvenMIN ) + Llabel_testMINTC_MINaMinVal.AddCoord( 1 , 760 , 904 ) + Llabel_testMINTC_MINaMinVal.AddCoord( 2 , 756 , 372 ) Llabel_testMAXTC_MAXaMaxVal = GraphSyrControlAve.Link( Olabel_testMAXT , IC_MAXaMaxVal ) - Llabel_testMAXTC_MAXaMaxVal.AddCoord( 1 , 729 , 749 ) - Llabel_testMAXTC_MAXaMaxVal.AddCoord( 2 , 728 , 444 ) - - Llabel_testMAXTEndL_OneEvenMAX = GraphSyrControlAve.Link( Olabel_testMAXT , IEndL_OneEvenMAX ) - - Llabel_testAVERAGETEndL_OneEvenAVERAGE = GraphSyrControlAve.Link( Olabel_testAVERAGET , IEndL_OneEvenAVERAGE ) + Llabel_testMAXTC_MAXaMaxVal.AddCoord( 1 , 765 , 742 ) + Llabel_testMAXTC_MAXaMaxVal.AddCoord( 2 , 766 , 384 ) Llabel_testSYRLISTTC_AVERAGEaListOfSyr = GraphSyrControlAve.Link( Olabel_testSYRLISTT , IC_AVERAGEaListOfSyr ) - Llabel_testSYRLISTTC_AVERAGEaListOfSyr.AddCoord( 1 , 771 , 557 ) - Llabel_testSYRLISTTC_AVERAGEaListOfSyr.AddCoord( 2 , 770 , 502 ) + Llabel_testSYRLISTTC_AVERAGEaListOfSyr.AddCoord( 1 , 773 , 546 ) + Llabel_testSYRLISTTC_AVERAGEaListOfSyr.AddCoord( 2 , 772 , 424 ) + + Llabel_testDefaultEndL_OneEvenDefault = GraphSyrControlAve.Link( Olabel_testDefault , IEndL_OneEvenDefault ) Lcontrol_m3p1Gatelabel_testGate = GraphSyrControlAve.Link( Ocontrol_m3p1Gate , Ilabel_testGate ) - Lcontrol_m3p1Gatelabel_testGate.AddCoord( 1 , 553 , 536 ) + Lcontrol_m3p1Gatelabel_testGate.AddCoord( 1 , 553 , 453 ) Lcontrol_m3p1Gatelabel_testGate.AddCoord( 2 , 554 , 1025 ) Lcontrol_m3p1Gatelabel_testGate.AddCoord( 3 , 1242 , 1026 ) - Lcontrol_m3p1Gatelabel_testGate.AddCoord( 4 , 1243 , 279 ) + Lcontrol_m3p1Gatelabel_testGate.AddCoord( 4 , 1234 , 204 ) Lcontrol_div2Gatelabel_beginGate = GraphSyrControlAve.Link( Ocontrol_div2Gate , Ilabel_beginGate ) - Lcontrol_div2Gatelabel_beginGate.AddCoord( 1 , 176 , 476 ) + Lcontrol_div2Gatelabel_beginGate.AddCoord( 1 , 176 , 419 ) Lcontrol_div2Gatelabel_beginGate.AddCoord( 2 , 176 , 997 ) Lcontrol_div2Gatelabel_beginGate.AddCoord( 3 , 1217 , 996 ) - Lcontrol_div2Gatelabel_beginGate.AddCoord( 4 , 1218 , 768 ) + Lcontrol_div2Gatelabel_beginGate.AddCoord( 4 , 1223 , 711 ) # Input datas Ilabel_beginNB.Input( 31 ) @@ -400,8 +394,15 @@ def DefGraphSyrControlAve() : Ilabel_beginMAXB.Input( 0 ) Ilabel_beginAVERAGEB.Input( 0 ) + # Input Ports of the graph + #IEndL_OneEvenMINT = EndL_OneEven.GetInPort( 'MINT' ) + #IEndL_OneEvenMAXT = EndL_OneEven.GetInPort( 'MAXT' ) + #IEndL_OneEvenAVERAGET = EndL_OneEven.GetInPort( 'AVERAGET' ) + # Output Ports of the graph + #Olabel_testFinished = label_test.GetOutPort( 'Finished' ) #Olabel_testIncr = label_test.GetOutPort( 'Incr' ) + #Olabel_testAVERAGET = label_test.GetOutPort( 'AVERAGET' ) #OEndL_OneEvenMIN = EndL_OneEven.GetOutPort( 'MIN' ) #OEndL_OneEvenMAX = EndL_OneEven.GetOutPort( 'MAX' ) #OEndL_OneEvenAVERAGE = EndL_OneEven.GetOutPort( 'AVERAGE' ) diff --git a/examples/GraphSyrControlAve.xml b/examples/GraphSyrControlAve.xml index a9c6b0d..dbe979c 100644 --- a/examples/GraphSyrControlAve.xml +++ b/examples/GraphSyrControlAve.xml @@ -9,7 +9,7 @@ 1 ? -GraphSyrControlAve +GraphSyrControlAveNOTExecutable_1 long @@ -25,12 +25,27 @@ label_begin__MAXB double - label_begin__AVERAGEB + label_begin__AVERAGEB + +long + EndL_OneEven__MINT + +long + EndL_OneEven__MAXT + +double + EndL_OneEven__AVERAGET +long + label_test__Finished + long label_test__Incr +double + label_test__AVERAGET + long EndL_OneEven__MIN @@ -42,7 +57,7 @@ 2/10/2003 - 11:17:14 - 19/1/2005 - 17:52:49 + 22/6/2005 - 11:35:16 1.05 JR ? @@ -68,8 +83,8 @@ BoolEven - 19/1/2005 - 17:44:31 - 19/1/2005 - 17:44:31 + 22/6/2005 - 11:35:16 + 22/6/2005 - 11:35:16 1.05 ? localhost/FactoryServer @@ -94,8 +109,8 @@ BoolOne - 19/1/2005 - 17:44:31 - 19/1/2005 - 17:44:31 + 22/6/2005 - 11:35:16 + 22/6/2005 - 11:35:16 1.05 ? localhost/FactoryServer @@ -120,8 +135,8 @@ anEvenInteger - 19/1/2005 - 17:44:31 - 19/1/2005 - 17:44:31 + 22/6/2005 - 11:35:16 + 22/6/2005 - 11:35:16 1.05 ? localhost/FactoryServer @@ -146,14 +161,14 @@ anInteger - 19/1/2005 - 17:44:31 - 19/1/2005 - 17:44:31 + 22/6/2005 - 11:35:16 + 22/6/2005 - 11:35:16 1.05 ? localhost/FactoryServer C_DIV2 from SyrComponent 789 - 276 + 255 SyrComponent SyrComponent @@ -172,8 +187,8 @@ aNewCount - 19/1/2005 - 17:44:31 - 19/1/2005 - 17:44:31 + 22/6/2005 - 11:35:16 + 22/6/2005 - 11:35:16 1.05 ? localhost/FactoryServer @@ -201,8 +216,8 @@ aNewMinVal - 19/1/2005 - 17:44:31 - 19/1/2005 - 17:44:31 + 22/6/2005 - 11:35:16 + 22/6/2005 - 11:35:16 1.05 ? localhost/FactoryServer @@ -230,8 +245,8 @@ aNewMaxVal - 19/1/2005 - 17:44:31 - 19/1/2005 - 17:44:31 + 22/6/2005 - 11:35:16 + 22/6/2005 - 11:35:16 1.05 ? localhost/FactoryServer @@ -265,8 +280,8 @@ anAverage - 19/1/2005 - 17:44:31 - 19/1/2005 - 17:44:31 + 22/6/2005 - 11:35:16 + 22/6/2005 - 11:35:16 1.05 ? localhost/FactoryServer @@ -288,14 +303,14 @@ aListOfSyr - 19/1/2005 - 17:44:31 - 19/1/2005 - 17:44:31 + 22/6/2005 - 11:35:16 + 22/6/2005 - 11:35:16 1.05 ? localhost/FactoryServer C_LISTOFSYR from SyrComponent - 4 - 363 + 5 + 321 ? ? @@ -348,14 +363,14 @@ label_begin - 19/1/2005 - 17:44:31 - 19/1/2005 - 17:44:31 + 22/6/2005 - 11:35:16 + 22/6/2005 - 11:35:16 1.05 ? ? Python function 183 - 219 + 220 ? ? @@ -439,14 +454,14 @@ - 19/1/2005 - 17:44:31 - 19/1/2005 - 17:44:31 + 22/6/2005 - 11:35:16 + 22/6/2005 - 11:35:16 1.05 ? ? Compute Node - 563 - 206 + 564 + 219 ? ? @@ -458,13 +473,13 @@ long - MIN + MINT long - MAX + MAXT double - AVERAGE + AVERAGET long @@ -480,14 +495,14 @@ ? - 19/1/2005 - 17:44:31 - 19/1/2005 - 17:44:31 + 22/6/2005 - 11:35:16 + 22/6/2005 - 11:35:16 1.05 ? ? Compute Node 1064 - 379 + 339 ? ? @@ -546,8 +561,8 @@ C_NotOneIsEven - 19/1/2005 - 17:44:31 - 19/1/2005 - 17:44:31 + 22/6/2005 - 11:35:16 + 22/6/2005 - 11:35:16 1.05 ? ? @@ -606,8 +621,8 @@ control_div2 - 19/1/2005 - 17:44:31 - 19/1/2005 - 17:44:31 + 22/6/2005 - 11:35:16 + 22/6/2005 - 11:35:16 1.05 ? ? @@ -622,11 +637,11 @@ ValEven -545 - 269 +544 + 256 -545 - 535 +544 + 524 test_ISONE BoolOne @@ -635,10 +650,10 @@ 546 - 241 + 237 -545 - 208 +546 + 198 m3p1 anEvenInteger @@ -646,8 +661,8 @@ N -977 - 43 +975 + 38 976 81 @@ -658,11 +673,11 @@ N -1011 - 590 +1012 + 585 -1010 - 357 +1011 + 346 incr aNewCount @@ -670,11 +685,11 @@ K -964 - 618 - 966 - 217 + 606 + +968 + 207 incr aNewCount @@ -682,11 +697,11 @@ K -966 - 70 +965 + 59 966 - 216 + 208 incr aNewCount @@ -694,17 +709,17 @@ aCount -778 - 615 +751 + 588 -779 - 462 +751 + 460 965 462 -966 - 216 +968 + 205 C_MIN aNewMinVal @@ -713,10 +728,10 @@ 991 - 100 + 78 991 - 913 + 905 C_MIN aNewMinVal @@ -724,11 +739,11 @@ MINT -990 - 646 +991 + 626 991 - 912 + 905 C_MAX aNewMaxVal @@ -736,11 +751,11 @@ MAXT -974 - 130 +976 + 98 974 - 747 + 738 C_MAX aNewMaxVal @@ -748,11 +763,11 @@ MAXT -973 - 676 +972 + 648 974 - 747 + 738 C_AVERAGE aNewListOfSyr @@ -761,7 +776,7 @@ 1037 - 188 + 137 1038 556 @@ -773,7 +788,7 @@ 1038 - 735 + 686 1038 555 @@ -784,11 +799,11 @@ AVERAGET -1027 - 158 - 1026 - 584 + 118 + +1027 + 567 C_AVERAGE anAverage @@ -797,10 +812,10 @@ 1027 - 706 + 668 -1027 - 584 +1026 + 568 C_LISTOFSYR aListOfSyr @@ -814,11 +829,11 @@ anInteger -362 - 207 +361 + 197 -362 - 299 +360 + 290 label_begin NT @@ -832,11 +847,11 @@ anInteger -361 - 534 +359 + 525 -362 - 299 +361 + 291 label_begin KT @@ -868,23 +883,17 @@ SYRLIST -label_test - Finished - EndL_OneEven - Default - - label_test Even div2 Gate -780 - 387 +777 + 351 -779 - 299 +777 + 286 label_test Odd @@ -892,11 +901,11 @@ Gate -756 - 115 +757 + 95 -756 - 328 +757 + 310 label_test N @@ -904,11 +913,11 @@ anOddInteger -740 - 80 +741 + 72 741 - 356 + 331 label_test N @@ -922,11 +931,11 @@ anInteger -741 - 943 +744 + 923 -740 - 357 +742 + 331 label_test N @@ -935,10 +944,10 @@ 742 - 778 + 759 -741 - 359 +743 + 332 label_test N @@ -946,11 +955,11 @@ anInteger -742 - 584 - 741 - 357 + 568 + +742 + 330 label_test K @@ -958,11 +967,11 @@ aCount -765 - 217 +766 + 207 -764 - 385 +766 + 343 label_test MINT @@ -970,17 +979,11 @@ aMinVal -759 - 914 +760 + 904 -758 - 414 - -label_test - MINT - EndL_OneEven - MIN - +756 + 372 label_test MAXT @@ -988,23 +991,11 @@ aMaxVal -729 - 749 +765 + 742 -728 - 444 - -label_test - MAXT - EndL_OneEven - MAX - - -label_test - AVERAGET - EndL_OneEven - AVERAGE - +766 + 384 label_test SYRLISTT @@ -1012,11 +1003,17 @@ aListOfSyr -771 - 557 +773 + 546 -770 - 502 +772 + 424 + +label_test + Default + EndL_OneEven + Default + control_m3p1 Gate @@ -1025,7 +1022,7 @@ 553 - 536 + 453 554 1025 @@ -1033,8 +1030,8 @@ 1242 1026 -1243 - 279 +1234 + 204 control_div2 Gate @@ -1043,7 +1040,7 @@ 176 - 476 + 419 176 997 @@ -1051,8 +1048,8 @@ 1217 996 -1218 - 768 +1223 + 711 GraphSyrControlAve diff --git a/examples/GraphSyrControlAveAborted.py b/examples/GraphSyrControlAveAborted.py new file mode 100644 index 0000000..30101b6 --- /dev/null +++ b/examples/GraphSyrControlAveAborted.py @@ -0,0 +1,413 @@ + +# Generated python file of Graph GraphSyrControlAveAborted + +from SuperV import * + +# Graph creation of GraphSyrControlAveAborted +def DefGraphSyrControlAveAborted() : + GraphSyrControlAveAborted = Graph( 'GraphSyrControlAveAborted' ) + GraphSyrControlAveAborted.SetName( 'GraphSyrControlAveAborted' ) + GraphSyrControlAveAborted.SetAuthor( 'JR' ) + GraphSyrControlAveAborted.SetComment( 'Syracuse algorithm' ) + GraphSyrControlAveAborted.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + test_ISEVEN = GraphSyrControlAveAborted.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( 370 , 455 ) + Itest_ISEVENanInteger = test_ISEVEN.GetInPort( 'anInteger' ) + Itest_ISEVENGate = test_ISEVEN.GetInPort( 'Gate' ) + Otest_ISEVENBoolEven = test_ISEVEN.GetOutPort( 'BoolEven' ) + Otest_ISEVENGate = test_ISEVEN.GetOutPort( 'Gate' ) + + test_ISONE = GraphSyrControlAveAborted.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( 370 , 127 ) + Itest_ISONEanInteger = test_ISONE.GetInPort( 'anInteger' ) + Itest_ISONEGate = test_ISONE.GetInPort( 'Gate' ) + Otest_ISONEBoolOne = test_ISONE.GetOutPort( 'BoolOne' ) + Otest_ISONEGate = test_ISONE.GetOutPort( 'Gate' ) + + m3p1 = GraphSyrControlAveAborted.FNode( 'SyrComponent' , 'SyrComponent' , 'C_M3P1' ) + m3p1.SetName( 'm3p1' ) + m3p1.SetAuthor( '' ) + m3p1.SetContainer( 'localhost/FactoryServer' ) + m3p1.SetComment( 'C_M3P1 from SyrComponent' ) + m3p1.Coords( 789 , 0 ) + Im3p1anOddInteger = m3p1.GetInPort( 'anOddInteger' ) + Im3p1Gate = m3p1.GetInPort( 'Gate' ) + Om3p1anEvenInteger = m3p1.GetOutPort( 'anEvenInteger' ) + Om3p1Gate = m3p1.GetOutPort( 'Gate' ) + + div2 = GraphSyrControlAveAborted.FNode( 'SyrComponent' , 'SyrComponent' , 'C_DIV2' ) + div2.SetName( 'div2' ) + div2.SetAuthor( '' ) + div2.SetContainer( 'localhost/FactoryServer' ) + div2.SetComment( 'C_DIV2 from SyrComponent' ) + div2.Coords( 789 , 255 ) + Idiv2anEvenInteger = div2.GetInPort( 'anEvenInteger' ) + Idiv2Gate = div2.GetInPort( 'Gate' ) + Odiv2anInteger = div2.GetOutPort( 'anInteger' ) + Odiv2Gate = div2.GetOutPort( 'Gate' ) + + incr = GraphSyrControlAveAborted.FNode( 'SyrComponent' , 'SyrComponent' , 'C_INCR' ) + incr.SetName( 'incr' ) + incr.SetAuthor( '' ) + incr.SetContainer( 'localhost/FactoryServer' ) + incr.SetComment( 'C_INCR from SyrComponent' ) + incr.Coords( 790 , 136 ) + IincraCount = incr.GetInPort( 'aCount' ) + IincrGate = incr.GetInPort( 'Gate' ) + OincraNewCount = incr.GetOutPort( 'aNewCount' ) + OincrGate = incr.GetOutPort( 'Gate' ) + + C_MIN = GraphSyrControlAveAborted.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( 798 , 833 ) + IC_MINaMinVal = C_MIN.GetInPort( 'aMinVal' ) + IC_MINanInteger = C_MIN.GetInPort( 'anInteger' ) + IC_MINGate = C_MIN.GetInPort( 'Gate' ) + OC_MINaNewMinVal = C_MIN.GetOutPort( 'aNewMinVal' ) + OC_MINGate = C_MIN.GetOutPort( 'Gate' ) + + C_MAX = GraphSyrControlAveAborted.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( 798 , 668 ) + IC_MAXaMaxVal = C_MAX.GetInPort( 'aMaxVal' ) + IC_MAXanInteger = C_MAX.GetInPort( 'anInteger' ) + IC_MAXGate = C_MAX.GetInPort( 'Gate' ) + OC_MAXaNewMaxVal = C_MAX.GetOutPort( 'aNewMaxVal' ) + OC_MAXGate = C_MAX.GetOutPort( 'Gate' ) + + C_AVERAGE = GraphSyrControlAveAborted.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( 784 , 476 ) + IC_AVERAGEaListOfSyr = C_AVERAGE.GetInPort( 'aListOfSyr' ) + IC_AVERAGEanInteger = C_AVERAGE.GetInPort( 'anInteger' ) + IC_AVERAGEaCount = C_AVERAGE.GetInPort( 'aCount' ) + IC_AVERAGEGate = C_AVERAGE.GetInPort( 'Gate' ) + OC_AVERAGEaNewListOfSyr = C_AVERAGE.GetOutPort( 'aNewListOfSyr' ) + OC_AVERAGEanAverage = C_AVERAGE.GetOutPort( 'anAverage' ) + OC_AVERAGEGate = C_AVERAGE.GetOutPort( 'Gate' ) + + C_LISTOFSYR = GraphSyrControlAveAborted.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( 5 , 321 ) + IC_LISTOFSYRGate = C_LISTOFSYR.GetInPort( 'Gate' ) + OC_LISTOFSYRaListOfSyr = C_LISTOFSYR.GetOutPort( 'aListOfSyr' ) + OC_LISTOFSYRGate = C_LISTOFSYR.GetOutPort( 'Gate' ) + + # 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 = GraphSyrControlAveAborted.INode( 'label_begin' , Pylabel_begin ) + label_begin.SetName( 'label_begin' ) + label_begin.SetAuthor( '' ) + label_begin.SetComment( 'Python function' ) + label_begin.Coords( 183 , 220 ) + Ilabel_beginNB = label_begin.InPort( 'NB' , 'long' ) + Ilabel_beginKB = label_begin.InPort( 'KB' , 'long' ) + Ilabel_beginMINB = label_begin.InPort( 'MINB' , 'long' ) + Ilabel_beginMAXB = label_begin.InPort( 'MAXB' , 'long' ) + Ilabel_beginAVERAGEB = label_begin.InPort( 'AVERAGEB' , 'double' ) + Ilabel_beginSYRLISTB = label_begin.InPort( 'SYRLISTB' , 'ListOfSyr' ) + Ilabel_beginGate = label_begin.GetInPort( 'Gate' ) + Olabel_beginNT = label_begin.OutPort( 'NT' , 'long' ) + Olabel_beginKT = label_begin.OutPort( 'KT' , 'long' ) + Olabel_beginMIN = label_begin.OutPort( 'MIN' , 'long' ) + Olabel_beginMAX = label_begin.OutPort( 'MAX' , 'long' ) + Olabel_beginAVERAGE = label_begin.OutPort( 'AVERAGE' , 'double' ) + Olabel_beginSYRLIST = label_begin.OutPort( 'SYRLIST' , 'ListOfSyr' ) + Olabel_beginGate = label_begin.GetOutPort( 'Gate' ) + + # 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 = GraphSyrControlAveAborted.SNode( 'L_OneEven' , Pylabel_test ) + EndL_OneEven.SetName( 'EndL_OneEven' ) + EndL_OneEven.SetAuthor( '' ) + EndL_OneEven.SetComment( 'Compute Node' ) + EndL_OneEven.Coords( 1064 , 339 ) + PyEndL_OneEven = [] + EndL_OneEven.SetPyFunction( '' , PyEndL_OneEven ) + IEndL_OneEvenMINT = EndL_OneEven.InPort( 'MINT' , 'long' ) + IEndL_OneEvenMAXT = EndL_OneEven.InPort( 'MAXT' , 'long' ) + IEndL_OneEvenAVERAGET = EndL_OneEven.InPort( 'AVERAGET' , 'double' ) + IEndL_OneEvenDefault = EndL_OneEven.GetInPort( 'Default' ) + OEndL_OneEvenMIN = EndL_OneEven.OutPort( 'MIN' , 'long' ) + OEndL_OneEvenMAX = EndL_OneEven.OutPort( 'MAX' , 'long' ) + OEndL_OneEvenAVERAGE = EndL_OneEven.OutPort( 'AVERAGE' , 'double' ) + OEndL_OneEvenGate = EndL_OneEven.GetOutPort( 'Gate' ) + label_test.SetName( 'label_test' ) + label_test.SetAuthor( '' ) + label_test.SetComment( 'Compute Node' ) + label_test.Coords( 564 , 219 ) + Ilabel_testValOne = label_test.InPort( 'ValOne' , 'long' ) + Ilabel_testValEven = label_test.InPort( 'ValEven' , 'long' ) + Ilabel_testNT = label_test.InPort( 'NT' , 'long' ) + Ilabel_testKT = label_test.InPort( 'KT' , 'long' ) + Ilabel_testMIN = label_test.InPort( 'MIN' , 'long' ) + Ilabel_testMAX = label_test.InPort( 'MAX' , 'long' ) + Ilabel_testAVERAGE = label_test.InPort( 'AVERAGE' , 'double' ) + Ilabel_testSYRLIST = label_test.InPort( 'SYRLIST' , 'ListOfSyr' ) + Ilabel_testGate = label_test.GetInPort( 'Gate' ) + Olabel_testFinished = label_test.OutPort( 'Finished' , 'long' ) + Olabel_testIncr = label_test.OutPort( 'Incr' , 'long' ) + Olabel_testEven = label_test.OutPort( 'Even' , 'long' ) + Olabel_testOdd = label_test.OutPort( 'Odd' , 'long' ) + Olabel_testN = label_test.OutPort( 'N' , 'long' ) + Olabel_testK = label_test.OutPort( 'K' , 'long' ) + Olabel_testMIN = label_test.OutPort( 'MIN' , 'long' ) + Olabel_testMAX = label_test.OutPort( 'MAX' , 'long' ) + Olabel_testAVERAGE = label_test.OutPort( 'AVERAGE' , 'double' ) + Olabel_testSYRLIST = label_test.OutPort( 'SYRLIST' , 'ListOfSyr' ) + Olabel_testDefault = label_test.GetOutPort( 'Default' ) + + # 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 = GraphSyrControlAveAborted.GNode( 'C_NotOneIsEven' , Pycontrol_m3p1 , 'label_test' ) + control_m3p1.SetName( 'control_m3p1' ) + control_m3p1.SetAuthor( '' ) + control_m3p1.SetComment( 'Compute Node' ) + control_m3p1.Coords( 1058 , 8 ) + Icontrol_m3p1N = control_m3p1.InPort( 'N' , 'long' ) + Icontrol_m3p1K = control_m3p1.InPort( 'K' , 'long' ) + Icontrol_m3p1MINT = control_m3p1.InPort( 'MINT' , 'long' ) + Icontrol_m3p1MAXT = control_m3p1.InPort( 'MAXT' , 'long' ) + Icontrol_m3p1AVERAGET = control_m3p1.InPort( 'AVERAGET' , 'double' ) + Icontrol_m3p1SYRLISTT = control_m3p1.InPort( 'SYRLISTT' , 'ListOfSyr' ) + Icontrol_m3p1Gate = control_m3p1.GetInPort( 'Gate' ) + Ocontrol_m3p1ValOne = control_m3p1.OutPort( 'ValOne' , 'long' ) + Ocontrol_m3p1ValEven = control_m3p1.OutPort( 'ValEven' , 'long' ) + Ocontrol_m3p1NT = control_m3p1.OutPort( 'NT' , 'long' ) + Ocontrol_m3p1KT = control_m3p1.OutPort( 'KT' , 'long' ) + Ocontrol_m3p1MIN = control_m3p1.OutPort( 'MIN' , 'long' ) + Ocontrol_m3p1MAX = control_m3p1.OutPort( 'MAX' , 'long' ) + Ocontrol_m3p1AVERAGE = control_m3p1.OutPort( 'AVERAGE' , 'double' ) + Ocontrol_m3p1SYRLIST = control_m3p1.OutPort( 'SYRLIST' , 'ListOfSyr' ) + Ocontrol_m3p1Gate = control_m3p1.GetOutPort( 'Gate' ) + + 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 = GraphSyrControlAveAborted.GNode( 'control_div2' , Pycontrol_div2 , 'label_begin' ) + control_div2.SetName( 'control_div2' ) + control_div2.SetAuthor( '' ) + control_div2.SetComment( 'Compute Node' ) + control_div2.Coords( 1048 , 555 ) + Icontrol_div2N = control_div2.InPort( 'N' , 'long' ) + Icontrol_div2K = control_div2.InPort( 'K' , 'long' ) + Icontrol_div2MINT = control_div2.InPort( 'MINT' , 'long' ) + Icontrol_div2MAXT = control_div2.InPort( 'MAXT' , 'long' ) + Icontrol_div2AVERAGET = control_div2.InPort( 'AVERAGET' , 'double' ) + Icontrol_div2SYRLISTT = control_div2.InPort( 'SYRLISTT' , 'ListOfSyr' ) + Icontrol_div2Gate = control_div2.GetInPort( 'Gate' ) + Ocontrol_div2NB = control_div2.OutPort( 'NB' , 'long' ) + Ocontrol_div2KB = control_div2.OutPort( 'KB' , 'long' ) + Ocontrol_div2MINB = control_div2.OutPort( 'MINB' , 'long' ) + Ocontrol_div2MAXB = control_div2.OutPort( 'MAXB' , 'long' ) + Ocontrol_div2AVERAGEB = control_div2.OutPort( 'AVERAGEB' , 'double' ) + Ocontrol_div2SYRLISTB = control_div2.OutPort( 'SYRLISTB' , 'ListOfSyr' ) + Ocontrol_div2Gate = control_div2.GetOutPort( 'Gate' ) + + # Creation of Links + Ltest_ISEVENBoolEvenlabel_testValEven = GraphSyrControlAveAborted.Link( Otest_ISEVENBoolEven , Ilabel_testValEven ) + Ltest_ISEVENBoolEvenlabel_testValEven.AddCoord( 1 , 544 , 256 ) + Ltest_ISEVENBoolEvenlabel_testValEven.AddCoord( 2 , 544 , 524 ) + + Ltest_ISONEBoolOnelabel_testValOne = GraphSyrControlAveAborted.Link( Otest_ISONEBoolOne , Ilabel_testValOne ) + Ltest_ISONEBoolOnelabel_testValOne.AddCoord( 1 , 546 , 237 ) + Ltest_ISONEBoolOnelabel_testValOne.AddCoord( 2 , 546 , 198 ) + + Lm3p1anEvenIntegercontrol_m3p1N = GraphSyrControlAveAborted.Link( Om3p1anEvenInteger , Icontrol_m3p1N ) + Lm3p1anEvenIntegercontrol_m3p1N.AddCoord( 1 , 975 , 38 ) + Lm3p1anEvenIntegercontrol_m3p1N.AddCoord( 2 , 976 , 81 ) + + Ldiv2anIntegercontrol_div2N = GraphSyrControlAveAborted.Link( Odiv2anInteger , Icontrol_div2N ) + Ldiv2anIntegercontrol_div2N.AddCoord( 1 , 1012 , 585 ) + Ldiv2anIntegercontrol_div2N.AddCoord( 2 , 1011 , 346 ) + + LincraNewCountcontrol_div2K = GraphSyrControlAveAborted.Link( OincraNewCount , Icontrol_div2K ) + LincraNewCountcontrol_div2K.AddCoord( 1 , 966 , 606 ) + LincraNewCountcontrol_div2K.AddCoord( 2 , 968 , 207 ) + + LincraNewCountcontrol_m3p1K = GraphSyrControlAveAborted.Link( OincraNewCount , Icontrol_m3p1K ) + LincraNewCountcontrol_m3p1K.AddCoord( 1 , 965 , 59 ) + LincraNewCountcontrol_m3p1K.AddCoord( 2 , 966 , 208 ) + + LincraNewCountC_AVERAGEaCount = GraphSyrControlAveAborted.Link( OincraNewCount , IC_AVERAGEaCount ) + LincraNewCountC_AVERAGEaCount.AddCoord( 1 , 751 , 588 ) + LincraNewCountC_AVERAGEaCount.AddCoord( 2 , 751 , 460 ) + LincraNewCountC_AVERAGEaCount.AddCoord( 3 , 965 , 462 ) + LincraNewCountC_AVERAGEaCount.AddCoord( 4 , 968 , 205 ) + + LC_MINaNewMinValcontrol_m3p1MINT = GraphSyrControlAveAborted.Link( OC_MINaNewMinVal , Icontrol_m3p1MINT ) + LC_MINaNewMinValcontrol_m3p1MINT.AddCoord( 1 , 991 , 78 ) + LC_MINaNewMinValcontrol_m3p1MINT.AddCoord( 2 , 991 , 905 ) + + LC_MINaNewMinValcontrol_div2MINT = GraphSyrControlAveAborted.Link( OC_MINaNewMinVal , Icontrol_div2MINT ) + LC_MINaNewMinValcontrol_div2MINT.AddCoord( 1 , 991 , 626 ) + LC_MINaNewMinValcontrol_div2MINT.AddCoord( 2 , 991 , 905 ) + + LC_MAXaNewMaxValcontrol_m3p1MAXT = GraphSyrControlAveAborted.Link( OC_MAXaNewMaxVal , Icontrol_m3p1MAXT ) + LC_MAXaNewMaxValcontrol_m3p1MAXT.AddCoord( 1 , 976 , 98 ) + LC_MAXaNewMaxValcontrol_m3p1MAXT.AddCoord( 2 , 974 , 738 ) + + LC_MAXaNewMaxValcontrol_div2MAXT = GraphSyrControlAveAborted.Link( OC_MAXaNewMaxVal , Icontrol_div2MAXT ) + LC_MAXaNewMaxValcontrol_div2MAXT.AddCoord( 1 , 972 , 648 ) + LC_MAXaNewMaxValcontrol_div2MAXT.AddCoord( 2 , 974 , 738 ) + + LC_AVERAGEaNewListOfSyrcontrol_m3p1SYRLISTT = GraphSyrControlAveAborted.Link( OC_AVERAGEaNewListOfSyr , Icontrol_m3p1SYRLISTT ) + LC_AVERAGEaNewListOfSyrcontrol_m3p1SYRLISTT.AddCoord( 1 , 1037 , 137 ) + LC_AVERAGEaNewListOfSyrcontrol_m3p1SYRLISTT.AddCoord( 2 , 1038 , 556 ) + + LC_AVERAGEaNewListOfSyrcontrol_div2SYRLISTT = GraphSyrControlAveAborted.Link( OC_AVERAGEaNewListOfSyr , Icontrol_div2SYRLISTT ) + LC_AVERAGEaNewListOfSyrcontrol_div2SYRLISTT.AddCoord( 1 , 1038 , 686 ) + LC_AVERAGEaNewListOfSyrcontrol_div2SYRLISTT.AddCoord( 2 , 1038 , 555 ) + + LC_AVERAGEanAveragecontrol_m3p1AVERAGET = GraphSyrControlAveAborted.Link( OC_AVERAGEanAverage , Icontrol_m3p1AVERAGET ) + LC_AVERAGEanAveragecontrol_m3p1AVERAGET.AddCoord( 1 , 1026 , 118 ) + LC_AVERAGEanAveragecontrol_m3p1AVERAGET.AddCoord( 2 , 1027 , 567 ) + + LC_AVERAGEanAveragecontrol_div2AVERAGET = GraphSyrControlAveAborted.Link( OC_AVERAGEanAverage , Icontrol_div2AVERAGET ) + LC_AVERAGEanAveragecontrol_div2AVERAGET.AddCoord( 1 , 1027 , 668 ) + LC_AVERAGEanAveragecontrol_div2AVERAGET.AddCoord( 2 , 1026 , 568 ) + + LC_LISTOFSYRaListOfSyrlabel_beginSYRLISTB = GraphSyrControlAveAborted.Link( OC_LISTOFSYRaListOfSyr , Ilabel_beginSYRLISTB ) + + Llabel_beginNTtest_ISONEanInteger = GraphSyrControlAveAborted.Link( Olabel_beginNT , Itest_ISONEanInteger ) + Llabel_beginNTtest_ISONEanInteger.AddCoord( 1 , 361 , 197 ) + Llabel_beginNTtest_ISONEanInteger.AddCoord( 2 , 360 , 290 ) + + Llabel_beginNTlabel_testNT = GraphSyrControlAveAborted.Link( Olabel_beginNT , Ilabel_testNT ) + + Llabel_beginNTtest_ISEVENanInteger = GraphSyrControlAveAborted.Link( Olabel_beginNT , Itest_ISEVENanInteger ) + Llabel_beginNTtest_ISEVENanInteger.AddCoord( 1 , 359 , 525 ) + Llabel_beginNTtest_ISEVENanInteger.AddCoord( 2 , 361 , 291 ) + + Llabel_beginKTlabel_testKT = GraphSyrControlAveAborted.Link( Olabel_beginKT , Ilabel_testKT ) + + Llabel_beginMINlabel_testMIN = GraphSyrControlAveAborted.Link( Olabel_beginMIN , Ilabel_testMIN ) + + Llabel_beginMAXlabel_testMAX = GraphSyrControlAveAborted.Link( Olabel_beginMAX , Ilabel_testMAX ) + + Llabel_beginAVERAGElabel_testAVERAGE = GraphSyrControlAveAborted.Link( Olabel_beginAVERAGE , Ilabel_testAVERAGE ) + + Llabel_beginSYRLISTlabel_testSYRLIST = GraphSyrControlAveAborted.Link( Olabel_beginSYRLIST , Ilabel_testSYRLIST ) + + Llabel_testEvendiv2Gate = GraphSyrControlAveAborted.Link( Olabel_testEven , Idiv2Gate ) + Llabel_testEvendiv2Gate.AddCoord( 1 , 777 , 351 ) + Llabel_testEvendiv2Gate.AddCoord( 2 , 777 , 286 ) + + Llabel_testOddm3p1Gate = GraphSyrControlAveAborted.Link( Olabel_testOdd , Im3p1Gate ) + Llabel_testOddm3p1Gate.AddCoord( 1 , 757 , 95 ) + Llabel_testOddm3p1Gate.AddCoord( 2 , 757 , 310 ) + + Llabel_testNm3p1anOddInteger = GraphSyrControlAveAborted.Link( Olabel_testN , Im3p1anOddInteger ) + Llabel_testNm3p1anOddInteger.AddCoord( 1 , 741 , 72 ) + Llabel_testNm3p1anOddInteger.AddCoord( 2 , 741 , 331 ) + + Llabel_testNdiv2anEvenInteger = GraphSyrControlAveAborted.Link( Olabel_testN , Idiv2anEvenInteger ) + + Llabel_testNC_MINanInteger = GraphSyrControlAveAborted.Link( Olabel_testN , IC_MINanInteger ) + Llabel_testNC_MINanInteger.AddCoord( 1 , 744 , 923 ) + Llabel_testNC_MINanInteger.AddCoord( 2 , 742 , 331 ) + + Llabel_testNC_MAXanInteger = GraphSyrControlAveAborted.Link( Olabel_testN , IC_MAXanInteger ) + Llabel_testNC_MAXanInteger.AddCoord( 1 , 742 , 759 ) + Llabel_testNC_MAXanInteger.AddCoord( 2 , 743 , 332 ) + + Llabel_testNC_AVERAGEanInteger = GraphSyrControlAveAborted.Link( Olabel_testN , IC_AVERAGEanInteger ) + Llabel_testNC_AVERAGEanInteger.AddCoord( 1 , 741 , 568 ) + Llabel_testNC_AVERAGEanInteger.AddCoord( 2 , 742 , 330 ) + + Llabel_testKincraCount = GraphSyrControlAveAborted.Link( Olabel_testK , IincraCount ) + Llabel_testKincraCount.AddCoord( 1 , 766 , 207 ) + Llabel_testKincraCount.AddCoord( 2 , 766 , 343 ) + + Llabel_testMINC_MINaMinVal = GraphSyrControlAveAborted.Link( Olabel_testMIN , IC_MINaMinVal ) + Llabel_testMINC_MINaMinVal.AddCoord( 1 , 771 , 902 ) + Llabel_testMINC_MINaMinVal.AddCoord( 2 , 777 , 371 ) + Llabel_testMINC_MINaMinVal.AddCoord( 3 , 777 , 370 ) + + Llabel_testMINEndL_OneEvenMINT = GraphSyrControlAveAborted.Link( Olabel_testMIN , IEndL_OneEvenMINT ) + + Llabel_testMAXC_MAXaMaxVal = GraphSyrControlAveAborted.Link( Olabel_testMAX , IC_MAXaMaxVal ) + Llabel_testMAXC_MAXaMaxVal.AddCoord( 1 , 764 , 739 ) + Llabel_testMAXC_MAXaMaxVal.AddCoord( 2 , 762 , 390 ) + + Llabel_testMAXEndL_OneEvenMAXT = GraphSyrControlAveAborted.Link( Olabel_testMAX , IEndL_OneEvenMAXT ) + + Llabel_testAVERAGEEndL_OneEvenAVERAGET = GraphSyrControlAveAborted.Link( Olabel_testAVERAGE , IEndL_OneEvenAVERAGET ) + + Llabel_testSYRLISTC_AVERAGEaListOfSyr = GraphSyrControlAveAborted.Link( Olabel_testSYRLIST , IC_AVERAGEaListOfSyr ) + Llabel_testSYRLISTC_AVERAGEaListOfSyr.AddCoord( 1 , 769 , 546 ) + Llabel_testSYRLISTC_AVERAGEaListOfSyr.AddCoord( 2 , 769 , 431 ) + Llabel_testSYRLISTC_AVERAGEaListOfSyr.AddCoord( 3 , 768 , 431 ) + Llabel_testSYRLISTC_AVERAGEaListOfSyr.AddCoord( 4 , 768 , 430 ) + + Lcontrol_m3p1Gatelabel_testGate = GraphSyrControlAveAborted.Link( Ocontrol_m3p1Gate , Ilabel_testGate ) + Lcontrol_m3p1Gatelabel_testGate.AddCoord( 1 , 553 , 453 ) + Lcontrol_m3p1Gatelabel_testGate.AddCoord( 2 , 554 , 1025 ) + Lcontrol_m3p1Gatelabel_testGate.AddCoord( 3 , 1242 , 1026 ) + Lcontrol_m3p1Gatelabel_testGate.AddCoord( 4 , 1234 , 204 ) + + Lcontrol_div2Gatelabel_beginGate = GraphSyrControlAveAborted.Link( Ocontrol_div2Gate , Ilabel_beginGate ) + Lcontrol_div2Gatelabel_beginGate.AddCoord( 1 , 176 , 419 ) + Lcontrol_div2Gatelabel_beginGate.AddCoord( 2 , 176 , 997 ) + Lcontrol_div2Gatelabel_beginGate.AddCoord( 3 , 1217 , 996 ) + Lcontrol_div2Gatelabel_beginGate.AddCoord( 4 , 1223 , 711 ) + + # Input datas + Ilabel_beginNB.Input( 31 ) + Ilabel_beginKB.Input( 0 ) + Ilabel_beginMINB.Input( 0 ) + Ilabel_beginMAXB.Input( 0 ) + Ilabel_beginAVERAGEB.Input( 0 ) + + # Output Ports of the graph + #Olabel_testFinished = label_test.GetOutPort( 'Finished' ) + #Olabel_testIncr = label_test.GetOutPort( 'Incr' ) + #OEndL_OneEvenMIN = EndL_OneEven.GetOutPort( 'MIN' ) + #OEndL_OneEvenMAX = EndL_OneEven.GetOutPort( 'MAX' ) + #OEndL_OneEvenAVERAGE = EndL_OneEven.GetOutPort( 'AVERAGE' ) + return GraphSyrControlAveAborted + + +GraphSyrControlAveAborted = DefGraphSyrControlAveAborted() diff --git a/examples/GraphSyrControlAveAborted.xml b/examples/GraphSyrControlAveAborted.xml new file mode 100644 index 0000000..6d11dbe --- /dev/null +++ b/examples/GraphSyrControlAveAborted.xml @@ -0,0 +1,1107 @@ + + + + + +? + ? + GraphSyrControlAveAborted + 1 + ? + +GraphSyrControlAveNOTValid1 + + +long + label_begin__NB + +long + label_begin__KB + +long + label_begin__MINB + +long + label_begin__MAXB + +double + label_begin__AVERAGEB + + +long + label_test__Finished + +long + label_test__Incr + +long + EndL_OneEven__MIN + +long + EndL_OneEven__MAX + +double + EndL_OneEven__AVERAGE + + + 2/10/2003 - 11:17:14 + 6/7/2005 - 10:32:56 + 1.05 + JR + ? + Syracuse algorithm + 0 + 0 + + +SyrComponent + SyrComponent + test_ISEVEN + 0 + ? + +C_ISEVEN + + +long + anInteger + + +long + BoolEven + + + 6/7/2005 - 10:32:56 + 6/7/2005 - 10:32:56 + 1.05 + ? + localhost/FactoryServer + C_ISEVEN from SyrComponent + 370 + 455 + +SyrComponent + SyrComponent + test_ISONE + 0 + ? + +C_ISONE + + +long + anInteger + + +long + BoolOne + + + 6/7/2005 - 10:32:56 + 6/7/2005 - 10:32:56 + 1.05 + ? + localhost/FactoryServer + C_ISONE from SyrComponent + 370 + 127 + +SyrComponent + SyrComponent + m3p1 + 0 + ? + +C_M3P1 + + +long + anOddInteger + + +long + anEvenInteger + + + 6/7/2005 - 10:32:56 + 6/7/2005 - 10:32:56 + 1.05 + ? + localhost/FactoryServer + C_M3P1 from SyrComponent + 789 + 0 + +SyrComponent + SyrComponent + div2 + 0 + ? + +C_DIV2 + + +long + anEvenInteger + + +long + anInteger + + + 6/7/2005 - 10:32:56 + 6/7/2005 - 10:32:56 + 1.05 + ? + localhost/FactoryServer + C_DIV2 from SyrComponent + 789 + 255 + +SyrComponent + SyrComponent + incr + 0 + ? + +C_INCR + + +long + aCount + + +long + aNewCount + + + 6/7/2005 - 10:32:56 + 6/7/2005 - 10:32:56 + 1.05 + ? + localhost/FactoryServer + C_INCR from SyrComponent + 790 + 136 + +SyrComponent + SyrComponent + C_MIN + 0 + ? + +C_MIN + + +long + aMinVal + +long + anInteger + + +long + aNewMinVal + + + 6/7/2005 - 10:32:56 + 6/7/2005 - 10:32:56 + 1.05 + ? + localhost/FactoryServer + C_MIN from SyrComponent + 798 + 833 + +SyrComponent + SyrComponent + C_MAX + 0 + ? + +C_MAX + + +long + aMaxVal + +long + anInteger + + +long + aNewMaxVal + + + 6/7/2005 - 10:32:56 + 6/7/2005 - 10:32:56 + 1.05 + ? + localhost/FactoryServer + C_MAX from SyrComponent + 798 + 668 + +SyrComponent + SyrComponent + C_AVERAGE + 0 + ? + +C_AVERAGE + + +ListOfSyr + aListOfSyr + +long + anInteger + +long + aCount + + +ListOfSyr + aNewListOfSyr + +double + anAverage + + + 6/7/2005 - 10:32:56 + 6/7/2005 - 10:32:56 + 1.05 + ? + localhost/FactoryServer + C_AVERAGE from SyrComponent + 784 + 476 + +SyrComponent + SyrComponent + C_LISTOFSYR + 0 + ? + +C_LISTOFSYR + + + +ListOfSyr + aListOfSyr + + + 6/7/2005 - 10:32:56 + 6/7/2005 - 10:32:56 + 1.05 + ? + localhost/FactoryServer + C_LISTOFSYR from SyrComponent + 5 + 321 + +? + ? + 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 + + + 6/7/2005 - 10:32:56 + 6/7/2005 - 10:32:56 + 1.05 + ? + ? + Python function + 183 + 220 + +? + ? + 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 + MIN + +long + MAX + +double + AVERAGE + +ListOfSyr + SYRLIST + + + +L_OneEven + + + + + + + + + + + + + + + + 6/7/2005 - 10:32:56 + 6/7/2005 - 10:32:56 + 1.05 + ? + ? + Compute Node + 564 + 219 + +? + ? + EndL_OneEven + 7 + label_test + +EndL_OneEven + + +long + MINT + +long + MAXT + +double + AVERAGET + + +long + MIN + +long + MAX + +double + AVERAGE + + + +? + + 6/7/2005 - 10:32:56 + 6/7/2005 - 10:32:56 + 1.05 + ? + ? + Compute Node + 1064 + 339 + +? + ? + 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 + + + 6/7/2005 - 10:32:56 + 6/7/2005 - 10:32:56 + 1.05 + ? + ? + Compute Node + 1058 + 8 + +? + ? + 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 + + + 6/7/2005 - 10:32:56 + 6/7/2005 - 10:32:56 + 1.05 + ? + ? + Compute Node + 1048 + 555 + + +test_ISEVEN + BoolEven + label_test + ValEven + + +544 + 256 + +544 + 524 + +test_ISONE + BoolOne + label_test + ValOne + + +546 + 237 + +546 + 198 + +m3p1 + anEvenInteger + control_m3p1 + N + + +975 + 38 + +976 + 81 + +div2 + anInteger + control_div2 + N + + +1012 + 585 + +1011 + 346 + +incr + aNewCount + control_div2 + K + + +966 + 606 + +968 + 207 + +incr + aNewCount + control_m3p1 + K + + +965 + 59 + +966 + 208 + +incr + aNewCount + C_AVERAGE + aCount + + +751 + 588 + +751 + 460 + +965 + 462 + +968 + 205 + +C_MIN + aNewMinVal + control_m3p1 + MINT + + +991 + 78 + +991 + 905 + +C_MIN + aNewMinVal + control_div2 + MINT + + +991 + 626 + +991 + 905 + +C_MAX + aNewMaxVal + control_m3p1 + MAXT + + +976 + 98 + +974 + 738 + +C_MAX + aNewMaxVal + control_div2 + MAXT + + +972 + 648 + +974 + 738 + +C_AVERAGE + aNewListOfSyr + control_m3p1 + SYRLISTT + + +1037 + 137 + +1038 + 556 + +C_AVERAGE + aNewListOfSyr + control_div2 + SYRLISTT + + +1038 + 686 + +1038 + 555 + +C_AVERAGE + anAverage + control_m3p1 + AVERAGET + + +1026 + 118 + +1027 + 567 + +C_AVERAGE + anAverage + control_div2 + AVERAGET + + +1027 + 668 + +1026 + 568 + +C_LISTOFSYR + aListOfSyr + label_begin + SYRLISTB + + +label_begin + NT + test_ISONE + anInteger + + +361 + 197 + +360 + 290 + +label_begin + NT + label_test + NT + + +label_begin + NT + test_ISEVEN + anInteger + + +359 + 525 + +361 + 291 + +label_begin + KT + label_test + KT + + +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 + Even + div2 + Gate + + +777 + 351 + +777 + 286 + +label_test + Odd + m3p1 + Gate + + +757 + 95 + +757 + 310 + +label_test + N + m3p1 + anOddInteger + + +741 + 72 + +741 + 331 + +label_test + N + div2 + anEvenInteger + + +label_test + N + C_MIN + anInteger + + +744 + 923 + +742 + 331 + +label_test + N + C_MAX + anInteger + + +742 + 759 + +743 + 332 + +label_test + N + C_AVERAGE + anInteger + + +741 + 568 + +742 + 330 + +label_test + K + incr + aCount + + +766 + 207 + +766 + 343 + +label_test + MIN + C_MIN + aMinVal + + +771 + 902 + +777 + 371 + +777 + 370 + +label_test + MIN + EndL_OneEven + MINT + + +label_test + MAX + C_MAX + aMaxVal + + +764 + 739 + +762 + 390 + +label_test + MAX + EndL_OneEven + MAXT + + +label_test + AVERAGE + EndL_OneEven + AVERAGET + + +label_test + SYRLIST + C_AVERAGE + aListOfSyr + + +769 + 546 + +769 + 431 + +768 + 431 + +768 + 430 + +control_m3p1 + Gate + label_test + Gate + + +553 + 453 + +554 + 1025 + +1242 + 1026 + +1234 + 204 + +control_div2 + Gate + label_begin + Gate + + +176 + 419 + +176 + 997 + +1217 + 996 + +1223 + 711 + + +GraphSyrControlAveAborted + label_begin__NB + label_begin + NB + +3 + 31 + + +GraphSyrControlAveAborted + label_begin__KB + label_begin + KB + +3 + 0 + + +GraphSyrControlAveAborted + label_begin__MINB + label_begin + MINB + +3 + 0 + + +GraphSyrControlAveAborted + label_begin__MAXB + label_begin + MAXB + +3 + 0 + + +GraphSyrControlAveAborted + label_begin__AVERAGEB + label_begin + AVERAGEB + +7 + 0 + diff --git a/examples/GraphSyrControlAveExecutable.py b/examples/GraphSyrControlAveExecutable.py new file mode 100644 index 0000000..338adea --- /dev/null +++ b/examples/GraphSyrControlAveExecutable.py @@ -0,0 +1,415 @@ + +# Generated python file of Graph GraphSyrControlAveExecutable + +from SuperV import * + +# Graph creation of GraphSyrControlAveExecutable +def DefGraphSyrControlAveExecutable() : + GraphSyrControlAveExecutable = Graph( 'GraphSyrControlAveExecutable' ) + GraphSyrControlAveExecutable.SetName( 'GraphSyrControlAveExecutable' ) + GraphSyrControlAveExecutable.SetAuthor( 'JR' ) + GraphSyrControlAveExecutable.SetComment( 'Syracuse algorithm' ) + GraphSyrControlAveExecutable.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + test_ISEVEN = GraphSyrControlAveExecutable.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( 370 , 455 ) + Itest_ISEVENanInteger = test_ISEVEN.GetInPort( 'anInteger' ) + Itest_ISEVENGate = test_ISEVEN.GetInPort( 'Gate' ) + Otest_ISEVENBoolEven = test_ISEVEN.GetOutPort( 'BoolEven' ) + Otest_ISEVENGate = test_ISEVEN.GetOutPort( 'Gate' ) + + test_ISONE = GraphSyrControlAveExecutable.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( 370 , 127 ) + Itest_ISONEanInteger = test_ISONE.GetInPort( 'anInteger' ) + Itest_ISONEGate = test_ISONE.GetInPort( 'Gate' ) + Otest_ISONEBoolOne = test_ISONE.GetOutPort( 'BoolOne' ) + Otest_ISONEGate = test_ISONE.GetOutPort( 'Gate' ) + + m3p1 = GraphSyrControlAveExecutable.FNode( 'SyrComponent' , 'SyrComponent' , 'C_M3P1' ) + m3p1.SetName( 'm3p1' ) + m3p1.SetAuthor( '' ) + m3p1.SetContainer( 'localhost/FactoryServer' ) + m3p1.SetComment( 'C_M3P1 from SyrComponent' ) + m3p1.Coords( 789 , 0 ) + Im3p1anOddInteger = m3p1.GetInPort( 'anOddInteger' ) + Im3p1Gate = m3p1.GetInPort( 'Gate' ) + Om3p1anEvenInteger = m3p1.GetOutPort( 'anEvenInteger' ) + Om3p1Gate = m3p1.GetOutPort( 'Gate' ) + + div2 = GraphSyrControlAveExecutable.FNode( 'SyrComponent' , 'SyrComponent' , 'C_DIV2' ) + div2.SetName( 'div2' ) + div2.SetAuthor( '' ) + div2.SetContainer( 'localhost/FactoryServer' ) + div2.SetComment( 'C_DIV2 from SyrComponent' ) + div2.Coords( 789 , 255 ) + Idiv2anEvenInteger = div2.GetInPort( 'anEvenInteger' ) + Idiv2Gate = div2.GetInPort( 'Gate' ) + Odiv2anInteger = div2.GetOutPort( 'anInteger' ) + Odiv2Gate = div2.GetOutPort( 'Gate' ) + + incr = GraphSyrControlAveExecutable.FNode( 'SyrComponent' , 'SyrComponent' , 'C_INCR' ) + incr.SetName( 'incr' ) + incr.SetAuthor( '' ) + incr.SetContainer( 'localhost/FactoryServer' ) + incr.SetComment( 'C_INCR from SyrComponent' ) + incr.Coords( 790 , 136 ) + IincraCount = incr.GetInPort( 'aCount' ) + IincrGate = incr.GetInPort( 'Gate' ) + OincraNewCount = incr.GetOutPort( 'aNewCount' ) + OincrGate = incr.GetOutPort( 'Gate' ) + + C_MIN = GraphSyrControlAveExecutable.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( 798 , 833 ) + IC_MINaMinVal = C_MIN.GetInPort( 'aMinVal' ) + IC_MINanInteger = C_MIN.GetInPort( 'anInteger' ) + IC_MINGate = C_MIN.GetInPort( 'Gate' ) + OC_MINaNewMinVal = C_MIN.GetOutPort( 'aNewMinVal' ) + OC_MINGate = C_MIN.GetOutPort( 'Gate' ) + + C_MAX = GraphSyrControlAveExecutable.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( 798 , 668 ) + IC_MAXaMaxVal = C_MAX.GetInPort( 'aMaxVal' ) + IC_MAXanInteger = C_MAX.GetInPort( 'anInteger' ) + IC_MAXGate = C_MAX.GetInPort( 'Gate' ) + OC_MAXaNewMaxVal = C_MAX.GetOutPort( 'aNewMaxVal' ) + OC_MAXGate = C_MAX.GetOutPort( 'Gate' ) + + C_AVERAGE = GraphSyrControlAveExecutable.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( 784 , 476 ) + IC_AVERAGEaListOfSyr = C_AVERAGE.GetInPort( 'aListOfSyr' ) + IC_AVERAGEanInteger = C_AVERAGE.GetInPort( 'anInteger' ) + IC_AVERAGEaCount = C_AVERAGE.GetInPort( 'aCount' ) + IC_AVERAGEGate = C_AVERAGE.GetInPort( 'Gate' ) + OC_AVERAGEaNewListOfSyr = C_AVERAGE.GetOutPort( 'aNewListOfSyr' ) + OC_AVERAGEanAverage = C_AVERAGE.GetOutPort( 'anAverage' ) + OC_AVERAGEGate = C_AVERAGE.GetOutPort( 'Gate' ) + + C_LISTOFSYR = GraphSyrControlAveExecutable.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( 5 , 321 ) + IC_LISTOFSYRGate = C_LISTOFSYR.GetInPort( 'Gate' ) + OC_LISTOFSYRaListOfSyr = C_LISTOFSYR.GetOutPort( 'aListOfSyr' ) + OC_LISTOFSYRGate = C_LISTOFSYR.GetOutPort( 'Gate' ) + + # 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 = GraphSyrControlAveExecutable.INode( 'label_begin' , Pylabel_begin ) + label_begin.SetName( 'label_begin' ) + label_begin.SetAuthor( '' ) + label_begin.SetComment( 'Python function' ) + label_begin.Coords( 183 , 220 ) + Ilabel_beginNB = label_begin.InPort( 'NB' , 'long' ) + Ilabel_beginKB = label_begin.InPort( 'KB' , 'long' ) + Ilabel_beginMINB = label_begin.InPort( 'MINB' , 'long' ) + Ilabel_beginMAXB = label_begin.InPort( 'MAXB' , 'long' ) + Ilabel_beginAVERAGEB = label_begin.InPort( 'AVERAGEB' , 'double' ) + Ilabel_beginSYRLISTB = label_begin.InPort( 'SYRLISTB' , 'ListOfSyr' ) + Ilabel_beginGate = label_begin.GetInPort( 'Gate' ) + Olabel_beginNT = label_begin.OutPort( 'NT' , 'long' ) + Olabel_beginKT = label_begin.OutPort( 'KT' , 'long' ) + Olabel_beginMIN = label_begin.OutPort( 'MIN' , 'long' ) + Olabel_beginMAX = label_begin.OutPort( 'MAX' , 'long' ) + Olabel_beginAVERAGE = label_begin.OutPort( 'AVERAGE' , 'double' ) + Olabel_beginSYRLIST = label_begin.OutPort( 'SYRLIST' , 'ListOfSyr' ) + Olabel_beginGate = label_begin.GetOutPort( 'Gate' ) + + # 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 = GraphSyrControlAveExecutable.SNode( 'L_OneEven' , Pylabel_test ) + EndL_OneEven.SetName( 'EndL_OneEven' ) + EndL_OneEven.SetAuthor( '' ) + EndL_OneEven.SetComment( 'Compute Node' ) + EndL_OneEven.Coords( 1064 , 339 ) + PyEndL_OneEven = [] + EndL_OneEven.SetPyFunction( '' , PyEndL_OneEven ) + IEndL_OneEvenMINT = EndL_OneEven.InPort( 'MINT' , 'long' ) + IEndL_OneEvenMAXT = EndL_OneEven.InPort( 'MAXT' , 'long' ) + IEndL_OneEvenAVERAGET = EndL_OneEven.InPort( 'AVERAGET' , 'double' ) + IEndL_OneEvenDefault = EndL_OneEven.GetInPort( 'Default' ) + OEndL_OneEvenMIN = EndL_OneEven.OutPort( 'MIN' , 'long' ) + OEndL_OneEvenMAX = EndL_OneEven.OutPort( 'MAX' , 'long' ) + OEndL_OneEvenAVERAGE = EndL_OneEven.OutPort( 'AVERAGE' , 'double' ) + OEndL_OneEvenGate = EndL_OneEven.GetOutPort( 'Gate' ) + label_test.SetName( 'label_test' ) + label_test.SetAuthor( '' ) + label_test.SetComment( 'Compute Node' ) + label_test.Coords( 564 , 219 ) + Ilabel_testValOne = label_test.InPort( 'ValOne' , 'long' ) + Ilabel_testValEven = label_test.InPort( 'ValEven' , 'long' ) + Ilabel_testNT = label_test.InPort( 'NT' , 'long' ) + Ilabel_testKT = label_test.InPort( 'KT' , 'long' ) + Ilabel_testMIN = label_test.InPort( 'MIN' , 'long' ) + Ilabel_testMAX = label_test.InPort( 'MAX' , 'long' ) + Ilabel_testAVERAGE = label_test.InPort( 'AVERAGE' , 'double' ) + Ilabel_testSYRLIST = label_test.InPort( 'SYRLIST' , 'ListOfSyr' ) + Ilabel_testGate = label_test.GetInPort( 'Gate' ) + Olabel_testFinished = label_test.OutPort( 'Finished' , 'long' ) + Olabel_testIncr = label_test.OutPort( 'Incr' , 'long' ) + Olabel_testEven = label_test.OutPort( 'Even' , 'long' ) + Olabel_testOdd = label_test.OutPort( 'Odd' , 'long' ) + Olabel_testN = label_test.OutPort( 'N' , 'long' ) + Olabel_testK = label_test.OutPort( 'K' , 'long' ) + Olabel_testMIN = label_test.OutPort( 'MIN' , 'long' ) + Olabel_testMAX = label_test.OutPort( 'MAX' , 'long' ) + Olabel_testAVERAGE = label_test.OutPort( 'AVERAGE' , 'double' ) + Olabel_testSYRLIST = label_test.OutPort( 'SYRLIST' , 'ListOfSyr' ) + Olabel_testDefault = label_test.GetOutPort( 'Default' ) + + # 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 = GraphSyrControlAveExecutable.GNode( 'C_NotOneIsEven' , Pycontrol_m3p1 , 'label_test' ) + control_m3p1.SetName( 'control_m3p1' ) + control_m3p1.SetAuthor( '' ) + control_m3p1.SetComment( 'Compute Node' ) + control_m3p1.Coords( 1058 , 8 ) + Icontrol_m3p1N = control_m3p1.InPort( 'N' , 'long' ) + Icontrol_m3p1K = control_m3p1.InPort( 'K' , 'long' ) + Icontrol_m3p1MINT = control_m3p1.InPort( 'MINT' , 'long' ) + Icontrol_m3p1MAXT = control_m3p1.InPort( 'MAXT' , 'long' ) + Icontrol_m3p1AVERAGET = control_m3p1.InPort( 'AVERAGET' , 'double' ) + Icontrol_m3p1SYRLISTT = control_m3p1.InPort( 'SYRLISTT' , 'ListOfSyr' ) + Icontrol_m3p1Gate = control_m3p1.GetInPort( 'Gate' ) + Ocontrol_m3p1ValOne = control_m3p1.OutPort( 'ValOne' , 'long' ) + Ocontrol_m3p1ValEven = control_m3p1.OutPort( 'ValEven' , 'long' ) + Ocontrol_m3p1NT = control_m3p1.OutPort( 'NT' , 'long' ) + Ocontrol_m3p1KT = control_m3p1.OutPort( 'KT' , 'long' ) + Ocontrol_m3p1MIN = control_m3p1.OutPort( 'MIN' , 'long' ) + Ocontrol_m3p1MAX = control_m3p1.OutPort( 'MAX' , 'long' ) + Ocontrol_m3p1AVERAGE = control_m3p1.OutPort( 'AVERAGE' , 'double' ) + Ocontrol_m3p1SYRLIST = control_m3p1.OutPort( 'SYRLIST' , 'ListOfSyr' ) + Ocontrol_m3p1Gate = control_m3p1.GetOutPort( 'Gate' ) + + 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 = GraphSyrControlAveExecutable.GNode( 'control_div2' , Pycontrol_div2 , 'label_begin' ) + control_div2.SetName( 'control_div2' ) + control_div2.SetAuthor( '' ) + control_div2.SetComment( 'Compute Node' ) + control_div2.Coords( 1048 , 555 ) + Icontrol_div2N = control_div2.InPort( 'N' , 'long' ) + Icontrol_div2K = control_div2.InPort( 'K' , 'long' ) + Icontrol_div2MINT = control_div2.InPort( 'MINT' , 'long' ) + Icontrol_div2MAXT = control_div2.InPort( 'MAXT' , 'long' ) + Icontrol_div2AVERAGET = control_div2.InPort( 'AVERAGET' , 'double' ) + Icontrol_div2SYRLISTT = control_div2.InPort( 'SYRLISTT' , 'ListOfSyr' ) + Icontrol_div2Gate = control_div2.GetInPort( 'Gate' ) + Ocontrol_div2NB = control_div2.OutPort( 'NB' , 'long' ) + Ocontrol_div2KB = control_div2.OutPort( 'KB' , 'long' ) + Ocontrol_div2MINB = control_div2.OutPort( 'MINB' , 'long' ) + Ocontrol_div2MAXB = control_div2.OutPort( 'MAXB' , 'long' ) + Ocontrol_div2AVERAGEB = control_div2.OutPort( 'AVERAGEB' , 'double' ) + Ocontrol_div2SYRLISTB = control_div2.OutPort( 'SYRLISTB' , 'ListOfSyr' ) + Ocontrol_div2Gate = control_div2.GetOutPort( 'Gate' ) + + # Creation of Links + Ltest_ISEVENBoolEvenlabel_testValEven = GraphSyrControlAveExecutable.Link( Otest_ISEVENBoolEven , Ilabel_testValEven ) + Ltest_ISEVENBoolEvenlabel_testValEven.AddCoord( 1 , 544 , 256 ) + Ltest_ISEVENBoolEvenlabel_testValEven.AddCoord( 2 , 544 , 524 ) + + Ltest_ISONEBoolOnelabel_testValOne = GraphSyrControlAveExecutable.Link( Otest_ISONEBoolOne , Ilabel_testValOne ) + Ltest_ISONEBoolOnelabel_testValOne.AddCoord( 1 , 546 , 237 ) + Ltest_ISONEBoolOnelabel_testValOne.AddCoord( 2 , 546 , 198 ) + + Lm3p1anEvenIntegercontrol_m3p1N = GraphSyrControlAveExecutable.Link( Om3p1anEvenInteger , Icontrol_m3p1N ) + Lm3p1anEvenIntegercontrol_m3p1N.AddCoord( 1 , 975 , 38 ) + Lm3p1anEvenIntegercontrol_m3p1N.AddCoord( 2 , 976 , 81 ) + + Ldiv2anIntegercontrol_div2N = GraphSyrControlAveExecutable.Link( Odiv2anInteger , Icontrol_div2N ) + Ldiv2anIntegercontrol_div2N.AddCoord( 1 , 1012 , 585 ) + Ldiv2anIntegercontrol_div2N.AddCoord( 2 , 1011 , 346 ) + + LincraNewCountcontrol_div2K = GraphSyrControlAveExecutable.Link( OincraNewCount , Icontrol_div2K ) + LincraNewCountcontrol_div2K.AddCoord( 1 , 966 , 606 ) + LincraNewCountcontrol_div2K.AddCoord( 2 , 968 , 207 ) + + LincraNewCountcontrol_m3p1K = GraphSyrControlAveExecutable.Link( OincraNewCount , Icontrol_m3p1K ) + LincraNewCountcontrol_m3p1K.AddCoord( 1 , 965 , 59 ) + LincraNewCountcontrol_m3p1K.AddCoord( 2 , 966 , 208 ) + + LincraNewCountC_AVERAGEaCount = GraphSyrControlAveExecutable.Link( OincraNewCount , IC_AVERAGEaCount ) + LincraNewCountC_AVERAGEaCount.AddCoord( 1 , 751 , 588 ) + LincraNewCountC_AVERAGEaCount.AddCoord( 2 , 751 , 460 ) + LincraNewCountC_AVERAGEaCount.AddCoord( 3 , 965 , 462 ) + LincraNewCountC_AVERAGEaCount.AddCoord( 4 , 968 , 205 ) + + LC_MINaNewMinValcontrol_m3p1MINT = GraphSyrControlAveExecutable.Link( OC_MINaNewMinVal , Icontrol_m3p1MINT ) + LC_MINaNewMinValcontrol_m3p1MINT.AddCoord( 1 , 991 , 78 ) + LC_MINaNewMinValcontrol_m3p1MINT.AddCoord( 2 , 991 , 905 ) + + LC_MINaNewMinValcontrol_div2MINT = GraphSyrControlAveExecutable.Link( OC_MINaNewMinVal , Icontrol_div2MINT ) + LC_MINaNewMinValcontrol_div2MINT.AddCoord( 1 , 991 , 626 ) + LC_MINaNewMinValcontrol_div2MINT.AddCoord( 2 , 991 , 905 ) + + LC_MAXaNewMaxValcontrol_m3p1MAXT = GraphSyrControlAveExecutable.Link( OC_MAXaNewMaxVal , Icontrol_m3p1MAXT ) + LC_MAXaNewMaxValcontrol_m3p1MAXT.AddCoord( 1 , 976 , 98 ) + LC_MAXaNewMaxValcontrol_m3p1MAXT.AddCoord( 2 , 974 , 738 ) + + LC_MAXaNewMaxValcontrol_div2MAXT = GraphSyrControlAveExecutable.Link( OC_MAXaNewMaxVal , Icontrol_div2MAXT ) + LC_MAXaNewMaxValcontrol_div2MAXT.AddCoord( 1 , 972 , 648 ) + LC_MAXaNewMaxValcontrol_div2MAXT.AddCoord( 2 , 974 , 738 ) + + LC_AVERAGEaNewListOfSyrcontrol_m3p1SYRLISTT = GraphSyrControlAveExecutable.Link( OC_AVERAGEaNewListOfSyr , Icontrol_m3p1SYRLISTT ) + LC_AVERAGEaNewListOfSyrcontrol_m3p1SYRLISTT.AddCoord( 1 , 1037 , 137 ) + LC_AVERAGEaNewListOfSyrcontrol_m3p1SYRLISTT.AddCoord( 2 , 1038 , 556 ) + + LC_AVERAGEaNewListOfSyrcontrol_div2SYRLISTT = GraphSyrControlAveExecutable.Link( OC_AVERAGEaNewListOfSyr , Icontrol_div2SYRLISTT ) + LC_AVERAGEaNewListOfSyrcontrol_div2SYRLISTT.AddCoord( 1 , 1038 , 686 ) + LC_AVERAGEaNewListOfSyrcontrol_div2SYRLISTT.AddCoord( 2 , 1038 , 555 ) + + LC_AVERAGEanAveragecontrol_m3p1AVERAGET = GraphSyrControlAveExecutable.Link( OC_AVERAGEanAverage , Icontrol_m3p1AVERAGET ) + LC_AVERAGEanAveragecontrol_m3p1AVERAGET.AddCoord( 1 , 1026 , 118 ) + LC_AVERAGEanAveragecontrol_m3p1AVERAGET.AddCoord( 2 , 1027 , 567 ) + + LC_AVERAGEanAveragecontrol_div2AVERAGET = GraphSyrControlAveExecutable.Link( OC_AVERAGEanAverage , Icontrol_div2AVERAGET ) + LC_AVERAGEanAveragecontrol_div2AVERAGET.AddCoord( 1 , 1027 , 668 ) + LC_AVERAGEanAveragecontrol_div2AVERAGET.AddCoord( 2 , 1026 , 568 ) + + LC_LISTOFSYRaListOfSyrlabel_beginSYRLISTB = GraphSyrControlAveExecutable.Link( OC_LISTOFSYRaListOfSyr , Ilabel_beginSYRLISTB ) + + Llabel_beginNTtest_ISONEanInteger = GraphSyrControlAveExecutable.Link( Olabel_beginNT , Itest_ISONEanInteger ) + Llabel_beginNTtest_ISONEanInteger.AddCoord( 1 , 361 , 197 ) + Llabel_beginNTtest_ISONEanInteger.AddCoord( 2 , 360 , 290 ) + + Llabel_beginNTlabel_testNT = GraphSyrControlAveExecutable.Link( Olabel_beginNT , Ilabel_testNT ) + + Llabel_beginNTtest_ISEVENanInteger = GraphSyrControlAveExecutable.Link( Olabel_beginNT , Itest_ISEVENanInteger ) + Llabel_beginNTtest_ISEVENanInteger.AddCoord( 1 , 359 , 525 ) + Llabel_beginNTtest_ISEVENanInteger.AddCoord( 2 , 361 , 291 ) + + Llabel_beginKTlabel_testKT = GraphSyrControlAveExecutable.Link( Olabel_beginKT , Ilabel_testKT ) + + Llabel_beginMINlabel_testMIN = GraphSyrControlAveExecutable.Link( Olabel_beginMIN , Ilabel_testMIN ) + + Llabel_beginMAXlabel_testMAX = GraphSyrControlAveExecutable.Link( Olabel_beginMAX , Ilabel_testMAX ) + + Llabel_beginAVERAGElabel_testAVERAGE = GraphSyrControlAveExecutable.Link( Olabel_beginAVERAGE , Ilabel_testAVERAGE ) + + Llabel_beginSYRLISTlabel_testSYRLIST = GraphSyrControlAveExecutable.Link( Olabel_beginSYRLIST , Ilabel_testSYRLIST ) + + Llabel_testEvendiv2Gate = GraphSyrControlAveExecutable.Link( Olabel_testEven , Idiv2Gate ) + Llabel_testEvendiv2Gate.AddCoord( 1 , 777 , 351 ) + Llabel_testEvendiv2Gate.AddCoord( 2 , 777 , 286 ) + + Llabel_testOddm3p1Gate = GraphSyrControlAveExecutable.Link( Olabel_testOdd , Im3p1Gate ) + Llabel_testOddm3p1Gate.AddCoord( 1 , 757 , 95 ) + Llabel_testOddm3p1Gate.AddCoord( 2 , 757 , 310 ) + + Llabel_testNm3p1anOddInteger = GraphSyrControlAveExecutable.Link( Olabel_testN , Im3p1anOddInteger ) + Llabel_testNm3p1anOddInteger.AddCoord( 1 , 741 , 72 ) + Llabel_testNm3p1anOddInteger.AddCoord( 2 , 741 , 331 ) + + Llabel_testNdiv2anEvenInteger = GraphSyrControlAveExecutable.Link( Olabel_testN , Idiv2anEvenInteger ) + + Llabel_testNC_MINanInteger = GraphSyrControlAveExecutable.Link( Olabel_testN , IC_MINanInteger ) + Llabel_testNC_MINanInteger.AddCoord( 1 , 744 , 923 ) + Llabel_testNC_MINanInteger.AddCoord( 2 , 742 , 331 ) + + Llabel_testNC_MAXanInteger = GraphSyrControlAveExecutable.Link( Olabel_testN , IC_MAXanInteger ) + Llabel_testNC_MAXanInteger.AddCoord( 1 , 742 , 759 ) + Llabel_testNC_MAXanInteger.AddCoord( 2 , 743 , 332 ) + + Llabel_testNC_AVERAGEanInteger = GraphSyrControlAveExecutable.Link( Olabel_testN , IC_AVERAGEanInteger ) + Llabel_testNC_AVERAGEanInteger.AddCoord( 1 , 741 , 568 ) + Llabel_testNC_AVERAGEanInteger.AddCoord( 2 , 742 , 330 ) + + Llabel_testKincraCount = GraphSyrControlAveExecutable.Link( Olabel_testK , IincraCount ) + Llabel_testKincraCount.AddCoord( 1 , 766 , 207 ) + Llabel_testKincraCount.AddCoord( 2 , 766 , 343 ) + + Llabel_testMINC_MINaMinVal = GraphSyrControlAveExecutable.Link( Olabel_testMIN , IC_MINaMinVal ) + Llabel_testMINC_MINaMinVal.AddCoord( 1 , 771 , 902 ) + Llabel_testMINC_MINaMinVal.AddCoord( 2 , 777 , 371 ) + Llabel_testMINC_MINaMinVal.AddCoord( 3 , 777 , 370 ) + + Llabel_testMINEndL_OneEvenMINT = GraphSyrControlAveExecutable.Link( Olabel_testMIN , IEndL_OneEvenMINT ) + + Llabel_testMAXC_MAXaMaxVal = GraphSyrControlAveExecutable.Link( Olabel_testMAX , IC_MAXaMaxVal ) + Llabel_testMAXC_MAXaMaxVal.AddCoord( 1 , 764 , 739 ) + Llabel_testMAXC_MAXaMaxVal.AddCoord( 2 , 762 , 390 ) + + Llabel_testMAXEndL_OneEvenMAXT = GraphSyrControlAveExecutable.Link( Olabel_testMAX , IEndL_OneEvenMAXT ) + + Llabel_testAVERAGEEndL_OneEvenAVERAGET = GraphSyrControlAveExecutable.Link( Olabel_testAVERAGE , IEndL_OneEvenAVERAGET ) + + Llabel_testSYRLISTC_AVERAGEaListOfSyr = GraphSyrControlAveExecutable.Link( Olabel_testSYRLIST , IC_AVERAGEaListOfSyr ) + Llabel_testSYRLISTC_AVERAGEaListOfSyr.AddCoord( 1 , 769 , 546 ) + Llabel_testSYRLISTC_AVERAGEaListOfSyr.AddCoord( 2 , 769 , 431 ) + Llabel_testSYRLISTC_AVERAGEaListOfSyr.AddCoord( 3 , 768 , 431 ) + Llabel_testSYRLISTC_AVERAGEaListOfSyr.AddCoord( 4 , 768 , 430 ) + + Llabel_testDefaultEndL_OneEvenDefault = GraphSyrControlAveExecutable.Link( Olabel_testDefault , IEndL_OneEvenDefault ) + + Lcontrol_m3p1Gatelabel_testGate = GraphSyrControlAveExecutable.Link( Ocontrol_m3p1Gate , Ilabel_testGate ) + Lcontrol_m3p1Gatelabel_testGate.AddCoord( 1 , 553 , 453 ) + Lcontrol_m3p1Gatelabel_testGate.AddCoord( 2 , 554 , 1025 ) + Lcontrol_m3p1Gatelabel_testGate.AddCoord( 3 , 1242 , 1026 ) + Lcontrol_m3p1Gatelabel_testGate.AddCoord( 4 , 1234 , 204 ) + + Lcontrol_div2Gatelabel_beginGate = GraphSyrControlAveExecutable.Link( Ocontrol_div2Gate , Ilabel_beginGate ) + Lcontrol_div2Gatelabel_beginGate.AddCoord( 1 , 176 , 419 ) + Lcontrol_div2Gatelabel_beginGate.AddCoord( 2 , 176 , 997 ) + Lcontrol_div2Gatelabel_beginGate.AddCoord( 3 , 1217 , 996 ) + Lcontrol_div2Gatelabel_beginGate.AddCoord( 4 , 1223 , 711 ) + + # Input datas + Ilabel_beginNB.Input( 31 ) + Ilabel_beginKB.Input( 0 ) + Ilabel_beginMINB.Input( 0 ) + Ilabel_beginMAXB.Input( 0 ) + Ilabel_beginAVERAGEB.Input( 0 ) + + # Output Ports of the graph + #Olabel_testFinished = label_test.GetOutPort( 'Finished' ) + #Olabel_testIncr = label_test.GetOutPort( 'Incr' ) + #OEndL_OneEvenMIN = EndL_OneEven.GetOutPort( 'MIN' ) + #OEndL_OneEvenMAX = EndL_OneEven.GetOutPort( 'MAX' ) + #OEndL_OneEvenAVERAGE = EndL_OneEven.GetOutPort( 'AVERAGE' ) + return GraphSyrControlAveExecutable + + +GraphSyrControlAveExecutable = DefGraphSyrControlAveExecutable() diff --git a/examples/GraphSyrControlAveExecutable.xml b/examples/GraphSyrControlAveExecutable.xml new file mode 100644 index 0000000..630c7ad --- /dev/null +++ b/examples/GraphSyrControlAveExecutable.xml @@ -0,0 +1,1113 @@ + + + + + +? + ? + GraphSyrControlAveExecutable + 1 + ? + +GraphSyrControlAveNOTExecutable + + +long + label_begin__NB + +long + label_begin__KB + +long + label_begin__MINB + +long + label_begin__MAXB + +double + label_begin__AVERAGEB + + +long + label_test__Finished + +long + label_test__Incr + +long + EndL_OneEven__MIN + +long + EndL_OneEven__MAX + +double + EndL_OneEven__AVERAGE + + + 2/10/2003 - 11:17:14 + 22/6/2005 - 15:5:27 + 1.05 + JR + ? + Syracuse algorithm + 0 + 0 + + +SyrComponent + SyrComponent + test_ISEVEN + 0 + ? + +C_ISEVEN + + +long + anInteger + + +long + BoolEven + + + 22/6/2005 - 15:4:37 + 22/6/2005 - 15:4:37 + 1.05 + ? + localhost/FactoryServer + C_ISEVEN from SyrComponent + 370 + 455 + +SyrComponent + SyrComponent + test_ISONE + 0 + ? + +C_ISONE + + +long + anInteger + + +long + BoolOne + + + 22/6/2005 - 15:4:37 + 22/6/2005 - 15:4:37 + 1.05 + ? + localhost/FactoryServer + C_ISONE from SyrComponent + 370 + 127 + +SyrComponent + SyrComponent + m3p1 + 0 + ? + +C_M3P1 + + +long + anOddInteger + + +long + anEvenInteger + + + 22/6/2005 - 15:4:37 + 22/6/2005 - 15:4:37 + 1.05 + ? + localhost/FactoryServer + C_M3P1 from SyrComponent + 789 + 0 + +SyrComponent + SyrComponent + div2 + 0 + ? + +C_DIV2 + + +long + anEvenInteger + + +long + anInteger + + + 22/6/2005 - 15:4:37 + 22/6/2005 - 15:4:37 + 1.05 + ? + localhost/FactoryServer + C_DIV2 from SyrComponent + 789 + 255 + +SyrComponent + SyrComponent + incr + 0 + ? + +C_INCR + + +long + aCount + + +long + aNewCount + + + 22/6/2005 - 15:4:37 + 22/6/2005 - 15:4:37 + 1.05 + ? + localhost/FactoryServer + C_INCR from SyrComponent + 790 + 136 + +SyrComponent + SyrComponent + C_MIN + 0 + ? + +C_MIN + + +long + aMinVal + +long + anInteger + + +long + aNewMinVal + + + 22/6/2005 - 15:4:37 + 22/6/2005 - 15:4:37 + 1.05 + ? + localhost/FactoryServer + C_MIN from SyrComponent + 798 + 833 + +SyrComponent + SyrComponent + C_MAX + 0 + ? + +C_MAX + + +long + aMaxVal + +long + anInteger + + +long + aNewMaxVal + + + 22/6/2005 - 15:4:37 + 22/6/2005 - 15:4:37 + 1.05 + ? + localhost/FactoryServer + C_MAX from SyrComponent + 798 + 668 + +SyrComponent + SyrComponent + C_AVERAGE + 0 + ? + +C_AVERAGE + + +ListOfSyr + aListOfSyr + +long + anInteger + +long + aCount + + +ListOfSyr + aNewListOfSyr + +double + anAverage + + + 22/6/2005 - 15:4:37 + 22/6/2005 - 15:4:37 + 1.05 + ? + localhost/FactoryServer + C_AVERAGE from SyrComponent + 784 + 476 + +SyrComponent + SyrComponent + C_LISTOFSYR + 0 + ? + +C_LISTOFSYR + + + +ListOfSyr + aListOfSyr + + + 22/6/2005 - 15:4:37 + 22/6/2005 - 15:4:37 + 1.05 + ? + localhost/FactoryServer + C_LISTOFSYR from SyrComponent + 5 + 321 + +? + ? + 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 + + + 22/6/2005 - 15:4:37 + 22/6/2005 - 15:4:37 + 1.05 + ? + ? + Python function + 183 + 220 + +? + ? + 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 + MIN + +long + MAX + +double + AVERAGE + +ListOfSyr + SYRLIST + + + +L_OneEven + + + + + + + + + + + + + + + + 22/6/2005 - 15:4:37 + 22/6/2005 - 15:4:37 + 1.05 + ? + ? + Compute Node + 564 + 219 + +? + ? + EndL_OneEven + 7 + label_test + +EndL_OneEven + + +long + MINT + +long + MAXT + +double + AVERAGET + + +long + MIN + +long + MAX + +double + AVERAGE + + + +? + + 22/6/2005 - 15:4:37 + 22/6/2005 - 15:4:37 + 1.05 + ? + ? + Compute Node + 1064 + 339 + +? + ? + 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 + + + 22/6/2005 - 15:4:37 + 22/6/2005 - 15:4:37 + 1.05 + ? + ? + Compute Node + 1058 + 8 + +? + ? + 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 + + + 22/6/2005 - 15:4:37 + 22/6/2005 - 15:4:37 + 1.05 + ? + ? + Compute Node + 1048 + 555 + + +test_ISEVEN + BoolEven + label_test + ValEven + + +544 + 256 + +544 + 524 + +test_ISONE + BoolOne + label_test + ValOne + + +546 + 237 + +546 + 198 + +m3p1 + anEvenInteger + control_m3p1 + N + + +975 + 38 + +976 + 81 + +div2 + anInteger + control_div2 + N + + +1012 + 585 + +1011 + 346 + +incr + aNewCount + control_div2 + K + + +966 + 606 + +968 + 207 + +incr + aNewCount + control_m3p1 + K + + +965 + 59 + +966 + 208 + +incr + aNewCount + C_AVERAGE + aCount + + +751 + 588 + +751 + 460 + +965 + 462 + +968 + 205 + +C_MIN + aNewMinVal + control_m3p1 + MINT + + +991 + 78 + +991 + 905 + +C_MIN + aNewMinVal + control_div2 + MINT + + +991 + 626 + +991 + 905 + +C_MAX + aNewMaxVal + control_m3p1 + MAXT + + +976 + 98 + +974 + 738 + +C_MAX + aNewMaxVal + control_div2 + MAXT + + +972 + 648 + +974 + 738 + +C_AVERAGE + aNewListOfSyr + control_m3p1 + SYRLISTT + + +1037 + 137 + +1038 + 556 + +C_AVERAGE + aNewListOfSyr + control_div2 + SYRLISTT + + +1038 + 686 + +1038 + 555 + +C_AVERAGE + anAverage + control_m3p1 + AVERAGET + + +1026 + 118 + +1027 + 567 + +C_AVERAGE + anAverage + control_div2 + AVERAGET + + +1027 + 668 + +1026 + 568 + +C_LISTOFSYR + aListOfSyr + label_begin + SYRLISTB + + +label_begin + NT + test_ISONE + anInteger + + +361 + 197 + +360 + 290 + +label_begin + NT + label_test + NT + + +label_begin + NT + test_ISEVEN + anInteger + + +359 + 525 + +361 + 291 + +label_begin + KT + label_test + KT + + +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 + Even + div2 + Gate + + +777 + 351 + +777 + 286 + +label_test + Odd + m3p1 + Gate + + +757 + 95 + +757 + 310 + +label_test + N + m3p1 + anOddInteger + + +741 + 72 + +741 + 331 + +label_test + N + div2 + anEvenInteger + + +label_test + N + C_MIN + anInteger + + +744 + 923 + +742 + 331 + +label_test + N + C_MAX + anInteger + + +742 + 759 + +743 + 332 + +label_test + N + C_AVERAGE + anInteger + + +741 + 568 + +742 + 330 + +label_test + K + incr + aCount + + +766 + 207 + +766 + 343 + +label_test + MIN + C_MIN + aMinVal + + +771 + 902 + +777 + 371 + +777 + 370 + +label_test + MIN + EndL_OneEven + MINT + + +label_test + MAX + C_MAX + aMaxVal + + +764 + 739 + +762 + 390 + +label_test + MAX + EndL_OneEven + MAXT + + +label_test + AVERAGE + EndL_OneEven + AVERAGET + + +label_test + SYRLIST + C_AVERAGE + aListOfSyr + + +769 + 546 + +769 + 431 + +768 + 431 + +768 + 430 + +label_test + Default + EndL_OneEven + Default + + +control_m3p1 + Gate + label_test + Gate + + +553 + 453 + +554 + 1025 + +1242 + 1026 + +1234 + 204 + +control_div2 + Gate + label_begin + Gate + + +176 + 419 + +176 + 997 + +1217 + 996 + +1223 + 711 + + +GraphSyrControlAveExecutable + label_begin__NB + label_begin + NB + +3 + 31 + + +GraphSyrControlAveExecutable + label_begin__KB + label_begin + KB + +3 + 0 + + +GraphSyrControlAveExecutable + label_begin__MINB + label_begin + MINB + +3 + 0 + + +GraphSyrControlAveExecutable + label_begin__MAXB + label_begin + MAXB + +3 + 0 + + +GraphSyrControlAveExecutable + label_begin__AVERAGEB + label_begin + AVERAGEB + +7 + 0 + diff --git a/examples/GraphSyrControlAveNOTValid.py b/examples/GraphSyrControlAveNOTValid.py new file mode 100644 index 0000000..f2062f0 --- /dev/null +++ b/examples/GraphSyrControlAveNOTValid.py @@ -0,0 +1,415 @@ + +# Generated python file of Graph GraphSyrControlAveNOTValid + +from SuperV import * + +# Graph creation of GraphSyrControlAveNOTValid +def DefGraphSyrControlAveNOTValid() : + GraphSyrControlAveNOTValid = Graph( 'GraphSyrControlAveNOTValid' ) + GraphSyrControlAveNOTValid.SetName( 'GraphSyrControlAveNOTValid' ) + GraphSyrControlAveNOTValid.SetAuthor( 'JR' ) + GraphSyrControlAveNOTValid.SetComment( 'Syracuse algorithm' ) + GraphSyrControlAveNOTValid.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + test_ISEVEN = GraphSyrControlAveNOTValid.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( 370 , 455 ) + Itest_ISEVENanInteger = test_ISEVEN.GetInPort( 'anInteger' ) + Itest_ISEVENGate = test_ISEVEN.GetInPort( 'Gate' ) + Otest_ISEVENBoolEven = test_ISEVEN.GetOutPort( 'BoolEven' ) + Otest_ISEVENGate = test_ISEVEN.GetOutPort( 'Gate' ) + + test_ISONE = GraphSyrControlAveNOTValid.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( 370 , 127 ) + Itest_ISONEanInteger = test_ISONE.GetInPort( 'anInteger' ) + Itest_ISONEGate = test_ISONE.GetInPort( 'Gate' ) + Otest_ISONEBoolOne = test_ISONE.GetOutPort( 'BoolOne' ) + Otest_ISONEGate = test_ISONE.GetOutPort( 'Gate' ) + + m3p1 = GraphSyrControlAveNOTValid.FNode( 'SyrComponent' , 'SyrComponent' , 'C_M3P1' ) + m3p1.SetName( 'm3p1' ) + m3p1.SetAuthor( '' ) + m3p1.SetContainer( 'localhost/FactoryServer' ) + m3p1.SetComment( 'C_M3P1 from SyrComponent' ) + m3p1.Coords( 789 , 0 ) + Im3p1anOddInteger = m3p1.GetInPort( 'anOddInteger' ) + Im3p1Gate = m3p1.GetInPort( 'Gate' ) + Om3p1anEvenInteger = m3p1.GetOutPort( 'anEvenInteger' ) + Om3p1Gate = m3p1.GetOutPort( 'Gate' ) + + div2 = GraphSyrControlAveNOTValid.FNode( 'SyrComponent' , 'SyrComponent' , 'C_DIV2' ) + div2.SetName( 'div2' ) + div2.SetAuthor( '' ) + div2.SetContainer( 'localhost/FactoryServer' ) + div2.SetComment( 'C_DIV2 from SyrComponent' ) + div2.Coords( 789 , 255 ) + Idiv2anEvenInteger = div2.GetInPort( 'anEvenInteger' ) + Idiv2Gate = div2.GetInPort( 'Gate' ) + Odiv2anInteger = div2.GetOutPort( 'anInteger' ) + Odiv2Gate = div2.GetOutPort( 'Gate' ) + + incr = GraphSyrControlAveNOTValid.FNode( 'SyrComponent' , 'SyrComponent' , 'C_INCR' ) + incr.SetName( 'incr' ) + incr.SetAuthor( '' ) + incr.SetContainer( 'localhost/FactoryServer' ) + incr.SetComment( 'C_INCR from SyrComponent' ) + incr.Coords( 790 , 136 ) + IincraCount = incr.GetInPort( 'aCount' ) + IincrGate = incr.GetInPort( 'Gate' ) + OincraNewCount = incr.GetOutPort( 'aNewCount' ) + OincrGate = incr.GetOutPort( 'Gate' ) + + C_MIN = GraphSyrControlAveNOTValid.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( 798 , 833 ) + IC_MINaMinVal = C_MIN.GetInPort( 'aMinVal' ) + IC_MINanInteger = C_MIN.GetInPort( 'anInteger' ) + IC_MINGate = C_MIN.GetInPort( 'Gate' ) + OC_MINaNewMinVal = C_MIN.GetOutPort( 'aNewMinVal' ) + OC_MINGate = C_MIN.GetOutPort( 'Gate' ) + + C_MAX = GraphSyrControlAveNOTValid.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( 798 , 668 ) + IC_MAXaMaxVal = C_MAX.GetInPort( 'aMaxVal' ) + IC_MAXanInteger = C_MAX.GetInPort( 'anInteger' ) + IC_MAXGate = C_MAX.GetInPort( 'Gate' ) + OC_MAXaNewMaxVal = C_MAX.GetOutPort( 'aNewMaxVal' ) + OC_MAXGate = C_MAX.GetOutPort( 'Gate' ) + + C_AVERAGE = GraphSyrControlAveNOTValid.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( 784 , 476 ) + IC_AVERAGEaListOfSyr = C_AVERAGE.GetInPort( 'aListOfSyr' ) + IC_AVERAGEanInteger = C_AVERAGE.GetInPort( 'anInteger' ) + IC_AVERAGEaCount = C_AVERAGE.GetInPort( 'aCount' ) + IC_AVERAGEGate = C_AVERAGE.GetInPort( 'Gate' ) + OC_AVERAGEaNewListOfSyr = C_AVERAGE.GetOutPort( 'aNewListOfSyr' ) + OC_AVERAGEanAverage = C_AVERAGE.GetOutPort( 'anAverage' ) + OC_AVERAGEGate = C_AVERAGE.GetOutPort( 'Gate' ) + + C_LISTOFSYR = GraphSyrControlAveNOTValid.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( 5 , 321 ) + IC_LISTOFSYRGate = C_LISTOFSYR.GetInPort( 'Gate' ) + OC_LISTOFSYRaListOfSyr = C_LISTOFSYR.GetOutPort( 'aListOfSyr' ) + OC_LISTOFSYRGate = C_LISTOFSYR.GetOutPort( 'Gate' ) + + # 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 = GraphSyrControlAveNOTValid.INode( 'label_begin' , Pylabel_begin ) + label_begin.SetName( 'label_begin' ) + label_begin.SetAuthor( '' ) + label_begin.SetComment( 'Python function' ) + label_begin.Coords( 183 , 220 ) + Ilabel_beginNB = label_begin.InPort( 'NB' , 'long' ) + Ilabel_beginKB = label_begin.InPort( 'KB' , 'long' ) + Ilabel_beginMINB = label_begin.InPort( 'MINB' , 'long' ) + Ilabel_beginMAXB = label_begin.InPort( 'MAXB' , 'long' ) + Ilabel_beginAVERAGEB = label_begin.InPort( 'AVERAGEB' , 'double' ) + Ilabel_beginSYRLISTB = label_begin.InPort( 'SYRLISTB' , 'ListOfSyr' ) + Ilabel_beginGate = label_begin.GetInPort( 'Gate' ) + Olabel_beginNT = label_begin.OutPort( 'NT' , 'long' ) + Olabel_beginKT = label_begin.OutPort( 'KT' , 'long' ) + Olabel_beginMIN = label_begin.OutPort( 'MIN' , 'long' ) + Olabel_beginMAX = label_begin.OutPort( 'MAX' , 'long' ) + Olabel_beginAVERAGE = label_begin.OutPort( 'AVERAGE' , 'double' ) + Olabel_beginSYRLIST = label_begin.OutPort( 'SYRLIST' , 'ListOfSyr' ) + Olabel_beginGate = label_begin.GetOutPort( 'Gate' ) + + # 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 = GraphSyrControlAveNOTValid.SNode( 'L_OneEven' , Pylabel_test ) + EndL_OneEven.SetName( 'EndL_OneEven' ) + EndL_OneEven.SetAuthor( '' ) + EndL_OneEven.SetComment( 'Compute Node' ) + EndL_OneEven.Coords( 1064 , 339 ) + PyEndL_OneEven = [] + EndL_OneEven.SetPyFunction( '' , PyEndL_OneEven ) + IEndL_OneEvenMINT = EndL_OneEven.InPort( 'MINT' , 'long' ) + IEndL_OneEvenMAXT = EndL_OneEven.InPort( 'MAXT' , 'long' ) + IEndL_OneEvenAVERAGET = EndL_OneEven.InPort( 'AVERAGET' , 'double' ) + IEndL_OneEvenDefault = EndL_OneEven.GetInPort( 'Default' ) + OEndL_OneEvenMIN = EndL_OneEven.OutPort( 'MIN' , 'long' ) + OEndL_OneEvenMAX = EndL_OneEven.OutPort( 'MAX' , 'long' ) + OEndL_OneEvenAVERAGE = EndL_OneEven.OutPort( 'AVERAGE' , 'double' ) + OEndL_OneEvenGate = EndL_OneEven.GetOutPort( 'Gate' ) + label_test.SetName( 'label_test' ) + label_test.SetAuthor( '' ) + label_test.SetComment( 'Compute Node' ) + label_test.Coords( 564 , 219 ) + Ilabel_testValOne = label_test.InPort( 'ValOne' , 'long' ) + Ilabel_testValEven = label_test.InPort( 'ValEven' , 'long' ) + Ilabel_testNT = label_test.InPort( 'NT' , 'long' ) + Ilabel_testKT = label_test.InPort( 'KT' , 'long' ) + Ilabel_testMIN = label_test.InPort( 'MIN' , 'long' ) + Ilabel_testMAX = label_test.InPort( 'MAX' , 'long' ) + Ilabel_testAVERAGE = label_test.InPort( 'AVERAGE' , 'double' ) + Ilabel_testSYRLIST = label_test.InPort( 'SYRLIST' , 'ListOfSyr' ) + Ilabel_testGate = label_test.GetInPort( 'Gate' ) + Olabel_testFinished = label_test.OutPort( 'Finished' , 'long' ) + Olabel_testIncr = label_test.OutPort( 'Incr' , 'long' ) + Olabel_testEven = label_test.OutPort( 'Even' , 'long' ) + Olabel_testOdd = label_test.OutPort( 'Odd' , 'long' ) + Olabel_testN = label_test.OutPort( 'N' , 'long' ) + Olabel_testK = label_test.OutPort( 'K' , 'long' ) + Olabel_testMIN = label_test.OutPort( 'MIN' , 'long' ) + Olabel_testMAX = label_test.OutPort( 'MAX' , 'long' ) + Olabel_testAVERAGE = label_test.OutPort( 'AVERAGE' , 'double' ) + Olabel_testSYRLIST = label_test.OutPort( 'SYRLIST' , 'ListOfSyr' ) + Olabel_testDefault = label_test.GetOutPort( 'Default' ) + + # 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 = GraphSyrControlAveNOTValid.GNode( 'C_NotOneIsEven' , Pycontrol_m3p1 , 'label_test' ) + control_m3p1.SetName( 'control_m3p1' ) + control_m3p1.SetAuthor( '' ) + control_m3p1.SetComment( 'Compute Node' ) + control_m3p1.Coords( 1058 , 8 ) + Icontrol_m3p1N = control_m3p1.InPort( 'N' , 'long' ) + Icontrol_m3p1K = control_m3p1.InPort( 'K' , 'long' ) + Icontrol_m3p1MINT = control_m3p1.InPort( 'MINT' , 'long' ) + Icontrol_m3p1MAXT = control_m3p1.InPort( 'MAXT' , 'long' ) + Icontrol_m3p1AVERAGET = control_m3p1.InPort( 'AVERAGET' , 'double' ) + Icontrol_m3p1SYRLISTT = control_m3p1.InPort( 'SYRLISTT' , 'ListOfSyr' ) + Icontrol_m3p1Gate = control_m3p1.GetInPort( 'Gate' ) + Ocontrol_m3p1ValOne = control_m3p1.OutPort( 'ValOne' , 'long' ) + Ocontrol_m3p1ValEven = control_m3p1.OutPort( 'ValEven' , 'long' ) + Ocontrol_m3p1NT = control_m3p1.OutPort( 'NT' , 'long' ) + Ocontrol_m3p1KT = control_m3p1.OutPort( 'KT' , 'long' ) + Ocontrol_m3p1MIN = control_m3p1.OutPort( 'MIN' , 'long' ) + Ocontrol_m3p1MAX = control_m3p1.OutPort( 'MAX' , 'long' ) + Ocontrol_m3p1AVERAGE = control_m3p1.OutPort( 'AVERAGE' , 'double' ) + Ocontrol_m3p1SYRLIST = control_m3p1.OutPort( 'SYRLIST' , 'ListOfSyr' ) + Ocontrol_m3p1Gate = control_m3p1.GetOutPort( 'Gate' ) + + 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 = GraphSyrControlAveNOTValid.GNode( 'control_div2' , Pycontrol_div2 , 'label_begin' ) + control_div2.SetName( 'control_div2' ) + control_div2.SetAuthor( '' ) + control_div2.SetComment( 'Compute Node' ) + control_div2.Coords( 1048 , 555 ) + Icontrol_div2N = control_div2.InPort( 'N' , 'long' ) + Icontrol_div2K = control_div2.InPort( 'K' , 'long' ) + Icontrol_div2MINT = control_div2.InPort( 'MINT' , 'long' ) + Icontrol_div2MAXT = control_div2.InPort( 'MAXT' , 'long' ) + Icontrol_div2AVERAGET = control_div2.InPort( 'AVERAGET' , 'double' ) + Icontrol_div2SYRLISTT = control_div2.InPort( 'SYRLISTT' , 'ListOfSyr' ) + Icontrol_div2Gate = control_div2.GetInPort( 'Gate' ) + Ocontrol_div2NB = control_div2.OutPort( 'NB' , 'long' ) + Ocontrol_div2KB = control_div2.OutPort( 'KB' , 'long' ) + Ocontrol_div2MINB = control_div2.OutPort( 'MINB' , 'long' ) + Ocontrol_div2MAXB = control_div2.OutPort( 'MAXB' , 'long' ) + Ocontrol_div2AVERAGEB = control_div2.OutPort( 'AVERAGEB' , 'double' ) + Ocontrol_div2SYRLISTB = control_div2.OutPort( 'SYRLISTB' , 'ListOfSyr' ) + Ocontrol_div2Gate = control_div2.GetOutPort( 'Gate' ) + + # Creation of Links + Ltest_ISEVENBoolEvenlabel_testValEven = GraphSyrControlAveNOTValid.Link( Otest_ISEVENBoolEven , Ilabel_testValEven ) + Ltest_ISEVENBoolEvenlabel_testValEven.AddCoord( 1 , 544 , 256 ) + Ltest_ISEVENBoolEvenlabel_testValEven.AddCoord( 2 , 544 , 524 ) + + Ltest_ISONEBoolOnelabel_testValOne = GraphSyrControlAveNOTValid.Link( Otest_ISONEBoolOne , Ilabel_testValOne ) + Ltest_ISONEBoolOnelabel_testValOne.AddCoord( 1 , 546 , 237 ) + Ltest_ISONEBoolOnelabel_testValOne.AddCoord( 2 , 546 , 198 ) + + Lm3p1anEvenIntegercontrol_m3p1N = GraphSyrControlAveNOTValid.Link( Om3p1anEvenInteger , Icontrol_m3p1N ) + Lm3p1anEvenIntegercontrol_m3p1N.AddCoord( 1 , 975 , 38 ) + Lm3p1anEvenIntegercontrol_m3p1N.AddCoord( 2 , 976 , 81 ) + + Ldiv2anIntegercontrol_div2N = GraphSyrControlAveNOTValid.Link( Odiv2anInteger , Icontrol_div2N ) + Ldiv2anIntegercontrol_div2N.AddCoord( 1 , 1012 , 585 ) + Ldiv2anIntegercontrol_div2N.AddCoord( 2 , 1011 , 346 ) + + LincraNewCountcontrol_div2K = GraphSyrControlAveNOTValid.Link( OincraNewCount , Icontrol_div2K ) + LincraNewCountcontrol_div2K.AddCoord( 1 , 966 , 606 ) + LincraNewCountcontrol_div2K.AddCoord( 2 , 968 , 207 ) + + LincraNewCountcontrol_m3p1K = GraphSyrControlAveNOTValid.Link( OincraNewCount , Icontrol_m3p1K ) + LincraNewCountcontrol_m3p1K.AddCoord( 1 , 965 , 59 ) + LincraNewCountcontrol_m3p1K.AddCoord( 2 , 966 , 208 ) + + LincraNewCountC_AVERAGEaCount = GraphSyrControlAveNOTValid.Link( OincraNewCount , IC_AVERAGEaCount ) + LincraNewCountC_AVERAGEaCount.AddCoord( 1 , 751 , 588 ) + LincraNewCountC_AVERAGEaCount.AddCoord( 2 , 751 , 460 ) + LincraNewCountC_AVERAGEaCount.AddCoord( 3 , 965 , 462 ) + LincraNewCountC_AVERAGEaCount.AddCoord( 4 , 968 , 205 ) + + LC_MINaNewMinValcontrol_m3p1MINT = GraphSyrControlAveNOTValid.Link( OC_MINaNewMinVal , Icontrol_m3p1MINT ) + LC_MINaNewMinValcontrol_m3p1MINT.AddCoord( 1 , 991 , 78 ) + LC_MINaNewMinValcontrol_m3p1MINT.AddCoord( 2 , 991 , 905 ) + + LC_MINaNewMinValcontrol_div2MINT = GraphSyrControlAveNOTValid.Link( OC_MINaNewMinVal , Icontrol_div2MINT ) + LC_MINaNewMinValcontrol_div2MINT.AddCoord( 1 , 991 , 626 ) + LC_MINaNewMinValcontrol_div2MINT.AddCoord( 2 , 991 , 905 ) + + LC_MAXaNewMaxValcontrol_m3p1MAXT = GraphSyrControlAveNOTValid.Link( OC_MAXaNewMaxVal , Icontrol_m3p1MAXT ) + LC_MAXaNewMaxValcontrol_m3p1MAXT.AddCoord( 1 , 976 , 98 ) + LC_MAXaNewMaxValcontrol_m3p1MAXT.AddCoord( 2 , 974 , 738 ) + + LC_MAXaNewMaxValcontrol_div2MAXT = GraphSyrControlAveNOTValid.Link( OC_MAXaNewMaxVal , Icontrol_div2MAXT ) + LC_MAXaNewMaxValcontrol_div2MAXT.AddCoord( 1 , 972 , 648 ) + LC_MAXaNewMaxValcontrol_div2MAXT.AddCoord( 2 , 974 , 738 ) + + LC_AVERAGEaNewListOfSyrcontrol_m3p1SYRLISTT = GraphSyrControlAveNOTValid.Link( OC_AVERAGEaNewListOfSyr , Icontrol_m3p1SYRLISTT ) + LC_AVERAGEaNewListOfSyrcontrol_m3p1SYRLISTT.AddCoord( 1 , 1037 , 137 ) + LC_AVERAGEaNewListOfSyrcontrol_m3p1SYRLISTT.AddCoord( 2 , 1038 , 556 ) + + LC_AVERAGEaNewListOfSyrcontrol_div2SYRLISTT = GraphSyrControlAveNOTValid.Link( OC_AVERAGEaNewListOfSyr , Icontrol_div2SYRLISTT ) + LC_AVERAGEaNewListOfSyrcontrol_div2SYRLISTT.AddCoord( 1 , 1038 , 686 ) + LC_AVERAGEaNewListOfSyrcontrol_div2SYRLISTT.AddCoord( 2 , 1038 , 555 ) + + LC_AVERAGEanAveragecontrol_m3p1AVERAGET = GraphSyrControlAveNOTValid.Link( OC_AVERAGEanAverage , Icontrol_m3p1AVERAGET ) + LC_AVERAGEanAveragecontrol_m3p1AVERAGET.AddCoord( 1 , 1026 , 118 ) + LC_AVERAGEanAveragecontrol_m3p1AVERAGET.AddCoord( 2 , 1027 , 567 ) + + LC_AVERAGEanAveragecontrol_div2AVERAGET = GraphSyrControlAveNOTValid.Link( OC_AVERAGEanAverage , Icontrol_div2AVERAGET ) + LC_AVERAGEanAveragecontrol_div2AVERAGET.AddCoord( 1 , 1027 , 668 ) + LC_AVERAGEanAveragecontrol_div2AVERAGET.AddCoord( 2 , 1026 , 568 ) + + LC_LISTOFSYRaListOfSyrlabel_beginSYRLISTB = GraphSyrControlAveNOTValid.Link( OC_LISTOFSYRaListOfSyr , Ilabel_beginSYRLISTB ) + + Llabel_beginNTtest_ISONEanInteger = GraphSyrControlAveNOTValid.Link( Olabel_beginNT , Itest_ISONEanInteger ) + Llabel_beginNTtest_ISONEanInteger.AddCoord( 1 , 361 , 197 ) + Llabel_beginNTtest_ISONEanInteger.AddCoord( 2 , 360 , 290 ) + + Llabel_beginNTlabel_testNT = GraphSyrControlAveNOTValid.Link( Olabel_beginNT , Ilabel_testNT ) + + Llabel_beginNTtest_ISEVENanInteger = GraphSyrControlAveNOTValid.Link( Olabel_beginNT , Itest_ISEVENanInteger ) + Llabel_beginNTtest_ISEVENanInteger.AddCoord( 1 , 359 , 525 ) + Llabel_beginNTtest_ISEVENanInteger.AddCoord( 2 , 361 , 291 ) + + Llabel_beginKTlabel_testKT = GraphSyrControlAveNOTValid.Link( Olabel_beginKT , Ilabel_testKT ) + + Llabel_beginMINlabel_testMIN = GraphSyrControlAveNOTValid.Link( Olabel_beginMIN , Ilabel_testMIN ) + + Llabel_beginMAXlabel_testMAX = GraphSyrControlAveNOTValid.Link( Olabel_beginMAX , Ilabel_testMAX ) + + Llabel_beginAVERAGElabel_testAVERAGE = GraphSyrControlAveNOTValid.Link( Olabel_beginAVERAGE , Ilabel_testAVERAGE ) + + Llabel_beginSYRLISTlabel_testSYRLIST = GraphSyrControlAveNOTValid.Link( Olabel_beginSYRLIST , Ilabel_testSYRLIST ) + + Llabel_testEvendiv2Gate = GraphSyrControlAveNOTValid.Link( Olabel_testEven , Idiv2Gate ) + Llabel_testEvendiv2Gate.AddCoord( 1 , 777 , 351 ) + Llabel_testEvendiv2Gate.AddCoord( 2 , 777 , 286 ) + + Llabel_testOddm3p1Gate = GraphSyrControlAveNOTValid.Link( Olabel_testOdd , Im3p1Gate ) + Llabel_testOddm3p1Gate.AddCoord( 1 , 757 , 95 ) + Llabel_testOddm3p1Gate.AddCoord( 2 , 757 , 310 ) + + Llabel_testNm3p1anOddInteger = GraphSyrControlAveNOTValid.Link( Olabel_testN , Im3p1anOddInteger ) + Llabel_testNm3p1anOddInteger.AddCoord( 1 , 741 , 72 ) + Llabel_testNm3p1anOddInteger.AddCoord( 2 , 741 , 331 ) + + Llabel_testNdiv2anEvenInteger = GraphSyrControlAveNOTValid.Link( Olabel_testN , Idiv2anEvenInteger ) + + Llabel_testNC_MINanInteger = GraphSyrControlAveNOTValid.Link( Olabel_testN , IC_MINanInteger ) + Llabel_testNC_MINanInteger.AddCoord( 1 , 744 , 923 ) + Llabel_testNC_MINanInteger.AddCoord( 2 , 742 , 331 ) + + Llabel_testNC_MAXanInteger = GraphSyrControlAveNOTValid.Link( Olabel_testN , IC_MAXanInteger ) + Llabel_testNC_MAXanInteger.AddCoord( 1 , 742 , 759 ) + Llabel_testNC_MAXanInteger.AddCoord( 2 , 743 , 332 ) + + Llabel_testNC_AVERAGEanInteger = GraphSyrControlAveNOTValid.Link( Olabel_testN , IC_AVERAGEanInteger ) + Llabel_testNC_AVERAGEanInteger.AddCoord( 1 , 741 , 568 ) + Llabel_testNC_AVERAGEanInteger.AddCoord( 2 , 742 , 330 ) + + Llabel_testKincraCount = GraphSyrControlAveNOTValid.Link( Olabel_testK , IincraCount ) + Llabel_testKincraCount.AddCoord( 1 , 766 , 207 ) + Llabel_testKincraCount.AddCoord( 2 , 766 , 343 ) + + Llabel_testMINC_MINaMinVal = GraphSyrControlAveNOTValid.Link( Olabel_testMIN , IC_MINaMinVal ) + Llabel_testMINC_MINaMinVal.AddCoord( 1 , 771 , 902 ) + Llabel_testMINC_MINaMinVal.AddCoord( 2 , 777 , 371 ) + Llabel_testMINC_MINaMinVal.AddCoord( 3 , 777 , 370 ) + + Llabel_testMAXC_MAXaMaxVal = GraphSyrControlAveNOTValid.Link( Olabel_testMAX , IC_MAXaMaxVal ) + Llabel_testMAXC_MAXaMaxVal.AddCoord( 1 , 764 , 739 ) + Llabel_testMAXC_MAXaMaxVal.AddCoord( 2 , 762 , 390 ) + + Llabel_testSYRLISTC_AVERAGEaListOfSyr = GraphSyrControlAveNOTValid.Link( Olabel_testSYRLIST , IC_AVERAGEaListOfSyr ) + Llabel_testSYRLISTC_AVERAGEaListOfSyr.AddCoord( 1 , 769 , 546 ) + Llabel_testSYRLISTC_AVERAGEaListOfSyr.AddCoord( 2 , 769 , 431 ) + Llabel_testSYRLISTC_AVERAGEaListOfSyr.AddCoord( 3 , 768 , 431 ) + Llabel_testSYRLISTC_AVERAGEaListOfSyr.AddCoord( 4 , 768 , 430 ) + + Llabel_testDefaultEndL_OneEvenDefault = GraphSyrControlAveNOTValid.Link( Olabel_testDefault , IEndL_OneEvenDefault ) + + Lcontrol_m3p1Gatelabel_testGate = GraphSyrControlAveNOTValid.Link( Ocontrol_m3p1Gate , Ilabel_testGate ) + Lcontrol_m3p1Gatelabel_testGate.AddCoord( 1 , 553 , 453 ) + Lcontrol_m3p1Gatelabel_testGate.AddCoord( 2 , 554 , 1025 ) + Lcontrol_m3p1Gatelabel_testGate.AddCoord( 3 , 1242 , 1026 ) + Lcontrol_m3p1Gatelabel_testGate.AddCoord( 4 , 1234 , 204 ) + + Lcontrol_div2Gatelabel_beginGate = GraphSyrControlAveNOTValid.Link( Ocontrol_div2Gate , Ilabel_beginGate ) + Lcontrol_div2Gatelabel_beginGate.AddCoord( 1 , 176 , 419 ) + Lcontrol_div2Gatelabel_beginGate.AddCoord( 2 , 176 , 997 ) + Lcontrol_div2Gatelabel_beginGate.AddCoord( 3 , 1217 , 996 ) + Lcontrol_div2Gatelabel_beginGate.AddCoord( 4 , 1223 , 711 ) + + # Input datas + Ilabel_beginNB.Input( 31 ) + Ilabel_beginKB.Input( 0 ) + Ilabel_beginMINB.Input( 0 ) + Ilabel_beginMAXB.Input( 0 ) + Ilabel_beginAVERAGEB.Input( 0 ) + + # Input Ports of the graph + #IEndL_OneEvenMINT = EndL_OneEven.GetInPort( 'MINT' ) + #IEndL_OneEvenMAXT = EndL_OneEven.GetInPort( 'MAXT' ) + #IEndL_OneEvenAVERAGET = EndL_OneEven.GetInPort( 'AVERAGET' ) + + # Output Ports of the graph + #Olabel_testFinished = label_test.GetOutPort( 'Finished' ) + #Olabel_testIncr = label_test.GetOutPort( 'Incr' ) + #Olabel_testAVERAGE = label_test.GetOutPort( 'AVERAGE' ) + #OEndL_OneEvenMIN = EndL_OneEven.GetOutPort( 'MIN' ) + #OEndL_OneEvenMAX = EndL_OneEven.GetOutPort( 'MAX' ) + #OEndL_OneEvenAVERAGE = EndL_OneEven.GetOutPort( 'AVERAGE' ) + return GraphSyrControlAveNOTValid + + +GraphSyrControlAveNOTValid = DefGraphSyrControlAveNOTValid() diff --git a/examples/GraphSyrControlAveNOTValid.xml b/examples/GraphSyrControlAveNOTValid.xml new file mode 100644 index 0000000..48cb311 --- /dev/null +++ b/examples/GraphSyrControlAveNOTValid.xml @@ -0,0 +1,1107 @@ + + + + + +? + ? + GraphSyrControlAveNOTValid + 1 + ? + +GraphSyrControlAveNOTValid + + +long + label_begin__NB + +long + label_begin__KB + +long + label_begin__MINB + +long + label_begin__MAXB + +double + label_begin__AVERAGEB + +long + EndL_OneEven__MINT + +long + EndL_OneEven__MAXT + +double + EndL_OneEven__AVERAGET + + +long + label_test__Finished + +long + label_test__Incr + +double + label_test__AVERAGE + +long + EndL_OneEven__MIN + +long + EndL_OneEven__MAX + +double + EndL_OneEven__AVERAGE + + + 2/10/2003 - 11:17:14 + 28/6/2005 - 12:6:44 + 1.05 + JR + ? + Syracuse algorithm + 0 + 0 + + +SyrComponent + SyrComponent + test_ISEVEN + 0 + ? + +C_ISEVEN + + +long + anInteger + + +long + BoolEven + + + 28/6/2005 - 12:6:44 + 28/6/2005 - 12:6:44 + 1.05 + ? + localhost/FactoryServer + C_ISEVEN from SyrComponent + 370 + 455 + +SyrComponent + SyrComponent + test_ISONE + 0 + ? + +C_ISONE + + +long + anInteger + + +long + BoolOne + + + 28/6/2005 - 12:6:44 + 28/6/2005 - 12:6:44 + 1.05 + ? + localhost/FactoryServer + C_ISONE from SyrComponent + 370 + 127 + +SyrComponent + SyrComponent + m3p1 + 0 + ? + +C_M3P1 + + +long + anOddInteger + + +long + anEvenInteger + + + 28/6/2005 - 12:6:44 + 28/6/2005 - 12:6:44 + 1.05 + ? + localhost/FactoryServer + C_M3P1 from SyrComponent + 789 + 0 + +SyrComponent + SyrComponent + div2 + 0 + ? + +C_DIV2 + + +long + anEvenInteger + + +long + anInteger + + + 28/6/2005 - 12:6:44 + 28/6/2005 - 12:6:44 + 1.05 + ? + localhost/FactoryServer + C_DIV2 from SyrComponent + 789 + 255 + +SyrComponent + SyrComponent + incr + 0 + ? + +C_INCR + + +long + aCount + + +long + aNewCount + + + 28/6/2005 - 12:6:44 + 28/6/2005 - 12:6:44 + 1.05 + ? + localhost/FactoryServer + C_INCR from SyrComponent + 790 + 136 + +SyrComponent + SyrComponent + C_MIN + 0 + ? + +C_MIN + + +long + aMinVal + +long + anInteger + + +long + aNewMinVal + + + 28/6/2005 - 12:6:44 + 28/6/2005 - 12:6:44 + 1.05 + ? + localhost/FactoryServer + C_MIN from SyrComponent + 798 + 833 + +SyrComponent + SyrComponent + C_MAX + 0 + ? + +C_MAX + + +long + aMaxVal + +long + anInteger + + +long + aNewMaxVal + + + 28/6/2005 - 12:6:44 + 28/6/2005 - 12:6:44 + 1.05 + ? + localhost/FactoryServer + C_MAX from SyrComponent + 798 + 668 + +SyrComponent + SyrComponent + C_AVERAGE + 0 + ? + +C_AVERAGE + + +ListOfSyr + aListOfSyr + +long + anInteger + +long + aCount + + +ListOfSyr + aNewListOfSyr + +double + anAverage + + + 28/6/2005 - 12:6:44 + 28/6/2005 - 12:6:44 + 1.05 + ? + localhost/FactoryServer + C_AVERAGE from SyrComponent + 784 + 476 + +SyrComponent + SyrComponent + C_LISTOFSYR + 0 + ? + +C_LISTOFSYR + + + +ListOfSyr + aListOfSyr + + + 28/6/2005 - 12:6:44 + 28/6/2005 - 12:6:44 + 1.05 + ? + localhost/FactoryServer + C_LISTOFSYR from SyrComponent + 5 + 321 + +? + ? + 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 + + + 28/6/2005 - 12:6:44 + 28/6/2005 - 12:6:44 + 1.05 + ? + ? + Python function + 183 + 220 + +? + ? + 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 + MIN + +long + MAX + +double + AVERAGE + +ListOfSyr + SYRLIST + + + +L_OneEven + + + + + + + + + + + + + + + + 28/6/2005 - 12:6:44 + 28/6/2005 - 12:6:44 + 1.05 + ? + ? + Compute Node + 564 + 219 + +? + ? + EndL_OneEven + 7 + label_test + +EndL_OneEven + + +long + MINT + +long + MAXT + +double + AVERAGET + + +long + MIN + +long + MAX + +double + AVERAGE + + + +? + + 28/6/2005 - 12:6:44 + 28/6/2005 - 12:6:44 + 1.05 + ? + ? + Compute Node + 1064 + 339 + +? + ? + 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 + + + 28/6/2005 - 12:6:44 + 28/6/2005 - 12:6:44 + 1.05 + ? + ? + Compute Node + 1058 + 8 + +? + ? + 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 + + + 28/6/2005 - 12:6:44 + 28/6/2005 - 12:6:44 + 1.05 + ? + ? + Compute Node + 1048 + 555 + + +test_ISEVEN + BoolEven + label_test + ValEven + + +544 + 256 + +544 + 524 + +test_ISONE + BoolOne + label_test + ValOne + + +546 + 237 + +546 + 198 + +m3p1 + anEvenInteger + control_m3p1 + N + + +975 + 38 + +976 + 81 + +div2 + anInteger + control_div2 + N + + +1012 + 585 + +1011 + 346 + +incr + aNewCount + control_div2 + K + + +966 + 606 + +968 + 207 + +incr + aNewCount + control_m3p1 + K + + +965 + 59 + +966 + 208 + +incr + aNewCount + C_AVERAGE + aCount + + +751 + 588 + +751 + 460 + +965 + 462 + +968 + 205 + +C_MIN + aNewMinVal + control_m3p1 + MINT + + +991 + 78 + +991 + 905 + +C_MIN + aNewMinVal + control_div2 + MINT + + +991 + 626 + +991 + 905 + +C_MAX + aNewMaxVal + control_m3p1 + MAXT + + +976 + 98 + +974 + 738 + +C_MAX + aNewMaxVal + control_div2 + MAXT + + +972 + 648 + +974 + 738 + +C_AVERAGE + aNewListOfSyr + control_m3p1 + SYRLISTT + + +1037 + 137 + +1038 + 556 + +C_AVERAGE + aNewListOfSyr + control_div2 + SYRLISTT + + +1038 + 686 + +1038 + 555 + +C_AVERAGE + anAverage + control_m3p1 + AVERAGET + + +1026 + 118 + +1027 + 567 + +C_AVERAGE + anAverage + control_div2 + AVERAGET + + +1027 + 668 + +1026 + 568 + +C_LISTOFSYR + aListOfSyr + label_begin + SYRLISTB + + +label_begin + NT + test_ISONE + anInteger + + +361 + 197 + +360 + 290 + +label_begin + NT + label_test + NT + + +label_begin + NT + test_ISEVEN + anInteger + + +359 + 525 + +361 + 291 + +label_begin + KT + label_test + KT + + +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 + Even + div2 + Gate + + +777 + 351 + +777 + 286 + +label_test + Odd + m3p1 + Gate + + +757 + 95 + +757 + 310 + +label_test + N + m3p1 + anOddInteger + + +741 + 72 + +741 + 331 + +label_test + N + div2 + anEvenInteger + + +label_test + N + C_MIN + anInteger + + +744 + 923 + +742 + 331 + +label_test + N + C_MAX + anInteger + + +742 + 759 + +743 + 332 + +label_test + N + C_AVERAGE + anInteger + + +741 + 568 + +742 + 330 + +label_test + K + incr + aCount + + +766 + 207 + +766 + 343 + +label_test + MIN + C_MIN + aMinVal + + +771 + 902 + +777 + 371 + +777 + 370 + +label_test + MAX + C_MAX + aMaxVal + + +764 + 739 + +762 + 390 + +label_test + SYRLIST + C_AVERAGE + aListOfSyr + + +769 + 546 + +769 + 431 + +768 + 431 + +768 + 430 + +label_test + Default + EndL_OneEven + Default + + +control_m3p1 + Gate + label_test + Gate + + +553 + 453 + +554 + 1025 + +1242 + 1026 + +1234 + 204 + +control_div2 + Gate + label_begin + Gate + + +176 + 419 + +176 + 997 + +1217 + 996 + +1223 + 711 + + +GraphSyrControlAveNOTValid + label_begin__NB + label_begin + NB + +3 + 31 + + +GraphSyrControlAveNOTValid + label_begin__KB + label_begin + KB + +3 + 0 + + +GraphSyrControlAveNOTValid + label_begin__MINB + label_begin + MINB + +3 + 0 + + +GraphSyrControlAveNOTValid + label_begin__MAXB + label_begin + MAXB + +3 + 0 + + +GraphSyrControlAveNOTValid + label_begin__AVERAGEB + label_begin + AVERAGEB + +7 + 0 + diff --git a/examples/GraphSyrControlAveValid.py b/examples/GraphSyrControlAveValid.py new file mode 100644 index 0000000..d388eb0 --- /dev/null +++ b/examples/GraphSyrControlAveValid.py @@ -0,0 +1,412 @@ + +# Generated python file of Graph GraphSyrControlAveValid + +from SuperV import * + +# Graph creation of GraphSyrControlAveValid +def DefGraphSyrControlAveValid() : + GraphSyrControlAveValid = Graph( 'GraphSyrControlAveValid' ) + GraphSyrControlAveValid.SetName( 'GraphSyrControlAveValid' ) + GraphSyrControlAveValid.SetAuthor( 'JR' ) + GraphSyrControlAveValid.SetComment( 'Syracuse algorithm' ) + GraphSyrControlAveValid.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + test_ISEVEN = GraphSyrControlAveValid.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( 370 , 455 ) + Itest_ISEVENanInteger = test_ISEVEN.GetInPort( 'anInteger' ) + Itest_ISEVENGate = test_ISEVEN.GetInPort( 'Gate' ) + Otest_ISEVENBoolEven = test_ISEVEN.GetOutPort( 'BoolEven' ) + Otest_ISEVENGate = test_ISEVEN.GetOutPort( 'Gate' ) + + test_ISONE = GraphSyrControlAveValid.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( 370 , 127 ) + Itest_ISONEanInteger = test_ISONE.GetInPort( 'anInteger' ) + Itest_ISONEGate = test_ISONE.GetInPort( 'Gate' ) + Otest_ISONEBoolOne = test_ISONE.GetOutPort( 'BoolOne' ) + Otest_ISONEGate = test_ISONE.GetOutPort( 'Gate' ) + + m3p1 = GraphSyrControlAveValid.FNode( 'SyrComponent' , 'SyrComponent' , 'C_M3P1' ) + m3p1.SetName( 'm3p1' ) + m3p1.SetAuthor( '' ) + m3p1.SetContainer( 'localhost/FactoryServer' ) + m3p1.SetComment( 'C_M3P1 from SyrComponent' ) + m3p1.Coords( 789 , 0 ) + Im3p1anOddInteger = m3p1.GetInPort( 'anOddInteger' ) + Im3p1Gate = m3p1.GetInPort( 'Gate' ) + Om3p1anEvenInteger = m3p1.GetOutPort( 'anEvenInteger' ) + Om3p1Gate = m3p1.GetOutPort( 'Gate' ) + + div2 = GraphSyrControlAveValid.FNode( 'SyrComponent' , 'SyrComponent' , 'C_DIV2' ) + div2.SetName( 'div2' ) + div2.SetAuthor( '' ) + div2.SetContainer( 'localhost/FactoryServer' ) + div2.SetComment( 'C_DIV2 from SyrComponent' ) + div2.Coords( 789 , 255 ) + Idiv2anEvenInteger = div2.GetInPort( 'anEvenInteger' ) + Idiv2Gate = div2.GetInPort( 'Gate' ) + Odiv2anInteger = div2.GetOutPort( 'anInteger' ) + Odiv2Gate = div2.GetOutPort( 'Gate' ) + + incr = GraphSyrControlAveValid.FNode( 'SyrComponent' , 'SyrComponent' , 'C_INCR' ) + incr.SetName( 'incr' ) + incr.SetAuthor( '' ) + incr.SetContainer( 'localhost/FactoryServer' ) + incr.SetComment( 'C_INCR from SyrComponent' ) + incr.Coords( 790 , 136 ) + IincraCount = incr.GetInPort( 'aCount' ) + IincrGate = incr.GetInPort( 'Gate' ) + OincraNewCount = incr.GetOutPort( 'aNewCount' ) + OincrGate = incr.GetOutPort( 'Gate' ) + + C_MIN = GraphSyrControlAveValid.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( 798 , 833 ) + IC_MINaMinVal = C_MIN.GetInPort( 'aMinVal' ) + IC_MINanInteger = C_MIN.GetInPort( 'anInteger' ) + IC_MINGate = C_MIN.GetInPort( 'Gate' ) + OC_MINaNewMinVal = C_MIN.GetOutPort( 'aNewMinVal' ) + OC_MINGate = C_MIN.GetOutPort( 'Gate' ) + + C_MAX = GraphSyrControlAveValid.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( 798 , 668 ) + IC_MAXaMaxVal = C_MAX.GetInPort( 'aMaxVal' ) + IC_MAXanInteger = C_MAX.GetInPort( 'anInteger' ) + IC_MAXGate = C_MAX.GetInPort( 'Gate' ) + OC_MAXaNewMaxVal = C_MAX.GetOutPort( 'aNewMaxVal' ) + OC_MAXGate = C_MAX.GetOutPort( 'Gate' ) + + C_AVERAGE = GraphSyrControlAveValid.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( 784 , 476 ) + IC_AVERAGEaListOfSyr = C_AVERAGE.GetInPort( 'aListOfSyr' ) + IC_AVERAGEanInteger = C_AVERAGE.GetInPort( 'anInteger' ) + IC_AVERAGEaCount = C_AVERAGE.GetInPort( 'aCount' ) + IC_AVERAGEGate = C_AVERAGE.GetInPort( 'Gate' ) + OC_AVERAGEaNewListOfSyr = C_AVERAGE.GetOutPort( 'aNewListOfSyr' ) + OC_AVERAGEanAverage = C_AVERAGE.GetOutPort( 'anAverage' ) + OC_AVERAGEGate = C_AVERAGE.GetOutPort( 'Gate' ) + + C_LISTOFSYR = GraphSyrControlAveValid.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( 5 , 321 ) + IC_LISTOFSYRGate = C_LISTOFSYR.GetInPort( 'Gate' ) + OC_LISTOFSYRaListOfSyr = C_LISTOFSYR.GetOutPort( 'aListOfSyr' ) + OC_LISTOFSYRGate = C_LISTOFSYR.GetOutPort( 'Gate' ) + + # 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 = GraphSyrControlAveValid.INode( 'label_begin' , Pylabel_begin ) + label_begin.SetName( 'label_begin' ) + label_begin.SetAuthor( '' ) + label_begin.SetComment( 'Python function' ) + label_begin.Coords( 183 , 220 ) + Ilabel_beginNB = label_begin.InPort( 'NB' , 'long' ) + Ilabel_beginKB = label_begin.InPort( 'KB' , 'long' ) + Ilabel_beginMINB = label_begin.InPort( 'MINB' , 'long' ) + Ilabel_beginMAXB = label_begin.InPort( 'MAXB' , 'long' ) + Ilabel_beginAVERAGEB = label_begin.InPort( 'AVERAGEB' , 'double' ) + Ilabel_beginSYRLISTB = label_begin.InPort( 'SYRLISTB' , 'ListOfSyr' ) + Ilabel_beginGate = label_begin.GetInPort( 'Gate' ) + Olabel_beginNT = label_begin.OutPort( 'NT' , 'long' ) + Olabel_beginKT = label_begin.OutPort( 'KT' , 'long' ) + Olabel_beginMIN = label_begin.OutPort( 'MIN' , 'long' ) + Olabel_beginMAX = label_begin.OutPort( 'MAX' , 'long' ) + Olabel_beginAVERAGE = label_begin.OutPort( 'AVERAGE' , 'double' ) + Olabel_beginSYRLIST = label_begin.OutPort( 'SYRLIST' , 'ListOfSyr' ) + Olabel_beginGate = label_begin.GetOutPort( 'Gate' ) + + # 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 = GraphSyrControlAveValid.SNode( 'L_OneEven' , Pylabel_test ) + EndL_OneEven.SetName( 'EndL_OneEven' ) + EndL_OneEven.SetAuthor( '' ) + EndL_OneEven.SetComment( 'Compute Node' ) + EndL_OneEven.Coords( 1064 , 339 ) + PyEndL_OneEven = [] + EndL_OneEven.SetPyFunction( '' , PyEndL_OneEven ) + IEndL_OneEvenMINT = EndL_OneEven.InPort( 'MINT' , 'long' ) + IEndL_OneEvenMAXT = EndL_OneEven.InPort( 'MAXT' , 'long' ) + IEndL_OneEvenAVERAGET = EndL_OneEven.InPort( 'AVERAGET' , 'double' ) + IEndL_OneEvenDefault = EndL_OneEven.GetInPort( 'Default' ) + OEndL_OneEvenMIN = EndL_OneEven.OutPort( 'MIN' , 'long' ) + OEndL_OneEvenMAX = EndL_OneEven.OutPort( 'MAX' , 'long' ) + OEndL_OneEvenAVERAGE = EndL_OneEven.OutPort( 'AVERAGE' , 'double' ) + OEndL_OneEvenGate = EndL_OneEven.GetOutPort( 'Gate' ) + label_test.SetName( 'label_test' ) + label_test.SetAuthor( '' ) + label_test.SetComment( 'Compute Node' ) + label_test.Coords( 564 , 219 ) + Ilabel_testValOne = label_test.InPort( 'ValOne' , 'long' ) + Ilabel_testValEven = label_test.InPort( 'ValEven' , 'long' ) + Ilabel_testNT = label_test.InPort( 'NT' , 'long' ) + Ilabel_testKT = label_test.InPort( 'KT' , 'long' ) + Ilabel_testMIN = label_test.InPort( 'MIN' , 'long' ) + Ilabel_testMAX = label_test.InPort( 'MAX' , 'long' ) + Ilabel_testAVERAGE = label_test.InPort( 'AVERAGE' , 'double' ) + Ilabel_testSYRLIST = label_test.InPort( 'SYRLIST' , 'ListOfSyr' ) + Ilabel_testGate = label_test.GetInPort( 'Gate' ) + Olabel_testFinished = label_test.OutPort( 'Finished' , 'long' ) + Olabel_testIncr = label_test.OutPort( 'Incr' , 'long' ) + Olabel_testEven = label_test.OutPort( 'Even' , 'long' ) + Olabel_testOdd = label_test.OutPort( 'Odd' , 'long' ) + Olabel_testN = label_test.OutPort( 'N' , 'long' ) + Olabel_testK = label_test.OutPort( 'K' , 'long' ) + Olabel_testMINT = label_test.OutPort( 'MINT' , 'long' ) + Olabel_testMAXT = label_test.OutPort( 'MAXT' , 'long' ) + Olabel_testAVERAGET = label_test.OutPort( 'AVERAGET' , 'double' ) + Olabel_testSYRLISTT = label_test.OutPort( 'SYRLISTT' , 'ListOfSyr' ) + Olabel_testDefault = label_test.GetOutPort( 'Default' ) + + # 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 = GraphSyrControlAveValid.GNode( 'C_NotOneIsEven' , Pycontrol_m3p1 , 'label_test' ) + control_m3p1.SetName( 'control_m3p1' ) + control_m3p1.SetAuthor( '' ) + control_m3p1.SetComment( 'Compute Node' ) + control_m3p1.Coords( 1058 , 8 ) + Icontrol_m3p1N = control_m3p1.InPort( 'N' , 'long' ) + Icontrol_m3p1K = control_m3p1.InPort( 'K' , 'long' ) + Icontrol_m3p1MINT = control_m3p1.InPort( 'MINT' , 'long' ) + Icontrol_m3p1MAXT = control_m3p1.InPort( 'MAXT' , 'long' ) + Icontrol_m3p1AVERAGET = control_m3p1.InPort( 'AVERAGET' , 'double' ) + Icontrol_m3p1SYRLISTT = control_m3p1.InPort( 'SYRLISTT' , 'ListOfSyr' ) + Icontrol_m3p1Gate = control_m3p1.GetInPort( 'Gate' ) + Ocontrol_m3p1ValOne = control_m3p1.OutPort( 'ValOne' , 'long' ) + Ocontrol_m3p1ValEven = control_m3p1.OutPort( 'ValEven' , 'long' ) + Ocontrol_m3p1NT = control_m3p1.OutPort( 'NT' , 'long' ) + Ocontrol_m3p1KT = control_m3p1.OutPort( 'KT' , 'long' ) + Ocontrol_m3p1MIN = control_m3p1.OutPort( 'MIN' , 'long' ) + Ocontrol_m3p1MAX = control_m3p1.OutPort( 'MAX' , 'long' ) + Ocontrol_m3p1AVERAGE = control_m3p1.OutPort( 'AVERAGE' , 'double' ) + Ocontrol_m3p1SYRLIST = control_m3p1.OutPort( 'SYRLIST' , 'ListOfSyr' ) + Ocontrol_m3p1Gate = control_m3p1.GetOutPort( 'Gate' ) + + 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 = GraphSyrControlAveValid.GNode( 'control_div2' , Pycontrol_div2 , 'label_begin' ) + control_div2.SetName( 'control_div2' ) + control_div2.SetAuthor( '' ) + control_div2.SetComment( 'Compute Node' ) + control_div2.Coords( 1048 , 555 ) + Icontrol_div2N = control_div2.InPort( 'N' , 'long' ) + Icontrol_div2K = control_div2.InPort( 'K' , 'long' ) + Icontrol_div2MINT = control_div2.InPort( 'MINT' , 'long' ) + Icontrol_div2MAXT = control_div2.InPort( 'MAXT' , 'long' ) + Icontrol_div2AVERAGET = control_div2.InPort( 'AVERAGET' , 'double' ) + Icontrol_div2SYRLISTT = control_div2.InPort( 'SYRLISTT' , 'ListOfSyr' ) + Icontrol_div2Gate = control_div2.GetInPort( 'Gate' ) + Ocontrol_div2NB = control_div2.OutPort( 'NB' , 'long' ) + Ocontrol_div2KB = control_div2.OutPort( 'KB' , 'long' ) + Ocontrol_div2MINB = control_div2.OutPort( 'MINB' , 'long' ) + Ocontrol_div2MAXB = control_div2.OutPort( 'MAXB' , 'long' ) + Ocontrol_div2AVERAGEB = control_div2.OutPort( 'AVERAGEB' , 'double' ) + Ocontrol_div2SYRLISTB = control_div2.OutPort( 'SYRLISTB' , 'ListOfSyr' ) + Ocontrol_div2Gate = control_div2.GetOutPort( 'Gate' ) + + # Creation of Links + Ltest_ISEVENBoolEvenlabel_testValEven = GraphSyrControlAveValid.Link( Otest_ISEVENBoolEven , Ilabel_testValEven ) + Ltest_ISEVENBoolEvenlabel_testValEven.AddCoord( 1 , 544 , 256 ) + Ltest_ISEVENBoolEvenlabel_testValEven.AddCoord( 2 , 544 , 524 ) + + Ltest_ISONEBoolOnelabel_testValOne = GraphSyrControlAveValid.Link( Otest_ISONEBoolOne , Ilabel_testValOne ) + Ltest_ISONEBoolOnelabel_testValOne.AddCoord( 1 , 546 , 237 ) + Ltest_ISONEBoolOnelabel_testValOne.AddCoord( 2 , 546 , 198 ) + + Lm3p1anEvenIntegercontrol_m3p1N = GraphSyrControlAveValid.Link( Om3p1anEvenInteger , Icontrol_m3p1N ) + Lm3p1anEvenIntegercontrol_m3p1N.AddCoord( 1 , 975 , 38 ) + Lm3p1anEvenIntegercontrol_m3p1N.AddCoord( 2 , 976 , 81 ) + + Ldiv2anIntegercontrol_div2N = GraphSyrControlAveValid.Link( Odiv2anInteger , Icontrol_div2N ) + Ldiv2anIntegercontrol_div2N.AddCoord( 1 , 1012 , 585 ) + Ldiv2anIntegercontrol_div2N.AddCoord( 2 , 1011 , 346 ) + + LincraNewCountcontrol_div2K = GraphSyrControlAveValid.Link( OincraNewCount , Icontrol_div2K ) + LincraNewCountcontrol_div2K.AddCoord( 1 , 966 , 606 ) + LincraNewCountcontrol_div2K.AddCoord( 2 , 968 , 207 ) + + LincraNewCountcontrol_m3p1K = GraphSyrControlAveValid.Link( OincraNewCount , Icontrol_m3p1K ) + LincraNewCountcontrol_m3p1K.AddCoord( 1 , 965 , 59 ) + LincraNewCountcontrol_m3p1K.AddCoord( 2 , 966 , 208 ) + + LincraNewCountC_AVERAGEaCount = GraphSyrControlAveValid.Link( OincraNewCount , IC_AVERAGEaCount ) + LincraNewCountC_AVERAGEaCount.AddCoord( 1 , 751 , 588 ) + LincraNewCountC_AVERAGEaCount.AddCoord( 2 , 751 , 460 ) + LincraNewCountC_AVERAGEaCount.AddCoord( 3 , 965 , 462 ) + LincraNewCountC_AVERAGEaCount.AddCoord( 4 , 968 , 205 ) + + LC_MINaNewMinValcontrol_m3p1MINT = GraphSyrControlAveValid.Link( OC_MINaNewMinVal , Icontrol_m3p1MINT ) + LC_MINaNewMinValcontrol_m3p1MINT.AddCoord( 1 , 991 , 78 ) + LC_MINaNewMinValcontrol_m3p1MINT.AddCoord( 2 , 991 , 905 ) + + LC_MINaNewMinValcontrol_div2MINT = GraphSyrControlAveValid.Link( OC_MINaNewMinVal , Icontrol_div2MINT ) + LC_MINaNewMinValcontrol_div2MINT.AddCoord( 1 , 991 , 626 ) + LC_MINaNewMinValcontrol_div2MINT.AddCoord( 2 , 991 , 905 ) + + LC_MAXaNewMaxValcontrol_m3p1MAXT = GraphSyrControlAveValid.Link( OC_MAXaNewMaxVal , Icontrol_m3p1MAXT ) + LC_MAXaNewMaxValcontrol_m3p1MAXT.AddCoord( 1 , 976 , 98 ) + LC_MAXaNewMaxValcontrol_m3p1MAXT.AddCoord( 2 , 974 , 738 ) + + LC_MAXaNewMaxValcontrol_div2MAXT = GraphSyrControlAveValid.Link( OC_MAXaNewMaxVal , Icontrol_div2MAXT ) + LC_MAXaNewMaxValcontrol_div2MAXT.AddCoord( 1 , 972 , 648 ) + LC_MAXaNewMaxValcontrol_div2MAXT.AddCoord( 2 , 974 , 738 ) + + LC_AVERAGEaNewListOfSyrcontrol_m3p1SYRLISTT = GraphSyrControlAveValid.Link( OC_AVERAGEaNewListOfSyr , Icontrol_m3p1SYRLISTT ) + LC_AVERAGEaNewListOfSyrcontrol_m3p1SYRLISTT.AddCoord( 1 , 1037 , 137 ) + LC_AVERAGEaNewListOfSyrcontrol_m3p1SYRLISTT.AddCoord( 2 , 1038 , 556 ) + + LC_AVERAGEaNewListOfSyrcontrol_div2SYRLISTT = GraphSyrControlAveValid.Link( OC_AVERAGEaNewListOfSyr , Icontrol_div2SYRLISTT ) + LC_AVERAGEaNewListOfSyrcontrol_div2SYRLISTT.AddCoord( 1 , 1038 , 686 ) + LC_AVERAGEaNewListOfSyrcontrol_div2SYRLISTT.AddCoord( 2 , 1038 , 555 ) + + LC_AVERAGEanAveragecontrol_m3p1AVERAGET = GraphSyrControlAveValid.Link( OC_AVERAGEanAverage , Icontrol_m3p1AVERAGET ) + LC_AVERAGEanAveragecontrol_m3p1AVERAGET.AddCoord( 1 , 1026 , 118 ) + LC_AVERAGEanAveragecontrol_m3p1AVERAGET.AddCoord( 2 , 1027 , 567 ) + + LC_AVERAGEanAveragecontrol_div2AVERAGET = GraphSyrControlAveValid.Link( OC_AVERAGEanAverage , Icontrol_div2AVERAGET ) + LC_AVERAGEanAveragecontrol_div2AVERAGET.AddCoord( 1 , 1027 , 668 ) + LC_AVERAGEanAveragecontrol_div2AVERAGET.AddCoord( 2 , 1026 , 568 ) + + LC_LISTOFSYRaListOfSyrlabel_beginSYRLISTB = GraphSyrControlAveValid.Link( OC_LISTOFSYRaListOfSyr , Ilabel_beginSYRLISTB ) + + Llabel_beginNTtest_ISONEanInteger = GraphSyrControlAveValid.Link( Olabel_beginNT , Itest_ISONEanInteger ) + Llabel_beginNTtest_ISONEanInteger.AddCoord( 1 , 361 , 197 ) + Llabel_beginNTtest_ISONEanInteger.AddCoord( 2 , 360 , 290 ) + + Llabel_beginNTlabel_testNT = GraphSyrControlAveValid.Link( Olabel_beginNT , Ilabel_testNT ) + + Llabel_beginNTtest_ISEVENanInteger = GraphSyrControlAveValid.Link( Olabel_beginNT , Itest_ISEVENanInteger ) + Llabel_beginNTtest_ISEVENanInteger.AddCoord( 1 , 359 , 525 ) + Llabel_beginNTtest_ISEVENanInteger.AddCoord( 2 , 361 , 291 ) + + Llabel_beginKTlabel_testKT = GraphSyrControlAveValid.Link( Olabel_beginKT , Ilabel_testKT ) + + Llabel_beginMINlabel_testMIN = GraphSyrControlAveValid.Link( Olabel_beginMIN , Ilabel_testMIN ) + + Llabel_beginMAXlabel_testMAX = GraphSyrControlAveValid.Link( Olabel_beginMAX , Ilabel_testMAX ) + + Llabel_beginAVERAGElabel_testAVERAGE = GraphSyrControlAveValid.Link( Olabel_beginAVERAGE , Ilabel_testAVERAGE ) + + Llabel_beginSYRLISTlabel_testSYRLIST = GraphSyrControlAveValid.Link( Olabel_beginSYRLIST , Ilabel_testSYRLIST ) + + Llabel_testEvendiv2Gate = GraphSyrControlAveValid.Link( Olabel_testEven , Idiv2Gate ) + Llabel_testEvendiv2Gate.AddCoord( 1 , 777 , 351 ) + Llabel_testEvendiv2Gate.AddCoord( 2 , 777 , 286 ) + + Llabel_testOddm3p1Gate = GraphSyrControlAveValid.Link( Olabel_testOdd , Im3p1Gate ) + Llabel_testOddm3p1Gate.AddCoord( 1 , 757 , 95 ) + Llabel_testOddm3p1Gate.AddCoord( 2 , 757 , 310 ) + + Llabel_testNm3p1anOddInteger = GraphSyrControlAveValid.Link( Olabel_testN , Im3p1anOddInteger ) + Llabel_testNm3p1anOddInteger.AddCoord( 1 , 741 , 72 ) + Llabel_testNm3p1anOddInteger.AddCoord( 2 , 741 , 331 ) + + Llabel_testNdiv2anEvenInteger = GraphSyrControlAveValid.Link( Olabel_testN , Idiv2anEvenInteger ) + + Llabel_testNC_MINanInteger = GraphSyrControlAveValid.Link( Olabel_testN , IC_MINanInteger ) + Llabel_testNC_MINanInteger.AddCoord( 1 , 744 , 923 ) + Llabel_testNC_MINanInteger.AddCoord( 2 , 742 , 331 ) + + Llabel_testNC_MAXanInteger = GraphSyrControlAveValid.Link( Olabel_testN , IC_MAXanInteger ) + Llabel_testNC_MAXanInteger.AddCoord( 1 , 742 , 759 ) + Llabel_testNC_MAXanInteger.AddCoord( 2 , 743 , 332 ) + + Llabel_testNC_AVERAGEanInteger = GraphSyrControlAveValid.Link( Olabel_testN , IC_AVERAGEanInteger ) + Llabel_testNC_AVERAGEanInteger.AddCoord( 1 , 741 , 568 ) + Llabel_testNC_AVERAGEanInteger.AddCoord( 2 , 742 , 330 ) + + Llabel_testKincraCount = GraphSyrControlAveValid.Link( Olabel_testK , IincraCount ) + Llabel_testKincraCount.AddCoord( 1 , 766 , 207 ) + Llabel_testKincraCount.AddCoord( 2 , 766 , 343 ) + + Llabel_testMINTC_MINaMinVal = GraphSyrControlAveValid.Link( Olabel_testMINT , IC_MINaMinVal ) + Llabel_testMINTC_MINaMinVal.AddCoord( 1 , 760 , 904 ) + Llabel_testMINTC_MINaMinVal.AddCoord( 2 , 756 , 372 ) + + Llabel_testMINTEndL_OneEvenMINT = GraphSyrControlAveValid.Link( Olabel_testMINT , IEndL_OneEvenMINT ) + + Llabel_testMAXTC_MAXaMaxVal = GraphSyrControlAveValid.Link( Olabel_testMAXT , IC_MAXaMaxVal ) + Llabel_testMAXTC_MAXaMaxVal.AddCoord( 1 , 765 , 742 ) + Llabel_testMAXTC_MAXaMaxVal.AddCoord( 2 , 766 , 384 ) + + Llabel_testMAXTEndL_OneEvenMAXT = GraphSyrControlAveValid.Link( Olabel_testMAXT , IEndL_OneEvenMAXT ) + + Llabel_testAVERAGETEndL_OneEvenAVERAGET = GraphSyrControlAveValid.Link( Olabel_testAVERAGET , IEndL_OneEvenAVERAGET ) + + Llabel_testSYRLISTTC_AVERAGEaListOfSyr = GraphSyrControlAveValid.Link( Olabel_testSYRLISTT , IC_AVERAGEaListOfSyr ) + Llabel_testSYRLISTTC_AVERAGEaListOfSyr.AddCoord( 1 , 773 , 546 ) + Llabel_testSYRLISTTC_AVERAGEaListOfSyr.AddCoord( 2 , 772 , 424 ) + + Llabel_testDefaultEndL_OneEvenDefault = GraphSyrControlAveValid.Link( Olabel_testDefault , IEndL_OneEvenDefault ) + + Lcontrol_m3p1Gatelabel_testGate = GraphSyrControlAveValid.Link( Ocontrol_m3p1Gate , Ilabel_testGate ) + Lcontrol_m3p1Gatelabel_testGate.AddCoord( 1 , 553 , 453 ) + Lcontrol_m3p1Gatelabel_testGate.AddCoord( 2 , 554 , 1025 ) + Lcontrol_m3p1Gatelabel_testGate.AddCoord( 3 , 1242 , 1026 ) + Lcontrol_m3p1Gatelabel_testGate.AddCoord( 4 , 1234 , 204 ) + + Lcontrol_div2Gatelabel_beginGate = GraphSyrControlAveValid.Link( Ocontrol_div2Gate , Ilabel_beginGate ) + Lcontrol_div2Gatelabel_beginGate.AddCoord( 1 , 176 , 419 ) + Lcontrol_div2Gatelabel_beginGate.AddCoord( 2 , 176 , 997 ) + Lcontrol_div2Gatelabel_beginGate.AddCoord( 3 , 1217 , 996 ) + Lcontrol_div2Gatelabel_beginGate.AddCoord( 4 , 1223 , 711 ) + + # Input datas + Ilabel_beginNB.Input( 31 ) + Ilabel_beginKB.Input( 0 ) + Ilabel_beginMINB.Input( 0 ) + Ilabel_beginMAXB.Input( 0 ) + Ilabel_beginAVERAGEB.Input( 0 ) + + # Output Ports of the graph + #Olabel_testFinished = label_test.GetOutPort( 'Finished' ) + #Olabel_testIncr = label_test.GetOutPort( 'Incr' ) + #OEndL_OneEvenMIN = EndL_OneEven.GetOutPort( 'MIN' ) + #OEndL_OneEvenMAX = EndL_OneEven.GetOutPort( 'MAX' ) + #OEndL_OneEvenAVERAGE = EndL_OneEven.GetOutPort( 'AVERAGE' ) + return GraphSyrControlAveValid + + +GraphSyrControlAveValid = DefGraphSyrControlAveValid() diff --git a/examples/GraphSyrControlAveValid.xml b/examples/GraphSyrControlAveValid.xml new file mode 100644 index 0000000..80536df --- /dev/null +++ b/examples/GraphSyrControlAveValid.xml @@ -0,0 +1,1104 @@ + + + + + +? + ? + GraphSyrControlAveValid + 1 + ? + +GraphSyrControlAveValid + + +long + label_begin__NB + +long + label_begin__KB + +long + label_begin__MINB + +long + label_begin__MAXB + +double + label_begin__AVERAGEB + + +long + label_test__Finished + +long + label_test__Incr + +long + EndL_OneEven__MIN + +long + EndL_OneEven__MAX + +double + EndL_OneEven__AVERAGE + + + 2/10/2003 - 11:17:14 + 28/6/2005 - 14:10:50 + 1.05 + JR + ? + Syracuse algorithm + 0 + 0 + + +SyrComponent + SyrComponent + test_ISEVEN + 0 + ? + +C_ISEVEN + + +long + anInteger + + +long + BoolEven + + + 28/6/2005 - 14:8:24 + 28/6/2005 - 14:8:24 + 1.05 + ? + localhost/FactoryServer + C_ISEVEN from SyrComponent + 370 + 455 + +SyrComponent + SyrComponent + test_ISONE + 0 + ? + +C_ISONE + + +long + anInteger + + +long + BoolOne + + + 28/6/2005 - 14:8:24 + 28/6/2005 - 14:8:24 + 1.05 + ? + localhost/FactoryServer + C_ISONE from SyrComponent + 370 + 127 + +SyrComponent + SyrComponent + m3p1 + 0 + ? + +C_M3P1 + + +long + anOddInteger + + +long + anEvenInteger + + + 28/6/2005 - 14:8:24 + 28/6/2005 - 14:8:24 + 1.05 + ? + localhost/FactoryServer + C_M3P1 from SyrComponent + 789 + 0 + +SyrComponent + SyrComponent + div2 + 0 + ? + +C_DIV2 + + +long + anEvenInteger + + +long + anInteger + + + 28/6/2005 - 14:8:24 + 28/6/2005 - 14:8:24 + 1.05 + ? + localhost/FactoryServer + C_DIV2 from SyrComponent + 789 + 255 + +SyrComponent + SyrComponent + incr + 0 + ? + +C_INCR + + +long + aCount + + +long + aNewCount + + + 28/6/2005 - 14:8:24 + 28/6/2005 - 14:8:24 + 1.05 + ? + localhost/FactoryServer + C_INCR from SyrComponent + 790 + 136 + +SyrComponent + SyrComponent + C_MIN + 0 + ? + +C_MIN + + +long + aMinVal + +long + anInteger + + +long + aNewMinVal + + + 28/6/2005 - 14:8:24 + 28/6/2005 - 14:8:24 + 1.05 + ? + localhost/FactoryServer + C_MIN from SyrComponent + 798 + 833 + +SyrComponent + SyrComponent + C_MAX + 0 + ? + +C_MAX + + +long + aMaxVal + +long + anInteger + + +long + aNewMaxVal + + + 28/6/2005 - 14:8:24 + 28/6/2005 - 14:8:24 + 1.05 + ? + localhost/FactoryServer + C_MAX from SyrComponent + 798 + 668 + +SyrComponent + SyrComponent + C_AVERAGE + 0 + ? + +C_AVERAGE + + +ListOfSyr + aListOfSyr + +long + anInteger + +long + aCount + + +ListOfSyr + aNewListOfSyr + +double + anAverage + + + 28/6/2005 - 14:8:24 + 28/6/2005 - 14:8:24 + 1.05 + ? + localhost/FactoryServer + C_AVERAGE from SyrComponent + 784 + 476 + +SyrComponent + SyrComponent + C_LISTOFSYR + 0 + ? + +C_LISTOFSYR + + + +ListOfSyr + aListOfSyr + + + 28/6/2005 - 14:8:24 + 28/6/2005 - 14:8:24 + 1.05 + ? + localhost/FactoryServer + C_LISTOFSYR from SyrComponent + 5 + 321 + +? + ? + 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 + + + 28/6/2005 - 14:8:24 + 28/6/2005 - 14:8:24 + 1.05 + ? + ? + Python function + 183 + 220 + +? + ? + 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 + + + + + + + + + + + + + + + + 28/6/2005 - 14:8:24 + 28/6/2005 - 14:8:24 + 1.05 + ? + ? + Compute Node + 564 + 219 + +? + ? + EndL_OneEven + 7 + label_test + +EndL_OneEven + + +long + MINT + +long + MAXT + +double + AVERAGET + + +long + MIN + +long + MAX + +double + AVERAGE + + + +? + + 28/6/2005 - 14:8:24 + 28/6/2005 - 14:8:24 + 1.05 + ? + ? + Compute Node + 1064 + 339 + +? + ? + 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 + + + 28/6/2005 - 14:8:24 + 28/6/2005 - 14:8:24 + 1.05 + ? + ? + Compute Node + 1058 + 8 + +? + ? + 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 + + + 28/6/2005 - 14:8:24 + 28/6/2005 - 14:8:24 + 1.05 + ? + ? + Compute Node + 1048 + 555 + + +test_ISEVEN + BoolEven + label_test + ValEven + + +544 + 256 + +544 + 524 + +test_ISONE + BoolOne + label_test + ValOne + + +546 + 237 + +546 + 198 + +m3p1 + anEvenInteger + control_m3p1 + N + + +975 + 38 + +976 + 81 + +div2 + anInteger + control_div2 + N + + +1012 + 585 + +1011 + 346 + +incr + aNewCount + control_div2 + K + + +966 + 606 + +968 + 207 + +incr + aNewCount + control_m3p1 + K + + +965 + 59 + +966 + 208 + +incr + aNewCount + C_AVERAGE + aCount + + +751 + 588 + +751 + 460 + +965 + 462 + +968 + 205 + +C_MIN + aNewMinVal + control_m3p1 + MINT + + +991 + 78 + +991 + 905 + +C_MIN + aNewMinVal + control_div2 + MINT + + +991 + 626 + +991 + 905 + +C_MAX + aNewMaxVal + control_m3p1 + MAXT + + +976 + 98 + +974 + 738 + +C_MAX + aNewMaxVal + control_div2 + MAXT + + +972 + 648 + +974 + 738 + +C_AVERAGE + aNewListOfSyr + control_m3p1 + SYRLISTT + + +1037 + 137 + +1038 + 556 + +C_AVERAGE + aNewListOfSyr + control_div2 + SYRLISTT + + +1038 + 686 + +1038 + 555 + +C_AVERAGE + anAverage + control_m3p1 + AVERAGET + + +1026 + 118 + +1027 + 567 + +C_AVERAGE + anAverage + control_div2 + AVERAGET + + +1027 + 668 + +1026 + 568 + +C_LISTOFSYR + aListOfSyr + label_begin + SYRLISTB + + +label_begin + NT + test_ISONE + anInteger + + +361 + 197 + +360 + 290 + +label_begin + NT + label_test + NT + + +label_begin + NT + test_ISEVEN + anInteger + + +359 + 525 + +361 + 291 + +label_begin + KT + label_test + KT + + +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 + Even + div2 + Gate + + +777 + 351 + +777 + 286 + +label_test + Odd + m3p1 + Gate + + +757 + 95 + +757 + 310 + +label_test + N + m3p1 + anOddInteger + + +741 + 72 + +741 + 331 + +label_test + N + div2 + anEvenInteger + + +label_test + N + C_MIN + anInteger + + +744 + 923 + +742 + 331 + +label_test + N + C_MAX + anInteger + + +742 + 759 + +743 + 332 + +label_test + N + C_AVERAGE + anInteger + + +741 + 568 + +742 + 330 + +label_test + K + incr + aCount + + +766 + 207 + +766 + 343 + +label_test + MINT + C_MIN + aMinVal + + +760 + 904 + +756 + 372 + +label_test + MINT + EndL_OneEven + MINT + + +label_test + MAXT + C_MAX + aMaxVal + + +765 + 742 + +766 + 384 + +label_test + MAXT + EndL_OneEven + MAXT + + +label_test + AVERAGET + EndL_OneEven + AVERAGET + + +label_test + SYRLISTT + C_AVERAGE + aListOfSyr + + +773 + 546 + +772 + 424 + +label_test + Default + EndL_OneEven + Default + + +control_m3p1 + Gate + label_test + Gate + + +553 + 453 + +554 + 1025 + +1242 + 1026 + +1234 + 204 + +control_div2 + Gate + label_begin + Gate + + +176 + 419 + +176 + 997 + +1217 + 996 + +1223 + 711 + + +GraphSyrControlAveValid + label_begin__NB + label_begin + NB + +3 + 31 + + +GraphSyrControlAveValid + label_begin__KB + label_begin + KB + +3 + 0 + + +GraphSyrControlAveValid + label_begin__MINB + label_begin + MINB + +3 + 0 + + +GraphSyrControlAveValid + label_begin__MAXB + label_begin + MAXB + +3 + 0 + + +GraphSyrControlAveValid + label_begin__AVERAGEB + label_begin + AVERAGEB + +7 + 0 + diff --git a/examples/GraphTwoLoops1.py b/examples/GraphTwoLoops1.py new file mode 100644 index 0000000..dc71c5f --- /dev/null +++ b/examples/GraphTwoLoops1.py @@ -0,0 +1,133 @@ + +# Generated python file of Graph GraphTwoLoops1 + +from SuperV import * + +# Graph creation of GraphTwoLoops1 +def DefGraphTwoLoops1() : + GraphTwoLoops1 = Graph( 'GraphTwoLoops1' ) + GraphTwoLoops1.SetName( 'GraphTwoLoops1' ) + GraphTwoLoops1.SetAuthor( 'JR' ) + GraphTwoLoops1.SetComment( '' ) + GraphTwoLoops1.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of Loop Nodes + PyLoop1 = [] + PyLoop1.append( 'def Loop1(Index,Max) : ' ) + PyLoop1.append( ' return Index,Max ' ) + PyLoop1.append( '' ) + PyMoreLoop1 = [] + PyMoreLoop1.append( 'import time ' ) + PyMoreLoop1.append( 'def More(Index,Max) : ' ) + PyMoreLoop1.append( ' time.sleep(2) ' ) + PyMoreLoop1.append( ' DoLoop = 0 ' ) + PyMoreLoop1.append( ' if Index < Max : ' ) + PyMoreLoop1.append( ' DoLoop = 1 ' ) + PyMoreLoop1.append( ' return DoLoop,Index,Max ' ) + PyMoreLoop1.append( '' ) + PyNextLoop1 = [] + PyNextLoop1.append( 'def Next(Index,Max) : ' ) + PyNextLoop1.append( ' Index = Index + 1 ' ) + PyNextLoop1.append( ' return Index,Max ' ) + PyNextLoop1.append( '' ) + Loop1,EndLoop1 = GraphTwoLoops1.LNode( 'Loop1' , PyLoop1 , 'More' , PyMoreLoop1 , 'Next' , PyNextLoop1 ) + EndLoop1.SetName( 'EndLoop1' ) + EndLoop1.SetAuthor( '' ) + EndLoop1.SetComment( 'Compute Node' ) + EndLoop1.Coords( 634 , 177 ) + PyEndLoop1 = [] + EndLoop1.SetPyFunction( 'EndLoop1' , PyEndLoop1 ) + ILoop1DoLoop = Loop1.GetInPort( 'DoLoop' ) + ILoop1Index = Loop1.InPort( 'Index' , 'long' ) + ILoop1Max = Loop1.InPort( 'Max' , 'long' ) + ILoop1Gate = Loop1.GetInPort( 'Gate' ) + OLoop1DoLoop = Loop1.GetOutPort( 'DoLoop' ) + OLoop1Index = Loop1.GetOutPort( 'Index' ) + OLoop1Max = Loop1.GetOutPort( 'Max' ) + IEndLoop1DoLoop = EndLoop1.GetInPort( 'DoLoop' ) + IEndLoop1Index = EndLoop1.GetInPort( 'Index' ) + IEndLoop1Max = EndLoop1.GetInPort( 'Max' ) + IEndLoop1Gate = EndLoop1.GetInPort( 'Gate' ) + OEndLoop1DoLoop = EndLoop1.GetOutPort( 'DoLoop' ) + OEndLoop1Index = EndLoop1.GetOutPort( 'Index' ) + OEndLoop1Max = EndLoop1.GetOutPort( 'Max' ) + OEndLoop1Gate = EndLoop1.GetOutPort( 'Gate' ) + Loop1.SetName( 'Loop1' ) + Loop1.SetAuthor( '' ) + Loop1.SetComment( 'Compute Node' ) + Loop1.Coords( 7 , 175 ) + + PyLoop = [] + PyMoreLoop = [] + PyMoreLoop.append( '' ) + PyNextLoop = [] + PyNextLoop.append( 'def Next(Index,Max) : ' ) + PyNextLoop.append( ' Index = Index + 1 ' ) + PyNextLoop.append( ' return Index,Max ' ) + PyNextLoop.append( '' ) + Loop,EndLoop = GraphTwoLoops1.LNode( '' , PyLoop , '' , PyMoreLoop , 'Next' , PyNextLoop ) + EndLoop.SetName( 'EndLoop' ) + EndLoop.SetAuthor( '' ) + EndLoop.SetComment( 'Compute Node' ) + EndLoop.Coords( 426 , 180 ) + PyEndLoop = [] + PyEndLoop.append( 'import time ' ) + PyEndLoop.append( 'def EndLoop(DoLoop,Index,Max) : ' ) + PyEndLoop.append( ' time.sleep(1) ' ) + PyEndLoop.append( ' DoLoop = 0 ' ) + PyEndLoop.append( ' if Index < Max : ' ) + PyEndLoop.append( ' DoLoop = 1 ' ) + PyEndLoop.append( ' return DoLoop,Index,Max ' ) + PyEndLoop.append( '' ) + EndLoop.SetPyFunction( 'EndLoop' , PyEndLoop ) + ILoopDoLoop = Loop.GetInPort( 'DoLoop' ) + ILoopIndex = Loop.InPort( 'Index' , 'long' ) + ILoopMax = Loop.InPort( 'Max' , 'long' ) + ILoopGate = Loop.GetInPort( 'Gate' ) + OLoopDoLoop = Loop.GetOutPort( 'DoLoop' ) + OLoopIndex = Loop.GetOutPort( 'Index' ) + OLoopMax = Loop.GetOutPort( 'Max' ) + IEndLoopDoLoop = EndLoop.GetInPort( 'DoLoop' ) + IEndLoopIndex = EndLoop.GetInPort( 'Index' ) + IEndLoopMax = EndLoop.GetInPort( 'Max' ) + IEndLoopGate = EndLoop.GetInPort( 'Gate' ) + OEndLoopDoLoop = EndLoop.GetOutPort( 'DoLoop' ) + OEndLoopIndex = EndLoop.GetOutPort( 'Index' ) + OEndLoopMax = EndLoop.GetOutPort( 'Max' ) + OEndLoopGate = EndLoop.GetOutPort( 'Gate' ) + Loop.SetName( 'Loop' ) + Loop.SetAuthor( '' ) + Loop.SetComment( 'Compute Node' ) + Loop.Coords( 208 , 179 ) + + # Creation of Links + LLoop1IndexEndLoop1Index = GraphTwoLoops1.Link( OLoop1Index , IEndLoop1Index ) + + LLoop1IndexLoopIndex = GraphTwoLoops1.Link( OLoop1Index , ILoopIndex ) + + LLoop1MaxEndLoop1Max = GraphTwoLoops1.Link( OLoop1Max , IEndLoop1Max ) + + LLoop1GateLoopGate = GraphTwoLoops1.Link( OLoop1Gate , ILoopGate ) + + LLoopIndexEndLoopIndex = GraphTwoLoops1.Link( OLoopIndex , IEndLoopIndex ) + + LLoopMaxEndLoopMax = GraphTwoLoops1.Link( OLoopMax , IEndLoopMax ) + + LEndLoopGateEndLoop1Gate = GraphTwoLoops1.Link( OEndLoopGate , IEndLoop1Gate ) + + # Input datas + ILoop1Index.Input( 5 ) + ILoop1Max.Input( 15 ) + ILoopMax.Input( 20 ) + + # Output Ports of the graph + #OEndLoop1Index = EndLoop1.GetOutPort( 'Index' ) + #OEndLoop1Max = EndLoop1.GetOutPort( 'Max' ) + #OEndLoopIndex = EndLoop.GetOutPort( 'Index' ) + #OEndLoopMax = EndLoop.GetOutPort( 'Max' ) + return GraphTwoLoops1 + + +GraphTwoLoops1 = DefGraphTwoLoops1() diff --git a/examples/GraphTwoLoops1.xml b/examples/GraphTwoLoops1.xml new file mode 100644 index 0000000..80212e5 --- /dev/null +++ b/examples/GraphTwoLoops1.xml @@ -0,0 +1,315 @@ + + + + + +? + ? + GraphTwoLoops1 + 1 + ? + +GraphTwoLoops1 + + +long + Loop1__Index + +long + Loop1__Max + +long + Loop__Max + + +long + EndLoop1__Index + +long + EndLoop1__Max + +long + EndLoop__Index + +long + EndLoop__Max + + + 17/12/2004 - 11:3:21 + 8/7/2005 - 15:57:18 + 2.0 + JR + ? + ? + 0 + 0 + + +? + ? + Loop1 + 4 + EndLoop1 + +Loop1 + + +long + Index + +long + Max + + +long + Index + +long + Max + + + +Loop1 + + + + +More + + + + + + + + + +Next + + + + + 8/7/2005 - 15:51:35 + 8/7/2005 - 15:51:35 + 2.0 + ? + ? + Compute Node + 7 + 175 + +? + ? + EndLoop1 + 5 + Loop1 + +EndLoop1 + + +long + Index + +long + Max + + +long + Index + +long + Max + + + +EndLoop1 + + 8/7/2005 - 15:51:35 + 8/7/2005 - 15:51:35 + 2.0 + ? + ? + Compute Node + 634 + 177 + +? + ? + Loop + 4 + EndLoop + +Loop + + +long + Index + +long + Max + + +long + Index + +long + Max + + + +? + + +? + + +Next + + + + + 8/7/2005 - 15:51:35 + 8/7/2005 - 15:51:35 + 2.0 + ? + ? + Compute Node + 208 + 179 + +? + ? + EndLoop + 5 + Loop + +EndLoop + + +long + Index + +long + Max + + +long + Index + +long + Max + + + +EndLoop + + + + + + + + + 8/7/2005 - 15:51:35 + 8/7/2005 - 15:51:35 + 2.0 + ? + ? + Compute Node + 426 + 180 + + +Loop1 + DoLoop + EndLoop1 + DoLoop + + +Loop1 + Index + EndLoop1 + Index + + +Loop1 + Index + Loop + Index + + +Loop1 + Max + EndLoop1 + Max + + +Loop1 + Gate + Loop + Gate + + +EndLoop1 + DoLoop + Loop1 + DoLoop + + +Loop + DoLoop + EndLoop + DoLoop + + +Loop + Index + EndLoop + Index + + +Loop + Max + EndLoop + Max + + +EndLoop + DoLoop + Loop + DoLoop + + +EndLoop + Gate + EndLoop1 + Gate + + + +GraphTwoLoops1 + Loop1__Index + Loop1 + Index + +3 + 5 + + +GraphTwoLoops1 + Loop1__Max + Loop1 + Max + +3 + 15 + + +GraphTwoLoops1 + Loop__Max + Loop + Max + +3 + 20 + diff --git a/examples/GraphUnValid.py b/examples/GraphUnValid.py index c773582..a2164ae 100755 --- a/examples/GraphUnValid.py +++ b/examples/GraphUnValid.py @@ -1,94 +1,102 @@ -# Generated python file of Graph GraphEssai +# Generated python file of Graph GraphUnValid from SuperV import * -# Graph creation -GraphUnValid = Graph( 'GraphUnValid' ) -GraphUnValid.SetName( 'GraphUnValid' ) -GraphUnValid.SetAuthor( '' ) -GraphUnValid.SetComment( '' ) -GraphUnValid.Coords( 0 , 0 ) - -# Creation of Factory Nodes - -Add = GraphUnValid.FNode( 'AddComponent' , 'AddComponent' , 'Add' ) -Add.SetName( 'Add' ) -Add.SetAuthor( '' ) -Add.SetContainer( 'FactoryServer' ) -Add.SetComment( 'Add from AddComponent' ) -Add.Coords( 8 , 62 ) - -Sub = GraphUnValid.FNode( 'SubComponent' , 'SubComponent' , 'Sub' ) -Sub.SetName( 'Sub' ) -Sub.SetAuthor( '' ) -Sub.SetContainer( 'FactoryServer' ) -Sub.SetComment( 'Sub from SubComponent' ) -Sub.Coords( 203 , 4 ) - -Mul = GraphUnValid.FNode( 'MulComponent' , 'MulComponent' , 'Mul' ) -Mul.SetName( 'Mul' ) -Mul.SetAuthor( '' ) -Mul.SetContainer( 'FactoryServer' ) -Mul.SetComment( 'Mul from MulComponent' ) -Mul.Coords( 390 , 62 ) - -Div = GraphUnValid.FNode( 'DivComponent' , 'DivComponent' , 'Div' ) -Div.SetName( 'Div' ) -Div.SetAuthor( '' ) -Div.SetContainer( 'FactoryServer' ) -Div.SetComment( 'Div from DivComponent' ) -Div.Coords( 575 , 11 ) - -# Creation of Links -Addz = Add.Port( 'z' ) -Muly = GraphUnValid.Link( Addz , Mul.Port( 'y' ) ) - -Suby = GraphUnValid.Link( Addz , Sub.Port( 'y' ) ) -Suby.AddCoord( 1 , 182 , 113 ) -Suby.AddCoord( 2 , 183 , 170 ) - -Subz = Sub.Port( 'z' ) -Divx = GraphUnValid.Link( Subz , Div.Port( 'x' ) ) -Divx.AddCoord( 1 , 566 , 91 ) -Divx.AddCoord( 2 , 566 , 49 ) -Divx.AddCoord( 3 , 380 , 49 ) -Divx.AddCoord( 4 , 379 , 84 ) - -Mulx = GraphUnValid.Link( Subz , Mul.Port( 'x' ) ) -Mulx.AddCoord( 1 , 379 , 141 ) -Mulx.AddCoord( 2 , 378 , 85 ) - -Mulz = Mul.Port( 'z' ) -Divy = GraphUnValid.Link( Mulz , Div.Port( 'y' ) ) -Divy.AddCoord( 1 , 565 , 120 ) -Divy.AddCoord( 2 , 565 , 141 ) - -Subx = GraphUnValid.Link( Mulz , Sub.Port( 'x' ) ) -Subx.AddCoord( 1 , 194 , 84 ) -Subx.AddCoord( 2 , 195 , 252 ) -Subx.AddCoord( 3 , 566 , 252 ) -Subx.AddCoord( 4 , 565 , 141 ) - -# Creation of Output variables -AddFuncValue = Add.Port( 'FuncValue' ) -Divz = Div.Port( 'z' ) - -statvalid = GraphInLinesUnValid.IsValid() -if statvalid == 0 : - print "Unvalid graph : Ok" -else : - print "Error : the graph should not be valid" - -# Creation of Output variables -statrun = GraphUnValid.Run() -if statrun == 0 : - print "Unvalid graph ==> No Run : Ok" -else : - print "Error : the graph is not valid and is running" - -GraphUnValid.IsDone() - -GraphUnValid.State() - -GraphUnValid.PrintPorts() +# Graph creation of GraphUnValid +def DefGraphUnValid() : + GraphUnValid = Graph( 'GraphUnValid' ) + GraphUnValid.SetName( 'GraphUnValid' ) + GraphUnValid.SetAuthor( 'JR' ) + GraphUnValid.SetComment( '' ) + GraphUnValid.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + Add = GraphUnValid.FNode( 'AddComponent' , 'AddComponent' , 'Add' ) + Add.SetName( 'Add' ) + Add.SetAuthor( '' ) + Add.SetContainer( 'FactoryServer' ) + Add.SetComment( 'Add from AddComponent' ) + Add.Coords( 8 , 62 ) + IAddx = Add.GetInPort( 'x' ) + IAddy = Add.GetInPort( 'y' ) + IAddGate = Add.GetInPort( 'Gate' ) + OAddFuncValue = Add.GetOutPort( 'FuncValue' ) + OAddz = Add.GetOutPort( 'z' ) + OAddGate = Add.GetOutPort( 'Gate' ) + + Sub = GraphUnValid.FNode( 'SubComponent' , 'SubComponent' , 'Sub' ) + Sub.SetName( 'Sub' ) + Sub.SetAuthor( '' ) + Sub.SetContainer( 'FactoryServer' ) + Sub.SetComment( 'Sub from SubComponent' ) + Sub.Coords( 203 , 4 ) + ISubx = Sub.GetInPort( 'x' ) + ISuby = Sub.GetInPort( 'y' ) + ISubGate = Sub.GetInPort( 'Gate' ) + OSubz = Sub.GetOutPort( 'z' ) + OSubGate = Sub.GetOutPort( 'Gate' ) + + Mul = GraphUnValid.FNode( 'MulComponent' , 'MulComponent' , 'Mul' ) + Mul.SetName( 'Mul' ) + Mul.SetAuthor( '' ) + Mul.SetContainer( 'FactoryServer' ) + Mul.SetComment( 'Mul from MulComponent' ) + Mul.Coords( 390 , 62 ) + IMulx = Mul.GetInPort( 'x' ) + IMuly = Mul.GetInPort( 'y' ) + IMulGate = Mul.GetInPort( 'Gate' ) + OMulz = Mul.GetOutPort( 'z' ) + OMulGate = Mul.GetOutPort( 'Gate' ) + + Div = GraphUnValid.FNode( 'DivComponent' , 'DivComponent' , 'Div' ) + Div.SetName( 'Div' ) + Div.SetAuthor( '' ) + Div.SetContainer( 'FactoryServer' ) + Div.SetComment( 'Div from DivComponent' ) + Div.Coords( 575 , 11 ) + IDivx = Div.GetInPort( 'x' ) + IDivy = Div.GetInPort( 'y' ) + IDivGate = Div.GetInPort( 'Gate' ) + ODivz = Div.GetOutPort( 'z' ) + ODivGate = Div.GetOutPort( 'Gate' ) + + # Creation of Links + LAddzMuly = GraphUnValid.Link( OAddz , IMuly ) + + LAddzSuby = GraphUnValid.Link( OAddz , ISuby ) + LAddzSuby.AddCoord( 1 , 182 , 113 ) + LAddzSuby.AddCoord( 2 , 183 , 170 ) + + LSubzDivx = GraphUnValid.Link( OSubz , IDivx ) + LSubzDivx.AddCoord( 1 , 566 , 91 ) + LSubzDivx.AddCoord( 2 , 566 , 49 ) + LSubzDivx.AddCoord( 3 , 380 , 49 ) + LSubzDivx.AddCoord( 4 , 379 , 84 ) + + LSubzMulx = GraphUnValid.Link( OSubz , IMulx ) + LSubzMulx.AddCoord( 1 , 379 , 141 ) + LSubzMulx.AddCoord( 2 , 378 , 85 ) + + LMulzDivy = GraphUnValid.Link( OMulz , IDivy ) + LMulzDivy.AddCoord( 1 , 565 , 120 ) + LMulzDivy.AddCoord( 2 , 565 , 141 ) + + LMulzSubx = GraphUnValid.Link( OMulz , ISubx ) + LMulzSubx.AddCoord( 1 , 194 , 84 ) + LMulzSubx.AddCoord( 2 , 195 , 252 ) + LMulzSubx.AddCoord( 3 , 566 , 252 ) + LMulzSubx.AddCoord( 4 , 565 , 141 ) + + # Input datas + IAddx.Input( 3 ) + IAddy.Input( 4.5 ) + + # Output Ports of the graph + #OAddFuncValue = Add.GetOutPort( 'FuncValue' ) + #ODivz = Div.GetOutPort( 'z' ) + return GraphUnValid + + +GraphUnValid = DefGraphUnValid() diff --git a/examples/GraphUnValid.xml b/examples/GraphUnValid.xml index 243fc6f..3255351 100755 --- a/examples/GraphUnValid.xml +++ b/examples/GraphUnValid.xml @@ -1,253 +1,254 @@ - + + ? - ? - GraphEssai - 1 - ? - + ? + GraphUnValid + 1 + ? + GraphEssai - + double - Add\x - + Add__x + double - Add\y - + Add__y + double - Add\FuncValue - + Add__FuncValue + double - Div\z - - - 11/3/2003 - 9:58:58 - 8/8/2003 - 15:33:21 - 1.04 - ? - ? - ? - 0 - 0 - + Div__z + + + 11/3/2003 - 9:58:58 + 8/7/2005 - 16:1:1 + 1.04 + JR + ? + ? + 0 + 0 + AddComponent - AddComponent - Add - 0 - ? - + AddComponent + Add + 0 + ? + Add - + double - x - + x + double - y - + y + double - FuncValue - + FuncValue + double - z - - - 8/8/2003 - 15:32:31 - 8/8/2003 - 15:32:31 - 1.04 - ? - FactoryServer - Add from AddComponent - 8 - 62 - + z + + + 8/7/2005 - 16:1:1 + 8/7/2005 - 16:1:1 + 1.04 + ? + FactoryServer + Add from AddComponent + 8 + 62 + SubComponent - SubComponent - Sub - 0 - ? - + SubComponent + Sub + 0 + ? + Sub - + double - x - + x + double - y - + y + double - z - - - 8/8/2003 - 15:32:31 - 8/8/2003 - 15:32:31 - 1.04 - ? - FactoryServer - Sub from SubComponent - 203 - 4 - + z + + + 8/7/2005 - 16:1:1 + 8/7/2005 - 16:1:1 + 1.04 + ? + FactoryServer + Sub from SubComponent + 203 + 4 + MulComponent - MulComponent - Mul - 0 - ? - + MulComponent + Mul + 0 + ? + Mul - + double - x - + x + double - y - + y + double - z - - - 8/8/2003 - 15:32:31 - 8/8/2003 - 15:32:31 - 1.04 - ? - FactoryServer - Mul from MulComponent - 390 - 62 - + z + + + 8/7/2005 - 16:1:1 + 8/7/2005 - 16:1:1 + 1.04 + ? + FactoryServer + Mul from MulComponent + 390 + 62 + DivComponent - DivComponent - Div - 0 - ? - + DivComponent + Div + 0 + ? + Div - + double - x - + x + double - y - + y + double - z - - - 8/8/2003 - 15:32:31 - 8/8/2003 - 15:32:31 - 1.04 - ? - FactoryServer - Div from DivComponent - 575 - 11 - + z + + + 8/7/2005 - 16:1:1 + 8/7/2005 - 16:1:1 + 1.04 + ? + FactoryServer + Div from DivComponent + 575 + 11 + Add - z - Mul - y - - + z + Mul + y + + Add - z - Sub - y - + z + Sub + y + 182 - 113 - + 113 + 183 - 170 - + 170 + Sub - z - Div - x - + z + Div + x + 566 - 91 - + 91 + 566 - 49 - + 49 + 380 - 49 - + 49 + 379 - 84 - + 84 + Sub - z - Mul - x - + z + Mul + x + 379 - 141 - + 141 + 378 - 85 - + 85 + Mul - z - Div - y - + z + Div + y + 565 - 120 - + 120 + 565 - 141 - + 141 + Mul - z - Sub - x - + z + Sub + x + 194 - 84 - + 84 + 195 - 252 - + 252 + 566 - 252 - + 252 + 565 - 141 - + 141 + -GraphEssai - Add\x - Add - x - -3 - 3 - - -GraphEssai - Add\y - Add - y - +GraphUnValid + Add__x + Add + x + 7 - 4.5 - + 3 + + +GraphUnValid + Add__y + Add + y + +7 + 4.5 + diff --git a/examples/GraphWrongContainerOrComponent.py b/examples/GraphWrongContainerOrComponent.py new file mode 100644 index 0000000..c2fdf3a --- /dev/null +++ b/examples/GraphWrongContainerOrComponent.py @@ -0,0 +1,54 @@ + +# Generated python file of Graph GraphWrongContainerOrComponent + +from SuperV import * + +# Graph creation of GraphWrongContainerOrComponent +def DefGraphWrongContainerOrComponent() : + GraphWrongContainerOrComponent = Graph( 'GraphWrongContainerOrComponent' ) + GraphWrongContainerOrComponent.SetName( 'GraphWrongContainerOrComponent' ) + GraphWrongContainerOrComponent.SetAuthor( 'JR' ) + GraphWrongContainerOrComponent.SetComment( '' ) + GraphWrongContainerOrComponent.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + Add = GraphWrongContainerOrComponent.FNode( 'AddComponent' , 'AddComponent' , 'Add' ) + Add.SetName( 'Add' ) + Add.SetAuthor( '' ) + Add.SetContainer( 'FactoryServer' ) + Add.SetComment( 'Add from AddComponent' ) + Add.Coords( 99 , 304 ) + IAddx = Add.GetInPort( 'x' ) + IAddy = Add.GetInPort( 'y' ) + IAddGate = Add.GetInPort( 'Gate' ) + OAddFuncValue = Add.GetOutPort( 'FuncValue' ) + OAddz = Add.GetOutPort( 'z' ) + OAddGate = Add.GetOutPort( 'Gate' ) + + Sub = GraphWrongContainerOrComponent.FNode( 'SubComponent' , 'SubComponent' , 'Sub' ) + Sub.SetName( 'Sub' ) + Sub.SetAuthor( '' ) + Sub.SetContainer( 'FactoryServer' ) + Sub.SetComment( 'Sub from SubComponent' ) + Sub.Coords( 98 , 59 ) + ISubx = Sub.GetInPort( 'x' ) + ISuby = Sub.GetInPort( 'y' ) + ISubGate = Sub.GetInPort( 'Gate' ) + OSubz = Sub.GetOutPort( 'z' ) + OSubGate = Sub.GetOutPort( 'Gate' ) + + # Input datas + IAddx.Input( 3 ) + IAddy.Input( 4.5 ) + ISubx.Input( 1.5 ) + ISuby.Input( 0 ) + + # Output Ports of the graph + #OAddFuncValue = Add.GetOutPort( 'FuncValue' ) + #OAddz = Add.GetOutPort( 'z' ) + #OSubz = Sub.GetOutPort( 'z' ) + return GraphWrongContainerOrComponent + + +GraphWrongContainerOrComponent = DefGraphWrongContainerOrComponent() diff --git a/examples/GraphWrongContainerOrComponent.xml b/examples/GraphWrongContainerOrComponent.xml new file mode 100644 index 0000000..e5fec43 --- /dev/null +++ b/examples/GraphWrongContainerOrComponent.xml @@ -0,0 +1,145 @@ + + + + + +? + ? + GraphWrongContainerOrComponent + 1 + ? + +GraphEssai + + +double + Add__x + +double + Add__y + +double + Sub__x + +double + Sub__y + + +double + Add__FuncValue + +double + Add__z + +double + Sub__z + + + 11/3/2003 - 9:58:58 + 21/6/2005 - 11:29:39 + 1.04 + JR + ? + ? + 0 + 0 + + +NOAddComponent + NOAddComponent + Add + 0 + ? + +Add + + +double + x + +double + y + + +double + FuncValue + +double + z + + + 21/6/2005 - 11:29:24 + 21/6/2005 - 11:29:24 + 1.04 + ? + FactoryServer + Add from AddComponent + 99 + 304 + +SubComponent + SubComponent + Sub + 0 + ? + +Sub + + +double + x + +double + y + + +double + z + + + 21/6/2005 - 11:29:24 + 21/6/2005 - 11:29:24 + 1.04 + ? + NOComputer/FactoryServer + Sub from SubComponent + 98 + 59 + + + +GraphWrongContainerOrComponent + Add__x + Add + x + +7 + 3 + + +GraphWrongContainerOrComponent + Add__y + Add + y + +7 + 4.5 + + +GraphWrongContainerOrComponent + Sub__x + Sub + x + +7 + 1.5 + + +GraphWrongContainerOrComponent + Sub__y + Sub + y + +7 + 0 + diff --git a/examples/GraphWrongPythonFunctions.py b/examples/GraphWrongPythonFunctions.py new file mode 100644 index 0000000..f8495d1 --- /dev/null +++ b/examples/GraphWrongPythonFunctions.py @@ -0,0 +1,165 @@ + +# Generated python file of Graph GraphWrongPythonFunctions_1 + +from SuperV import * + +# Graph creation of GraphWrongPythonFunctions_1 +def DefGraphWrongPythonFunctions_1() : + GraphWrongPythonFunctions_1 = Graph( 'GraphWrongPythonFunctions_1' ) + GraphWrongPythonFunctions_1.SetName( 'GraphWrongPythonFunctions_1' ) + GraphWrongPythonFunctions_1.SetAuthor( 'JR' ) + GraphWrongPythonFunctions_1.SetComment( '' ) + GraphWrongPythonFunctions_1.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsOdd = [] + PyIsOdd.append( 'from timed import * ' ) + PyIsOdd.append( 'def IsOdd(a) : ' ) + PyIsOdd.append( ' print a,"IsOdd (GraphLoopSwitch1)" ' ) + PyIsOdd.append( ' sleep( 1 ) ' ) + PyIsOdd.append( ' return a ' ) + IsOdd = GraphWrongPythonFunctions_1.INode( 'IsOdd' , PyIsOdd ) + IsOdd.SetName( 'IsOdd' ) + IsOdd.SetAuthor( '' ) + IsOdd.SetComment( 'Python function' ) + IsOdd.Coords( 397 , 1 ) + IIsOdda = IsOdd.InPort( 'a' , 'long' ) + IIsOddGate = IsOdd.GetInPort( 'Gate' ) + OIsOdda = IsOdd.OutPort( 'a' , 'long' ) + OIsOddGate = IsOdd.GetOutPort( 'Gate' ) + + PyValEven = [] + PyValEven.append( 'from timed import * ' ) + PyValEven.append( 'def ValEven(Even) : ' ) + PyValEven.append( ' sleep(1) ' ) + PyValEven.append( ' return Even ' ) + PyValEven.append( '' ) + ValEven = GraphWrongPythonFunctions_1.INode( 'ValEven' , PyValEven ) + ValEven.SetName( 'ValEven' ) + ValEven.SetAuthor( '' ) + ValEven.SetComment( 'Compute Node' ) + ValEven.Coords( 396 , 222 ) + IValEvenEven = ValEven.InPort( 'Even' , 'long' ) + IValEvenGate = ValEven.GetInPort( 'Gate' ) + OValEvenEven = ValEven.OutPort( 'Even' , 'long' ) + OValEvenGate = ValEven.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyInitLoop = [] + PyInitLoop.append( 'def InitLoop(Index,Min,Max) ' ) + PyInitLoop.append( ' Index = Min ' ) + PyInitLoop.append( ' return Index,Min,Max ' ) + PyInitLoop.append( ' ' ) + PyMoreInitLoop = [] + PyMoreInitLoop.append( 'def More() ' ) + PyMoreInitLoop.append( ' return toto ' ) + PyNextInitLoop = [] + PyNextInitLoop.append( 'def Next(...) ' ) + PyNextInitLoop.append( ' return Ok ' ) + InitLoop,EndOfInitLoop = GraphWrongPythonFunctions_1.LNode( 'InitLoop' , PyInitLoop , 'More' , PyMoreInitLoop , 'Next' , PyNextInitLoop ) + EndOfInitLoop.SetName( 'EndOfInitLoop' ) + EndOfInitLoop.SetAuthor( '' ) + EndOfInitLoop.SetComment( 'Compute Node' ) + EndOfInitLoop.Coords( 767 , 102 ) + PyEndOfInitLoop = [] + PyEndOfInitLoop.append( 'def EndOfInitLoop( DoLoop , Index , Min , Max ) : ' ) + PyEndOfInitLoop.append( ' Index = Index + 1 ' ) + PyEndOfInitLoop.append( ' if Index <= Max : ' ) + PyEndOfInitLoop.append( ' DoLoop = 1 ' ) + PyEndOfInitLoop.append( ' else : ' ) + PyEndOfInitLoop.append( ' DoLoop = 0 ' ) + PyEndOfInitLoop.append( ' return DoLoop,Index,Min,Max : ' ) + EndOfInitLoop.SetPyFunction( 'EndOfInitLoop' , PyEndOfInitLoop ) + IInitLoopDoLoop = InitLoop.GetInPort( 'DoLoop' ) + IInitLoopIndex = InitLoop.InPort( 'Index' , 'long' ) + IInitLoopMin = InitLoop.InPort( 'Min' , 'long' ) + IInitLoopMax = InitLoop.InPort( 'Max' , 'long' ) + IInitLoopGate = InitLoop.GetInPort( 'Gate' ) + OInitLoopDoLoop = InitLoop.GetOutPort( 'DoLoop' ) + OInitLoopIndex = InitLoop.GetOutPort( 'Index' ) + OInitLoopMin = InitLoop.GetOutPort( 'Min' ) + OInitLoopMax = InitLoop.GetOutPort( 'Max' ) + IEndOfInitLoopDoLoop = EndOfInitLoop.GetInPort( 'DoLoop' ) + IEndOfInitLoopIndex = EndOfInitLoop.GetInPort( 'Index' ) + IEndOfInitLoopMin = EndOfInitLoop.GetInPort( 'Min' ) + IEndOfInitLoopMax = EndOfInitLoop.GetInPort( 'Max' ) + IEndOfInitLoopGate = EndOfInitLoop.GetInPort( 'Gate' ) + OEndOfInitLoopDoLoop = EndOfInitLoop.GetOutPort( 'DoLoop' ) + OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) + OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) + OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) + OEndOfInitLoopGate = EndOfInitLoop.GetOutPort( 'Gate' ) + InitLoop.SetName( 'InitLoop' ) + InitLoop.SetAuthor( '' ) + InitLoop.SetComment( 'Compute Node' ) + InitLoop.Coords( 10 , 108 ) + + # Creation of Switch Nodes + PySwitch = [] + PySwitch.append( 'from time import * ' ) + PySwitch.append( 'def Switch(a) ' ) + PySwitch.append( ' if a & 1 == 0 : ' ) + PySwitch.append( ' sleep(1) ' ) + PySwitch.append( ' return a & 1,1-(a&1),a ' ) + Switch,EndSwitch = GraphWrongPythonFunctions_1.SNode( 'Switch' , PySwitch ) + EndSwitch.SetName( 'EndSwitch' ) + EndSwitch.SetAuthor( '' ) + EndSwitch.SetComment( 'Compute Node' ) + EndSwitch.Coords( 587 , 103 ) + PyEndSwitch = [] + PyEndSwitch.append( 'def EndSwitch(a,Even) ' ) + PyEndSwitch.append( ' sleep(1) ' ) + PyEndSwitch.append( ' return a, ' ) + EndSwitch.SetPyFunction( 'EndSwitch' , PyEndSwitch ) + IEndSwitcha = EndSwitch.InPort( 'a' , 'long' ) + IEndSwitchEven = EndSwitch.InPort( 'Even' , 'long' ) + IEndSwitchDefault = EndSwitch.GetInPort( 'Default' ) + OEndSwitcha = EndSwitch.OutPort( 'a' , 'long' ) + OEndSwitchGate = EndSwitch.GetOutPort( 'Gate' ) + Switch.SetName( 'Switch' ) + Switch.SetAuthor( '' ) + Switch.SetComment( 'Compute Node' ) + Switch.Coords( 194 , 109 ) + ISwitcha = Switch.InPort( 'a' , 'long' ) + ISwitchGate = Switch.GetInPort( 'Gate' ) + OSwitchOdd = Switch.OutPort( 'Odd' , 'long' ) + OSwitchEven = Switch.OutPort( 'Even' , 'int' ) + OSwitcha = Switch.OutPort( 'a' , 'int' ) + OSwitchDefault = Switch.GetOutPort( 'Default' ) + + # Creation of Links + LIsOddaEndSwitcha = GraphWrongPythonFunctions_1.Link( OIsOdda , IEndSwitcha ) + + LInitLoopIndexSwitcha = GraphWrongPythonFunctions_1.Link( OInitLoopIndex , ISwitcha ) + + LInitLoopMinEndOfInitLoopMin = GraphWrongPythonFunctions_1.Link( OInitLoopMin , IEndOfInitLoopMin ) + + LInitLoopMaxEndOfInitLoopMax = GraphWrongPythonFunctions_1.Link( OInitLoopMax , IEndOfInitLoopMax ) + + LSwitchOddIsOddGate = GraphWrongPythonFunctions_1.Link( OSwitchOdd , IIsOddGate ) + + LSwitchEvenValEvenEven = GraphWrongPythonFunctions_1.Link( OSwitchEven , IValEvenEven ) + + LSwitchaIsOdda = GraphWrongPythonFunctions_1.Link( OSwitcha , IIsOdda ) + + LSwitchDefaultEndSwitchDefault = GraphWrongPythonFunctions_1.Link( OSwitchDefault , IEndSwitchDefault ) + + LEndSwitchaEndOfInitLoopIndex = GraphWrongPythonFunctions_1.Link( OEndSwitcha , IEndOfInitLoopIndex ) + + LValEvenEvenEndSwitchEven = GraphWrongPythonFunctions_1.Link( OValEvenEven , IEndSwitchEven ) + + # Input datas + IInitLoopIndex.Input( 0 ) + IInitLoopMin.Input( 5 ) + IInitLoopMax.Input( 23 ) + + # Output Ports of the graph + #OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) + #OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) + #OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) + return GraphWrongPythonFunctions_1 + + +GraphWrongPythonFunctions_1 = DefGraphWrongPythonFunctions_1() diff --git a/examples/GraphWrongPythonFunctions.xml b/examples/GraphWrongPythonFunctions.xml new file mode 100644 index 0000000..2b131fb --- /dev/null +++ b/examples/GraphWrongPythonFunctions.xml @@ -0,0 +1,382 @@ + + + + + +? + ? + GraphWrongPythonFunctions_1 + 1 + ? + +GraphWrongPythonFunctions_1 + + +long + InitLoop__Index + +long + InitLoop__Min + +long + InitLoop__Max + + +long + EndOfInitLoop__Index + +long + EndOfInitLoop__Min + +long + EndOfInitLoop__Max + + + 22/10/2003 - 10:36:39 + 21/6/2005 - 10:54:1 + 1.05 + JR + ? + ? + 0 + 0 + + +? + ? + IsOdd + 3 + ? + +IsOdd + + +long + a + + +long + a + + + +IsOdd + + + + + + 21/6/2005 - 10:54:1 + 21/6/2005 - 10:54:1 + 1.05 + ? + ? + Python function + 397 + 1 + +? + ? + InitLoop + 4 + EndOfInitLoop + +InitLoop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +InitLoop + + + + + +More + + + +Next + + + 21/6/2005 - 10:54:1 + 21/6/2005 - 10:54:1 + 1.05 + ? + ? + Compute Node + 10 + 108 + +? + ? + EndOfInitLoop + 5 + InitLoop + +EndOfInitLoop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +EndOfInitLoop + + + + + + + + 21/6/2005 - 10:54:1 + 21/6/2005 - 10:54:1 + 1.05 + ? + ? + Compute Node + 767 + 102 + +? + ? + Switch + 6 + EndSwitch + +Switch + + +long + a + + +long + Odd + +int + Even + +int + a + + + +Switch + + + + + + 21/6/2005 - 10:54:1 + 21/6/2005 - 10:54:1 + 1.05 + ? + ? + Compute Node + 194 + 109 + +? + ? + EndSwitch + 7 + Switch + +EndSwitch + + +long + a + +long + Even + + +long + a + + + +EndSwitch + + + + 21/6/2005 - 10:54:1 + 21/6/2005 - 10:54:1 + 1.05 + ? + ? + Compute Node + 587 + 103 + +? + ? + ValEven + 3 + ? + +ValEven + + +long + Even + + +long + Even + + + +ValEven + + + + + + 21/6/2005 - 10:54:1 + 21/6/2005 - 10:54:1 + 2.0 + ? + ? + Compute Node + 396 + 222 + + +IsOdd + a + EndSwitch + a + + +InitLoop + DoLoop + EndOfInitLoop + DoLoop + + +InitLoop + Index + Switch + a + + +InitLoop + Min + EndOfInitLoop + Min + + +InitLoop + Max + EndOfInitLoop + Max + + +EndOfInitLoop + DoLoop + InitLoop + DoLoop + + +Switch + Odd + IsOdd + Gate + + +Switch + Even + ValEven + Even + + +Switch + a + IsOdd + a + + +Switch + Default + EndSwitch + Default + + +EndSwitch + a + EndOfInitLoop + Index + + +ValEven + Even + EndSwitch + Even + + + +GraphWrongPythonFunctions_1 + InitLoop__Index + InitLoop + Index + +3 + 0 + + +GraphWrongPythonFunctions_1 + InitLoop__Min + InitLoop + Min + +3 + 5 + + +GraphWrongPythonFunctions_1 + InitLoop__Max + InitLoop + Max + +3 + 23 + diff --git a/examples/TestSupervMedfieldLoopFori.py b/examples/TestSupervMedfieldLoopFori.py index 70339b9..119c593 100755 --- a/examples/TestSupervMedfieldLoopFori.py +++ b/examples/TestSupervMedfieldLoopFori.py @@ -1,159 +1,185 @@ -# Generated python file of Graph LoopGraph +# Generated python file of Graph TestSupervMedfieldLoopFori from SuperV import * -# Graph creation -LoopGraph = Graph( 'LoopGraph' ) -LoopGraph.SetName( 'LoopGraph' ) -LoopGraph.SetAuthor( '' ) -LoopGraph.SetComment( '' ) -LoopGraph.Coords( 0 , 0 ) -# Creation of Factory Nodes - -Mul = LoopGraph.FNode( 'Calculator' , 'Calculator' , 'Mul' ) -Mul.SetName( 'Mul' ) -Mul.SetAuthor( 'LD' ) -Mul.SetContainer( 'localhost/FactoryServer' ) -Mul.SetComment( 'Multiply a field by a constant' ) -Mul.Coords( 429 , 46 ) - -# Creation of InLine Nodes -PyInitDisplay = [] -PyInitDisplay.append( 'from VISU import * ' ) -PyInitDisplay.append( 'import SALOMEDS ' ) -PyInitDisplay.append( 'from LifeCycleCORBA import * ' ) -PyInitDisplay.append( 'from SALOME_NamingServicePy import * ' ) -PyInitDisplay.append( 'def InitDisplay(): ' ) -PyInitDisplay.append( ' # initialize the ORB ' ) -PyInitDisplay.append( ' orb = CORBA.ORB_init([], CORBA.ORB_ID) ' ) -PyInitDisplay.append( ' # create an LifeCycleCORBA instance ' ) -PyInitDisplay.append( ' lcc = LifeCycleCORBA(orb) ' ) -PyInitDisplay.append( ' # ----------------------------------------- ' ) -PyInitDisplay.append( ' # Visualization parameters ' ) -PyInitDisplay.append( ' #create a naming service instance ' ) -PyInitDisplay.append( ' naming_service = SALOME_NamingServicePy_i(orb) ' ) -PyInitDisplay.append( ' # get Study Manager reference ' ) -PyInitDisplay.append( ' obj = naming_service.Resolve("myStudyManager") ' ) -PyInitDisplay.append( ' myStudyManager = obj._narrow(SALOMEDS.StudyManager) ' ) -PyInitDisplay.append( ' myStudy = myStudyManager.GetStudyByID(1) ' ) -PyInitDisplay.append( ' aVisu = lcc.FindOrLoadComponent("FactoryServer", "Visu") ' ) -PyInitDisplay.append( ' print "InitDisplay --> aVisu = ",aVisu ' ) -PyInitDisplay.append( ' aVisu.SetCurrentStudy(myStudy); ' ) -PyInitDisplay.append( ' aViewManager = aVisu.GetViewManager() ' ) -PyInitDisplay.append( ' print "InitDisplay --> aViewManager = ",aViewManager ' ) -PyInitDisplay.append( ' aView = aViewManager.Create3DView() ' ) -PyInitDisplay.append( ' print "InitDisplay --> aView = ",aView ' ) -PyInitDisplay.append( ' return aVisu,aView ' ) -InitDisplay = LoopGraph.INode( 'InitDisplay' , PyInitDisplay ) -InitDisplay.OutPort( 'aVisu' , 'objref' ) -InitDisplay.OutPort( 'aView' , 'objref' ) -InitDisplay.SetName( 'InitDisplay' ) -InitDisplay.SetAuthor( '' ) -InitDisplay.SetComment( 'Compute Node' ) -InitDisplay.Coords( 1 , 105 ) - -# Creation of Loop Nodes -PyInit = [] -PyInit.append( 'def Init(index,min,max,medfield,x1,aVisu,aView): ' ) -PyInit.append( ' if max >= min : ' ) -PyInit.append( ' index = min ' ) -PyInit.append( ' else : ' ) -PyInit.append( ' index = max ' ) -PyInit.append( ' print "Init --> index = ",index ' ) -PyInit.append( ' print " min = ",min ' ) -PyInit.append( ' print " max = ",max ' ) -PyInit.append( ' print " medfield = ",medfield ' ) -PyInit.append( ' return index,min,max,medfield,x1,aVisu,aView ' ) -PyMoreInit = [] -PyMoreInit.append( 'def More(index,min,max,medfield,x1,aVisu,aView): ' ) -PyMoreInit.append( ' if max >= index : ' ) -PyMoreInit.append( ' DoLoop = 1 ' ) -PyMoreInit.append( ' else : ' ) -PyMoreInit.append( ' DoLoop = 0 ' ) -PyMoreInit.append( ' print "More --> DoLoop = ",DoLoop ' ) -PyMoreInit.append( ' print " index = ",index ' ) -PyMoreInit.append( ' print " min = ",min ' ) -PyMoreInit.append( ' print " max = ",max ' ) -PyMoreInit.append( ' print " medfield = ",medfield ' ) -PyMoreInit.append( ' return DoLoop,index,min,max,medfield,x1,aVisu,aView ' ) -PyNextInit = [] -PyNextInit.append( 'def Next(index,min,max,medfield,x1,aVisu,aView): ' ) -PyNextInit.append( ' index = index + 1 ' ) -PyNextInit.append( ' print "Next --> index = ",index ' ) -PyNextInit.append( ' print " min = ",min ' ) -PyNextInit.append( ' print " max = ",max ' ) -PyNextInit.append( ' print " medfield = ",medfield ' ) -PyNextInit.append( ' return index,min,max,medfield,x1,aVisu,aView ' ) -Init,EndInit = LoopGraph.LNode( 'Init' , PyInit , 'More' , PyMoreInit , 'Next' , PyNextInit ) -EndInit.SetName( 'EndInit' ) -EndInit.SetAuthor( 'LD' ) -EndInit.SetComment( 'no comment' ) -EndInit.Coords( 631 , 5 ) -Init.InPort( 'index' , 'long' ) -Init.InPort( 'min' , 'long' ) -Init.InPort( 'max' , 'long' ) -Init.InPort( 'medfield' , 'objref' ) -Init.InPort( 'x1' , 'double' ) -Init.InPort( 'aVisu' , 'objref' ) -Init.InPort( 'aView' , 'objref' ) -Init.OutPort( 'index' , 'long' ) -Init.OutPort( 'min' , 'long' ) -Init.OutPort( 'max' , 'long' ) -Init.OutPort( 'medfield' , 'objref' ) -Init.OutPort( 'x1' , 'double' ) -Init.OutPort( 'aVisu' , 'objref' ) -Init.OutPort( 'aView' , 'objref' ) -Init.SetName( 'Init' ) -Init.SetAuthor( 'LD' ) -Init.SetComment( 'no comment' ) -Init.Coords( 216 , 5 ) - -# Creation of Links -InitDisplayaVisu = InitDisplay.Port( 'aVisu' ) -InitaVisu = LoopGraph.Link( InitDisplayaVisu , Init.Port( 'aVisu' ) ) - -InitDisplayaView = InitDisplay.Port( 'aView' ) -InitaView = LoopGraph.Link( InitDisplayaView , Init.Port( 'aView' ) ) - -Initindex = Init.Port( 'index' ) -EndInitindex = LoopGraph.Link( Initindex , EndInit.Port( 'index' ) ) - -Initmin = Init.Port( 'min' ) -EndInitmin = LoopGraph.Link( Initmin , EndInit.Port( 'min' ) ) - -Initmax = Init.Port( 'max' ) -EndInitmax = LoopGraph.Link( Initmax , EndInit.Port( 'max' ) ) - -Initmedfield = Init.Port( 'medfield' ) -Mulfield1 = LoopGraph.Link( Initmedfield , Mul.Port( 'field1' ) ) - -Initx1 = Init.Port( 'x1' ) -EndInitx1 = LoopGraph.Link( Initx1 , EndInit.Port( 'x1' ) ) - -Mulx1 = LoopGraph.Link( Initx1 , Mul.Port( 'x1' ) ) - -InitaVisu = Init.Port( 'aVisu' ) -EndInitaVisu = LoopGraph.Link( InitaVisu , EndInit.Port( 'aVisu' ) ) - -InitaView = Init.Port( 'aView' ) -EndInitaView = LoopGraph.Link( InitaView , EndInit.Port( 'aView' ) ) - -Mulreturn = Mul.Port( 'return' ) -EndInitmedfield = LoopGraph.Link( Mulreturn , EndInit.Port( 'medfield' ) ) - -# Creation of Input datas -Initindex = Init.Input( 'index' , 0) -Initmin = Init.Input( 'min' , 0) -Initmax = Init.Input( 'max' , 55) -Initmedfield = Init.Input( 'medfield' , 'IOR:010000001f00000049444c3a53414c4f4d455f4d45442f4649454c44444f55424c453a312e300000010000000000000026000000010100000a0000003132372e302e302e3100ead00e000000fe1948673f000058e60000000021') -Initx1 = Init.Input( 'x1' , 2) - -# Creation of Output variables -EndInitindex = EndInit.Port( 'index' ) -EndInitmin = EndInit.Port( 'min' ) -EndInitmax = EndInit.Port( 'max' ) -EndInitmedfield = EndInit.Port( 'medfield' ) -EndInitx1 = EndInit.Port( 'x1' ) -EndInitaVisu = EndInit.Port( 'aVisu' ) -EndInitaView = EndInit.Port( 'aView' ) +# Graph creation of TestSupervMedfieldLoopFori +def DefTestSupervMedfieldLoopFori() : + TestSupervMedfieldLoopFori = Graph( 'TestSupervMedfieldLoopFori' ) + TestSupervMedfieldLoopFori.SetName( 'TestSupervMedfieldLoopFori' ) + TestSupervMedfieldLoopFori.SetAuthor( '' ) + TestSupervMedfieldLoopFori.SetComment( '' ) + TestSupervMedfieldLoopFori.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + Mul = TestSupervMedfieldLoopFori.FNode( 'Calculator' , 'Calculator' , 'Mul' ) + Mul.SetName( 'Mul' ) + Mul.SetAuthor( 'LD' ) + Mul.SetContainer( 'localhost/FactoryServer' ) + Mul.SetComment( 'Multiply a field by a constant' ) + Mul.Coords( 429 , 46 ) + IMulfield1 = Mul.GetInPort( 'field1' ) + IMulx1 = Mul.GetInPort( 'x1' ) + IMulGate = Mul.GetInPort( 'Gate' ) + OMulreturn = Mul.GetOutPort( 'return' ) + OMulGate = Mul.GetOutPort( 'Gate' ) + + # Creation of InLine Nodes + PyInitDisplay = [] + PyInitDisplay.append( 'from VISU import * ' ) + PyInitDisplay.append( 'import SALOMEDS ' ) + PyInitDisplay.append( 'from LifeCycleCORBA import * ' ) + PyInitDisplay.append( 'from SALOME_NamingServicePy import * ' ) + PyInitDisplay.append( 'def InitDisplay(): ' ) + PyInitDisplay.append( ' # initialize the ORB ' ) + PyInitDisplay.append( ' orb = CORBA.ORB_init([], CORBA.ORB_ID) ' ) + PyInitDisplay.append( ' # create an LifeCycleCORBA instance ' ) + PyInitDisplay.append( ' lcc = LifeCycleCORBA(orb) ' ) + PyInitDisplay.append( ' # ----------------------------------------- ' ) + PyInitDisplay.append( ' # Visualization parameters ' ) + PyInitDisplay.append( ' #create a naming service instance ' ) + PyInitDisplay.append( ' naming_service = SALOME_NamingServicePy_i(orb) ' ) + PyInitDisplay.append( ' # get Study Manager reference ' ) + PyInitDisplay.append( ' obj = naming_service.Resolve("myStudyManager") ' ) + PyInitDisplay.append( ' myStudyManager = obj._narrow(SALOMEDS.StudyManager) ' ) + PyInitDisplay.append( ' myStudy = myStudyManager.GetStudyByID(1) ' ) + PyInitDisplay.append( ' aVisu = lcc.FindOrLoadComponent("FactoryServer", "VISU") ' ) + PyInitDisplay.append( ' print "InitDisplay --> aVisu = ",aVisu ' ) + PyInitDisplay.append( ' aVisu.SetCurrentStudy(myStudy); ' ) + PyInitDisplay.append( ' aViewManager = aVisu.GetViewManager() ' ) + PyInitDisplay.append( ' print "InitDisplay --> aViewManager = ",aViewManager ' ) + PyInitDisplay.append( ' aView = aViewManager.Create3DView() ' ) + PyInitDisplay.append( ' print "InitDisplay --> aView = ",aView ' ) + PyInitDisplay.append( ' return aVisu,aView ' ) + InitDisplay = TestSupervMedfieldLoopFori.INode( 'InitDisplay' , PyInitDisplay ) + InitDisplay.SetName( 'InitDisplay' ) + InitDisplay.SetAuthor( '' ) + InitDisplay.SetComment( 'Compute Node' ) + InitDisplay.Coords( 1 , 105 ) + IInitDisplayGate = InitDisplay.GetInPort( 'Gate' ) + OInitDisplayaVisu = InitDisplay.OutPort( 'aVisu' , 'objref' ) + OInitDisplayaView = InitDisplay.OutPort( 'aView' , 'objref' ) + OInitDisplayGate = InitDisplay.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyInit = [] + PyInit.append( 'def Init(index,min,max,medfield,x1,aVisu,aView): ' ) + PyInit.append( ' if max >= min : ' ) + PyInit.append( ' index = min ' ) + PyInit.append( ' else : ' ) + PyInit.append( ' index = max ' ) + PyInit.append( ' print "Init --> index = ",index ' ) + PyInit.append( ' print " min = ",min ' ) + PyInit.append( ' print " max = ",max ' ) + PyInit.append( ' print " medfield = ",medfield ' ) + PyInit.append( ' return index,min,max,medfield,x1,aVisu,aView ' ) + PyMoreInit = [] + PyMoreInit.append( 'def More(index,min,max,medfield,x1,aVisu,aView): ' ) + PyMoreInit.append( ' if max >= index : ' ) + PyMoreInit.append( ' DoLoop = 1 ' ) + PyMoreInit.append( ' else : ' ) + PyMoreInit.append( ' DoLoop = 0 ' ) + PyMoreInit.append( ' print "More --> DoLoop = ",DoLoop ' ) + PyMoreInit.append( ' print " index = ",index ' ) + PyMoreInit.append( ' print " min = ",min ' ) + PyMoreInit.append( ' print " max = ",max ' ) + PyMoreInit.append( ' print " medfield = ",medfield ' ) + PyMoreInit.append( ' return DoLoop,index,min,max,medfield,x1,aVisu,aView ' ) + PyNextInit = [] + PyNextInit.append( 'def Next(index,min,max,medfield,x1,aVisu,aView): ' ) + PyNextInit.append( ' index = index + 1 ' ) + PyNextInit.append( ' print "Next --> index = ",index ' ) + PyNextInit.append( ' print " min = ",min ' ) + PyNextInit.append( ' print " max = ",max ' ) + PyNextInit.append( ' print " medfield = ",medfield ' ) + PyNextInit.append( ' return index,min,max,medfield,x1,aVisu,aView ' ) + Init,EndInit = TestSupervMedfieldLoopFori.LNode( 'Init' , PyInit , 'More' , PyMoreInit , 'Next' , PyNextInit ) + EndInit.SetName( 'EndInit' ) + EndInit.SetAuthor( 'LD' ) + EndInit.SetComment( 'no comment' ) + EndInit.Coords( 631 , 5 ) + PyEndInit = [] + EndInit.SetPyFunction( '' , PyEndInit ) + IInitDoLoop = Init.GetInPort( 'DoLoop' ) + IInitindex = Init.InPort( 'index' , 'long' ) + IInitmin = Init.InPort( 'min' , 'long' ) + IInitmax = Init.InPort( 'max' , 'long' ) + IInitmedfield = Init.InPort( 'medfield' , 'objref' ) + IInitx1 = Init.InPort( 'x1' , 'double' ) + IInitaVisu = Init.InPort( 'aVisu' , 'objref' ) + IInitaView = Init.InPort( 'aView' , 'objref' ) + IInitGate = Init.GetInPort( 'Gate' ) + OInitDoLoop = Init.GetOutPort( 'DoLoop' ) + OInitindex = Init.GetOutPort( 'index' ) + OInitmin = Init.GetOutPort( 'min' ) + OInitmax = Init.GetOutPort( 'max' ) + OInitmedfield = Init.GetOutPort( 'medfield' ) + OInitx1 = Init.GetOutPort( 'x1' ) + OInitaVisu = Init.GetOutPort( 'aVisu' ) + OInitaView = Init.GetOutPort( 'aView' ) + IEndInitDoLoop = EndInit.GetInPort( 'DoLoop' ) + IEndInitindex = EndInit.GetInPort( 'index' ) + IEndInitmin = EndInit.GetInPort( 'min' ) + IEndInitmax = EndInit.GetInPort( 'max' ) + IEndInitmedfield = EndInit.GetInPort( 'medfield' ) + IEndInitx1 = EndInit.GetInPort( 'x1' ) + IEndInitaVisu = EndInit.GetInPort( 'aVisu' ) + IEndInitaView = EndInit.GetInPort( 'aView' ) + IEndInitGate = EndInit.GetInPort( 'Gate' ) + OEndInitDoLoop = EndInit.GetOutPort( 'DoLoop' ) + OEndInitindex = EndInit.GetOutPort( 'index' ) + OEndInitmin = EndInit.GetOutPort( 'min' ) + OEndInitmax = EndInit.GetOutPort( 'max' ) + OEndInitmedfield = EndInit.GetOutPort( 'medfield' ) + OEndInitx1 = EndInit.GetOutPort( 'x1' ) + OEndInitaVisu = EndInit.GetOutPort( 'aVisu' ) + OEndInitaView = EndInit.GetOutPort( 'aView' ) + OEndInitGate = EndInit.GetOutPort( 'Gate' ) + Init.SetName( 'Init' ) + Init.SetAuthor( 'LD' ) + Init.SetComment( 'no comment' ) + Init.Coords( 216 , 5 ) + + # Creation of Links + LInitDisplayaVisuInitaVisu = TestSupervMedfieldLoopFori.Link( OInitDisplayaVisu , IInitaVisu ) + + LInitDisplayaViewInitaView = TestSupervMedfieldLoopFori.Link( OInitDisplayaView , IInitaView ) + + LInitindexEndInitindex = TestSupervMedfieldLoopFori.Link( OInitindex , IEndInitindex ) + + LInitminEndInitmin = TestSupervMedfieldLoopFori.Link( OInitmin , IEndInitmin ) + + LInitmaxEndInitmax = TestSupervMedfieldLoopFori.Link( OInitmax , IEndInitmax ) + + LInitmedfieldMulfield1 = TestSupervMedfieldLoopFori.Link( OInitmedfield , IMulfield1 ) + + LInitx1EndInitx1 = TestSupervMedfieldLoopFori.Link( OInitx1 , IEndInitx1 ) + + LInitx1Mulx1 = TestSupervMedfieldLoopFori.Link( OInitx1 , IMulx1 ) + + LInitaVisuEndInitaVisu = TestSupervMedfieldLoopFori.Link( OInitaVisu , IEndInitaVisu ) + + LInitaViewEndInitaView = TestSupervMedfieldLoopFori.Link( OInitaView , IEndInitaView ) + + LMulreturnEndInitmedfield = TestSupervMedfieldLoopFori.Link( OMulreturn , IEndInitmedfield ) + + # Input datas + IInitindex.Input( 0 ) + IInitmin.Input( 0 ) + IInitmax.Input( 55 ) + IInitmedfield.Input( 'IOR:010000001f00000049444c3a53414c4f4d455f4d45442f4649454c44444f55424c453a312e300000010000000000000026000000010100000a0000003132372e302e302e3100ead00e000000fe1948673f000058e60000000021' ) + IInitx1.Input( 2 ) + + # Output Ports of the graph + #OEndInitindex = EndInit.GetOutPort( 'index' ) + #OEndInitmin = EndInit.GetOutPort( 'min' ) + #OEndInitmax = EndInit.GetOutPort( 'max' ) + #OEndInitmedfield = EndInit.GetOutPort( 'medfield' ) + #OEndInitx1 = EndInit.GetOutPort( 'x1' ) + #OEndInitaVisu = EndInit.GetOutPort( 'aVisu' ) + #OEndInitaView = EndInit.GetOutPort( 'aView' ) + return TestSupervMedfieldLoopFori + + +TestSupervMedfieldLoopFori = DefTestSupervMedfieldLoopFori() diff --git a/examples/TestSupervMedfieldLoopFori.xml b/examples/TestSupervMedfieldLoopFori.xml index 0d10269..5edb47a 100755 --- a/examples/TestSupervMedfieldLoopFori.xml +++ b/examples/TestSupervMedfieldLoopFori.xml @@ -1,438 +1,441 @@ - + + ? - ? - LoopGraph - 1 - ? - + ? + TestSupervMedfieldLoopFori + 1 + ? + LoopGraph - + long - Init\index - + Init__index + long - Init\min - + Init__min + long - Init\max - + Init__max + objref - Init\medfield - + Init__medfield + double - Init\x1 - + Init__x1 + long - EndInit\index - + EndInit__index + long - EndInit\min - + EndInit__min + long - EndInit\max - + EndInit__max + objref - EndInit\medfield - + EndInit__medfield + double - EndInit\x1 - + EndInit__x1 + objref - EndInit\aVisu - + EndInit__aVisu + objref - EndInit\aView - - - 15/9/2003 - 15:25:24 - 19/9/2003 - 16:0:10 - 1.04 - ? - ? - ? - 0 - 0 - + EndInit__aView + + + 15/9/2003 - 15:25:24 + 8/4/2005 - 13:44:4 + 1.04 + ? + ? + ? + 0 + 0 + ? - ? - InitDisplay - 3 - ? - + ? + InitDisplay + 3 + ? + InitDisplay - - + + objref - aVisu - + aVisu + objref - aView - - + aView + + InitDisplay - - - - - - - - - - - - - - - - - - - aVisu = ",aVisu ]]> - - - aViewManager = ",aViewManager ]]> - - aView = ",aView ]]> - - 19/9/2003 - 16:0:9 - 19/9/2003 - 16:0:9 - 1.04 - ? - ? - Compute Node - 1 - 105 - + + + + + + + + + + + + + + + + + + + aVisu = ",aVisu ]]> + + + aViewManager = ",aViewManager ]]> + + aView = ",aView ]]> + + 8/4/2005 - 13:44:4 + 8/4/2005 - 13:44:4 + 1.04 + ? + ? + Compute Node + 1 + 105 + ? - ? - Init - 4 - EndInit - + ? + Init + 4 + EndInit + Init - + long - index - + index + long - min - + min + long - max - + max + objref - medfield - + medfield + double - x1 - + x1 + objref - aVisu - + aVisu + objref - aView - + aView + long - index - + index + long - min - + min + long - max - + max + objref - medfield - + medfield + double - x1 - + x1 + objref - aVisu - + aVisu + objref - aView - - + aView + + Init - - = min : ]]> - - - - index = ",index ]]> - - - - - + + = min : ]]> + + + + index = ",index ]]> + + + + + More - - = index : ]]> - - - - DoLoop = ",DoLoop ]]> - - - - - - + + = index : ]]> + + + + DoLoop = ",DoLoop ]]> + + + + + + Next - - - index = ",index ]]> - - - - - 19/9/2003 - 16:0:9 - 19/9/2003 - 16:0:9 - 1.04 - LD - ? - no comment - 216 - 5 - + + + index = ",index ]]> + + + + + 8/4/2005 - 13:44:4 + 8/4/2005 - 13:44:4 + 1.04 + LD + ? + no comment + 216 + 5 + ? - ? - EndInit - 5 - Init - + ? + EndInit + 5 + Init + EndInit - + long - index - + index + long - min - + min + long - max - + max + objref - medfield - + medfield + double - x1 - + x1 + objref - aVisu - + aVisu + objref - aView - + aView + long - index - + index + long - min - + min + long - max - + max + objref - medfield - + medfield + double - x1 - + x1 + objref - aVisu - + aVisu + objref - aView - - - - 19/9/2003 - 16:0:9 - 19/9/2003 - 16:0:9 - 1.04 - LD - ? - no comment - 631 - 5 - + aView + + + +? + + 8/4/2005 - 13:44:4 + 8/4/2005 - 13:44:4 + 1.04 + LD + ? + no comment + 631 + 5 + Calculator - Calculator - Mul - 0 - ? - + Calculator + Mul + 0 + ? + Mul - + FIELDDOUBLE - field1 - + field1 + double - x1 - + x1 + FIELDDOUBLE - return - - - 19/9/2003 - 16:0:10 - 19/9/2003 - 16:0:10 - 1.04 - LD - localhost/FactoryServer - Multiply a field by a constant - 429 - 46 - + return + + + 8/4/2005 - 13:44:4 + 8/4/2005 - 13:44:4 + 1.04 + LD + localhost/FactoryServer + Multiply a field by a constant + 429 + 46 + InitDisplay - aVisu - Init - aVisu - - + aVisu + Init + aVisu + + InitDisplay - aView - Init - aView - - + aView + Init + aView + + Init - DoLoop - EndInit - DoLoop - - + DoLoop + EndInit + DoLoop + + Init - index - EndInit - index - - + index + EndInit + index + + Init - min - EndInit - min - - + min + EndInit + min + + Init - max - EndInit - max - - + max + EndInit + max + + Init - medfield - Mul - field1 - - + medfield + Mul + field1 + + Init - x1 - EndInit - x1 - - + x1 + EndInit + x1 + + Init - x1 - Mul - x1 - - + x1 + Mul + x1 + + Init - aVisu - EndInit - aVisu - - + aVisu + EndInit + aVisu + + Init - aView - EndInit - aView - - + aView + EndInit + aView + + EndInit - DoLoop - Init - DoLoop - + DoLoop + Init + DoLoop + 205 - 98 - + 98 + 204 - 21 - + 21 + 936 - 20 - + 20 + 935 - 70 - + 70 + Mul - return - EndInit - medfield - - + return + EndInit + medfield + + -LoopGraph - Init\index - Init - index - +TestSupervMedfieldLoopFori + Init__index + Init + index + 3 - 0 - - -LoopGraph - Init\min - Init - min - + 0 + + +TestSupervMedfieldLoopFori + Init__min + Init + min + 3 - 0 - - -LoopGraph - Init\max - Init - max - + 0 + + +TestSupervMedfieldLoopFori + Init__max + Init + max + 3 - 55 - - -LoopGraph - Init\medfield - Init - medfield - + 55 + + +TestSupervMedfieldLoopFori + Init__medfield + Init + medfield + 14 - IOR:010000001f00000049444c3a53414c4f4d455f4d45442f4649454c44444f55424c453a312e300000010000000000000026000000010100000a0000003132372e302e302e3100ead00e000000fe1948673f000058e60000000021 - - -LoopGraph - Init\x1 - Init - x1 - + IOR:010000001f00000049444c3a53414c4f4d455f4d45442f4649454c44444f55424c453a312e300000010000000000000026000000010100000a0000003132372e302e302e3100ead00e000000fe1948673f000058e60000000021 + + +TestSupervMedfieldLoopFori + Init__x1 + Init + x1 + 7 - 2 - + 2 + diff --git a/examples/TestSupervMedfieldLoopForiVisu.py b/examples/TestSupervMedfieldLoopForiVisu.py index 2eff10b..6841ea9 100755 --- a/examples/TestSupervMedfieldLoopForiVisu.py +++ b/examples/TestSupervMedfieldLoopForiVisu.py @@ -1,216 +1,243 @@ -# Generated python file of Graph LoopGraph +# Generated python file of Graph TestSupervMedfieldLoopForiVisu from SuperV import * -# Graph creation -LoopGraph = Graph( 'LoopGraph' ) -LoopGraph.SetName( 'LoopGraph' ) -LoopGraph.SetAuthor( '' ) -LoopGraph.SetComment( '' ) -LoopGraph.Coords( 0 , 0 ) -# Creation of Factory Nodes - -Mul = LoopGraph.FNode( 'Calculator' , 'Calculator' , 'Mul' ) -Mul.SetName( 'Mul' ) -Mul.SetAuthor( 'LD' ) -Mul.SetContainer( 'localhost/FactoryServer' ) -Mul.SetComment( 'Multiply a field by a constant' ) -Mul.Coords( 387 , 104 ) - -# Creation of InLine Nodes -PyInitDisplay = [] -PyInitDisplay.append( 'from LifeCycleCORBA import * ' ) -PyInitDisplay.append( 'from VISU import * ' ) -PyInitDisplay.append( 'def InitDisplay(): ' ) -PyInitDisplay.append( ' # initialize the ORB ' ) -PyInitDisplay.append( ' orb = CORBA.ORB_init([], CORBA.ORB_ID) ' ) -PyInitDisplay.append( ' # create an LifeCycleCORBA instance ' ) -PyInitDisplay.append( ' lcc = LifeCycleCORBA(orb) ' ) -PyInitDisplay.append( ' # ----------------------------------------- ' ) -PyInitDisplay.append( ' # loading visu component ' ) -PyInitDisplay.append( ' aVisu = lcc.FindOrLoadComponent("FactoryServer","Visu") ' ) -PyInitDisplay.append( ' print "InitDisplay --> aVisu = ",aVisu ' ) -PyInitDisplay.append( ' aViewManager = aVisu.GetViewManager() ' ) -PyInitDisplay.append( ' print "InitDisplay --> aViewManager = ",aViewManager ' ) -PyInitDisplay.append( ' # aView = aViewManager.GetCurrentView() ' ) -PyInitDisplay.append( ' aView = aViewManager.Create3DView() ' ) -PyInitDisplay.append( ' print "InitDisplay --> aView = ",aView ' ) -PyInitDisplay.append( ' return aVisu,aView ' ) -InitDisplay = LoopGraph.INode( 'InitDisplay' , PyInitDisplay ) -InitDisplay.OutPort( 'aVisu' , 'objref' ) -InitDisplay.OutPort( 'aView' , 'objref' ) -InitDisplay.SetName( 'InitDisplay' ) -InitDisplay.SetAuthor( '' ) -InitDisplay.SetComment( 'Compute Node' ) -InitDisplay.Coords( 0 , 163 ) - -PyDisplayMed = [] -PyDisplayMed.append( 'import os ' ) -PyDisplayMed.append( 'import SALOME_MED ' ) -PyDisplayMed.append( 'from VISU import * ' ) -PyDisplayMed.append( 'from LifeCycleCORBA import * ' ) -PyDisplayMed.append( 'def DisplayMed(medfield,index,aVisu,aView): ' ) -PyDisplayMed.append( ' # initialize the ORB ' ) -PyDisplayMed.append( ' orb = CORBA.ORB_init([''], CORBA.ORB_ID) ' ) -PyDisplayMed.append( ' # create an LifeCycleCORBA instance ' ) -PyDisplayMed.append( ' lcc = LifeCycleCORBA(orb) ' ) -PyDisplayMed.append( ' print " " ' ) -PyDisplayMed.append( ' print "***************************************************************" ' ) -PyDisplayMed.append( ' calc = lcc.FindOrLoadComponent("FactoryServer", "Calculator") ' ) -PyDisplayMed.append( ' print "-----> calc = ",calc ' ) -PyDisplayMed.append( ' medfilename = "/tmp/LoopGraphFile" + str(index) + ".med" ' ) -PyDisplayMed.append( ' print "-----> Writing Med field in temporary file : ",medfilename ' ) -PyDisplayMed.append( ' calc.writeMEDfile(medfield,medfilename) ' ) -PyDisplayMed.append( ' print "-----> calc = ",calc ' ) -PyDisplayMed.append( ' print "***************************************************************" ' ) -PyDisplayMed.append( ' myResult1 = aVisu.ImportFile(medfilename) ' ) -PyDisplayMed.append( ' print "-----> myResult1 = ",myResult1 ' ) -PyDisplayMed.append( ' field_name = medfield.getName() ' ) -PyDisplayMed.append( ' print "-----> field_name = ",field_name ' ) -PyDisplayMed.append( ' mesh_name = medfield.getSupport().getMesh().getName() ' ) -PyDisplayMed.append( ' print "-----> mesh_name = ",mesh_name ' ) -PyDisplayMed.append( ' aMesh1 = aVisu.MeshOnEntity(myResult1,mesh_name,CELL) ' ) -PyDisplayMed.append( ' print "-----> aMesh1 = ",aMesh1 ' ) -PyDisplayMed.append( ' aScalarMap1 = aVisu.ScalarMapOnField(myResult1,mesh_name,NODE,field_name,1) ' ) -PyDisplayMed.append( ' print "-----> aScalarMap1 = ",aScalarMap1 ' ) -PyDisplayMed.append( ' aView.DisplayOnly(aScalarMap1) ' ) -PyDisplayMed.append( ' aView.FitAll() ' ) -PyDisplayMed.append( ' command = "rm " + medfilename ' ) -PyDisplayMed.append( ' os.system(command) ' ) -PyDisplayMed.append( ' print "-----> Delete temporary Med file : ",medfilename ' ) -PyDisplayMed.append( ' print "***************************************************************" ' ) -PyDisplayMed.append( ' print " " ' ) -PyDisplayMed.append( ' return medfield ' ) -DisplayMed = LoopGraph.INode( 'DisplayMed' , PyDisplayMed ) -DisplayMed.InPort( 'INmedfield' , 'objref' ) -DisplayMed.InPort( 'index' , 'long' ) -DisplayMed.InPort( 'aVisu' , 'objref' ) -DisplayMed.InPort( 'aView' , 'objref' ) -DisplayMed.OutPort( 'OUTmedfield' , 'objref' ) -DisplayMed.SetName( 'DisplayMed' ) -DisplayMed.SetAuthor( '' ) -DisplayMed.SetComment( 'Compute Node' ) -DisplayMed.Coords( 594 , 105 ) - -# Creation of Loop Nodes -PyInit = [] -PyInit.append( 'def Init(index,min,max,medfield,x1,aVisu,aView): ' ) -PyInit.append( ' if max >= min : ' ) -PyInit.append( ' index = min ' ) -PyInit.append( ' else : ' ) -PyInit.append( ' index = max ' ) -PyInit.append( ' print "Init --> index = ",index ' ) -PyInit.append( ' print " min = ",min ' ) -PyInit.append( ' print " max = ",max ' ) -PyInit.append( ' print " medfield = ",medfield ' ) -PyInit.append( ' return index,min,max,medfield,x1,aVisu,aView ' ) -PyMoreInit = [] -PyMoreInit.append( 'def More(index,min,max,medfield,x1,aVisu,aView): ' ) -PyMoreInit.append( ' if max >= index : ' ) -PyMoreInit.append( ' DoLoop = 1 ' ) -PyMoreInit.append( ' else : ' ) -PyMoreInit.append( ' DoLoop = 0 ' ) -PyMoreInit.append( ' print "More --> DoLoop = ",DoLoop ' ) -PyMoreInit.append( ' print " index = ",index ' ) -PyMoreInit.append( ' print " min = ",min ' ) -PyMoreInit.append( ' print " max = ",max ' ) -PyMoreInit.append( ' print " medfield = ",medfield ' ) -PyMoreInit.append( ' return DoLoop,index,min,max,medfield,x1,aVisu,aView ' ) -PyNextInit = [] -PyNextInit.append( 'def Next(index,min,max,medfield,x1,aVisu,aView): ' ) -PyNextInit.append( ' index = index + 1 ' ) -PyNextInit.append( ' print "Next --> index = ",index ' ) -PyNextInit.append( ' print " min = ",min ' ) -PyNextInit.append( ' print " max = ",max ' ) -PyNextInit.append( ' print " medfield = ",medfield ' ) -PyNextInit.append( ' return index,min,max,medfield,x1,aVisu,aView ' ) -Init,EndInit = LoopGraph.LNode( 'Init' , PyInit , 'More' , PyMoreInit , 'Next' , PyNextInit ) -EndInit.SetName( 'EndInit' ) -EndInit.SetAuthor( 'LD' ) -EndInit.SetComment( 'no comment' ) -EndInit.Coords( 776 , 64 ) -Init.InPort( 'index' , 'long' ) -Init.InPort( 'min' , 'long' ) -Init.InPort( 'max' , 'long' ) -Init.InPort( 'medfield' , 'objref' ) -Init.InPort( 'x1' , 'double' ) -Init.InPort( 'aVisu' , 'objref' ) -Init.InPort( 'aView' , 'objref' ) -Init.OutPort( 'index' , 'long' ) -Init.OutPort( 'min' , 'long' ) -Init.OutPort( 'max' , 'long' ) -Init.OutPort( 'medfield' , 'objref' ) -Init.OutPort( 'x1' , 'double' ) -Init.OutPort( 'aVisu' , 'objref' ) -Init.OutPort( 'aView' , 'objref' ) -Init.SetName( 'Init' ) -Init.SetAuthor( 'LD' ) -Init.SetComment( 'no comment' ) -Init.Coords( 205 , 63 ) - -# Creation of Links -InitDisplayaVisu = InitDisplay.Port( 'aVisu' ) -InitaVisu = LoopGraph.Link( InitDisplayaVisu , Init.Port( 'aVisu' ) ) - -InitDisplayaView = InitDisplay.Port( 'aView' ) -InitaView = LoopGraph.Link( InitDisplayaView , Init.Port( 'aView' ) ) - -Initindex = Init.Port( 'index' ) -EndInitindex = LoopGraph.Link( Initindex , EndInit.Port( 'index' ) ) - -DisplayMedindex = LoopGraph.Link( Initindex , DisplayMed.Port( 'index' ) ) -DisplayMedindex.AddCoord( 1 , 566 , 215 ) -DisplayMedindex.AddCoord( 2 , 566 , 96 ) - -Initmin = Init.Port( 'min' ) -EndInitmin = LoopGraph.Link( Initmin , EndInit.Port( 'min' ) ) - -Initmax = Init.Port( 'max' ) -EndInitmax = LoopGraph.Link( Initmax , EndInit.Port( 'max' ) ) - -Initmedfield = Init.Port( 'medfield' ) -Mulfield1 = LoopGraph.Link( Initmedfield , Mul.Port( 'field1' ) ) - -Initx1 = Init.Port( 'x1' ) -EndInitx1 = LoopGraph.Link( Initx1 , EndInit.Port( 'x1' ) ) - -Mulx1 = LoopGraph.Link( Initx1 , Mul.Port( 'x1' ) ) - -InitaVisu = Init.Port( 'aVisu' ) -EndInitaVisu = LoopGraph.Link( InitaVisu , EndInit.Port( 'aVisu' ) ) - -DisplayMedaVisu = LoopGraph.Link( InitaVisu , DisplayMed.Port( 'aVisu' ) ) -DisplayMedaVisu.AddCoord( 1 , 570 , 242 ) -DisplayMedaVisu.AddCoord( 2 , 569 , 263 ) -DisplayMedaVisu.AddCoord( 3 , 377 , 264 ) -DisplayMedaVisu.AddCoord( 4 , 376 , 242 ) - -InitaView = Init.Port( 'aView' ) -EndInitaView = LoopGraph.Link( InitaView , EndInit.Port( 'aView' ) ) - -DisplayMedaView = LoopGraph.Link( InitaView , DisplayMed.Port( 'aView' ) ) - -Mulreturn = Mul.Port( 'return' ) -DisplayMedINmedfield = LoopGraph.Link( Mulreturn , DisplayMed.Port( 'INmedfield' ) ) - -DisplayMedOUTmedfield = DisplayMed.Port( 'OUTmedfield' ) -EndInitmedfield = LoopGraph.Link( DisplayMedOUTmedfield , EndInit.Port( 'medfield' ) ) - -# Creation of Input datas -Initindex = Init.Input( 'index' , 0) -Initmin = Init.Input( 'min' , 0) -Initmax = Init.Input( 'max' , 4) -Initx1 = Init.Input( 'x1' , 2) - -# Missing Input datas -Initmedfield = Init.Port( 'medfield' ) - -# Creation of Output variables -EndInitindex = EndInit.Port( 'index' ) -EndInitmin = EndInit.Port( 'min' ) -EndInitmax = EndInit.Port( 'max' ) -EndInitmedfield = EndInit.Port( 'medfield' ) -EndInitx1 = EndInit.Port( 'x1' ) -EndInitaVisu = EndInit.Port( 'aVisu' ) -EndInitaView = EndInit.Port( 'aView' ) +# Graph creation of TestSupervMedfieldLoopForiVisu +def DefTestSupervMedfieldLoopForiVisu() : + TestSupervMedfieldLoopForiVisu = Graph( 'TestSupervMedfieldLoopForiVisu' ) + TestSupervMedfieldLoopForiVisu.SetName( 'TestSupervMedfieldLoopForiVisu' ) + TestSupervMedfieldLoopForiVisu.SetAuthor( '' ) + TestSupervMedfieldLoopForiVisu.SetComment( '' ) + TestSupervMedfieldLoopForiVisu.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + Mul = TestSupervMedfieldLoopForiVisu.FNode( 'Calculator' , 'Calculator' , 'Mul' ) + Mul.SetName( 'Mul' ) + Mul.SetAuthor( 'LD' ) + Mul.SetContainer( 'localhost/FactoryServer' ) + Mul.SetComment( 'Multiply a field by a constant' ) + Mul.Coords( 387 , 104 ) + IMulfield1 = Mul.GetInPort( 'field1' ) + IMulx1 = Mul.GetInPort( 'x1' ) + IMulGate = Mul.GetInPort( 'Gate' ) + OMulreturn = Mul.GetOutPort( 'return' ) + OMulGate = Mul.GetOutPort( 'Gate' ) + + # Creation of InLine Nodes + PyInitDisplay = [] + PyInitDisplay.append( 'from LifeCycleCORBA import * ' ) + PyInitDisplay.append( 'from VISU import * ' ) + PyInitDisplay.append( 'def InitDisplay(): ' ) + PyInitDisplay.append( ' # initialize the ORB ' ) + PyInitDisplay.append( ' orb = CORBA.ORB_init([], CORBA.ORB_ID) ' ) + PyInitDisplay.append( ' # create an LifeCycleCORBA instance ' ) + PyInitDisplay.append( ' lcc = LifeCycleCORBA(orb) ' ) + PyInitDisplay.append( ' # ----------------------------------------- ' ) + PyInitDisplay.append( ' # loading visu component ' ) + PyInitDisplay.append( ' aVisu = lcc.FindOrLoadComponent("FactoryServer","VISU") ' ) + PyInitDisplay.append( ' print "InitDisplay --> aVisu = ",aVisu ' ) + PyInitDisplay.append( ' aViewManager = aVisu.GetViewManager() ' ) + PyInitDisplay.append( ' print "InitDisplay --> aViewManager = ",aViewManager ' ) + PyInitDisplay.append( ' # aView = aViewManager.GetCurrentView() ' ) + PyInitDisplay.append( ' aView = aViewManager.Create3DView() ' ) + PyInitDisplay.append( ' print "InitDisplay --> aView = ",aView ' ) + PyInitDisplay.append( ' return aVisu,aView ' ) + InitDisplay = TestSupervMedfieldLoopForiVisu.INode( 'InitDisplay' , PyInitDisplay ) + InitDisplay.SetName( 'InitDisplay' ) + InitDisplay.SetAuthor( '' ) + InitDisplay.SetComment( 'Compute Node' ) + InitDisplay.Coords( 0 , 163 ) + IInitDisplayGate = InitDisplay.GetInPort( 'Gate' ) + OInitDisplayaVisu = InitDisplay.OutPort( 'aVisu' , 'objref' ) + OInitDisplayaView = InitDisplay.OutPort( 'aView' , 'objref' ) + OInitDisplayGate = InitDisplay.GetOutPort( 'Gate' ) + + PyDisplayMed = [] + PyDisplayMed.append( 'import os ' ) + PyDisplayMed.append( 'import SALOME_MED ' ) + PyDisplayMed.append( 'from VISU import * ' ) + PyDisplayMed.append( 'from LifeCycleCORBA import * ' ) + PyDisplayMed.append( 'def DisplayMed(medfield,index,aVisu,aView): ' ) + PyDisplayMed.append( ' # initialize the ORB ' ) + PyDisplayMed.append( ' orb = CORBA.ORB_init([''], CORBA.ORB_ID) ' ) + PyDisplayMed.append( ' # create an LifeCycleCORBA instance ' ) + PyDisplayMed.append( ' lcc = LifeCycleCORBA(orb) ' ) + PyDisplayMed.append( ' print " " ' ) + PyDisplayMed.append( ' print "***************************************************************" ' ) + PyDisplayMed.append( ' calc = lcc.FindOrLoadComponent("FactoryServer", "Calculator") ' ) + PyDisplayMed.append( ' print "-----> calc = ",calc ' ) + PyDisplayMed.append( ' medfilename = "/tmp/LoopGraphFile" + str(index) + ".med" ' ) + PyDisplayMed.append( ' print "-----> Writing Med field in temporary file : ",medfilename ' ) + PyDisplayMed.append( ' calc.writeMEDfile(medfield,medfilename) ' ) + PyDisplayMed.append( ' print "-----> calc = ",calc ' ) + PyDisplayMed.append( ' print "***************************************************************" ' ) + PyDisplayMed.append( ' myResult1 = aVisu.ImportFile(medfilename) ' ) + PyDisplayMed.append( ' print "-----> myResult1 = ",myResult1 ' ) + PyDisplayMed.append( ' field_name = medfield.getName() ' ) + PyDisplayMed.append( ' print "-----> field_name = ",field_name ' ) + PyDisplayMed.append( ' mesh_name = medfield.getSupport().getMesh().getName() ' ) + PyDisplayMed.append( ' print "-----> mesh_name = ",mesh_name ' ) + PyDisplayMed.append( ' aMesh1 = aVisu.MeshOnEntity(myResult1,mesh_name,CELL) ' ) + PyDisplayMed.append( ' print "-----> aMesh1 = ",aMesh1 ' ) + PyDisplayMed.append( ' aScalarMap1 = aVisu.ScalarMapOnField(myResult1,mesh_name,NODE,field_name,1) ' ) + PyDisplayMed.append( ' print "-----> aScalarMap1 = ",aScalarMap1 ' ) + PyDisplayMed.append( ' aView.DisplayOnly(aScalarMap1) ' ) + PyDisplayMed.append( ' aView.FitAll() ' ) + PyDisplayMed.append( ' command = "rm " + medfilename ' ) + PyDisplayMed.append( ' os.system(command) ' ) + PyDisplayMed.append( ' print "-----> Delete temporary Med file : ",medfilename ' ) + PyDisplayMed.append( ' print "***************************************************************" ' ) + PyDisplayMed.append( ' print " " ' ) + PyDisplayMed.append( ' return medfield ' ) + DisplayMed = TestSupervMedfieldLoopForiVisu.INode( 'DisplayMed' , PyDisplayMed ) + DisplayMed.SetName( 'DisplayMed' ) + DisplayMed.SetAuthor( '' ) + DisplayMed.SetComment( 'Compute Node' ) + DisplayMed.Coords( 594 , 105 ) + IDisplayMedINmedfield = DisplayMed.InPort( 'INmedfield' , 'objref' ) + IDisplayMedindex = DisplayMed.InPort( 'index' , 'long' ) + IDisplayMedaVisu = DisplayMed.InPort( 'aVisu' , 'objref' ) + IDisplayMedaView = DisplayMed.InPort( 'aView' , 'objref' ) + IDisplayMedGate = DisplayMed.GetInPort( 'Gate' ) + ODisplayMedOUTmedfield = DisplayMed.OutPort( 'OUTmedfield' , 'objref' ) + ODisplayMedGate = DisplayMed.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyInit = [] + PyInit.append( 'def Init(index,min,max,medfield,x1,aVisu,aView): ' ) + PyInit.append( ' if max >= min : ' ) + PyInit.append( ' index = min ' ) + PyInit.append( ' else : ' ) + PyInit.append( ' index = max ' ) + PyInit.append( ' print "Init --> index = ",index ' ) + PyInit.append( ' print " min = ",min ' ) + PyInit.append( ' print " max = ",max ' ) + PyInit.append( ' print " medfield = ",medfield ' ) + PyInit.append( ' return index,min,max,medfield,x1,aVisu,aView ' ) + PyMoreInit = [] + PyMoreInit.append( 'def More(index,min,max,medfield,x1,aVisu,aView): ' ) + PyMoreInit.append( ' if max >= index : ' ) + PyMoreInit.append( ' DoLoop = 1 ' ) + PyMoreInit.append( ' else : ' ) + PyMoreInit.append( ' DoLoop = 0 ' ) + PyMoreInit.append( ' print "More --> DoLoop = ",DoLoop ' ) + PyMoreInit.append( ' print " index = ",index ' ) + PyMoreInit.append( ' print " min = ",min ' ) + PyMoreInit.append( ' print " max = ",max ' ) + PyMoreInit.append( ' print " medfield = ",medfield ' ) + PyMoreInit.append( ' return DoLoop,index,min,max,medfield,x1,aVisu,aView ' ) + PyNextInit = [] + PyNextInit.append( 'def Next(index,min,max,medfield,x1,aVisu,aView): ' ) + PyNextInit.append( ' index = index + 1 ' ) + PyNextInit.append( ' print "Next --> index = ",index ' ) + PyNextInit.append( ' print " min = ",min ' ) + PyNextInit.append( ' print " max = ",max ' ) + PyNextInit.append( ' print " medfield = ",medfield ' ) + PyNextInit.append( ' return index,min,max,medfield,x1,aVisu,aView ' ) + Init,EndInit = TestSupervMedfieldLoopForiVisu.LNode( 'Init' , PyInit , 'More' , PyMoreInit , 'Next' , PyNextInit ) + EndInit.SetName( 'EndInit' ) + EndInit.SetAuthor( 'LD' ) + EndInit.SetComment( 'no comment' ) + EndInit.Coords( 776 , 64 ) + PyEndInit = [] + EndInit.SetPyFunction( '' , PyEndInit ) + IInitDoLoop = Init.GetInPort( 'DoLoop' ) + IInitindex = Init.InPort( 'index' , 'long' ) + IInitmin = Init.InPort( 'min' , 'long' ) + IInitmax = Init.InPort( 'max' , 'long' ) + IInitmedfield = Init.InPort( 'medfield' , 'objref' ) + IInitx1 = Init.InPort( 'x1' , 'double' ) + IInitaVisu = Init.InPort( 'aVisu' , 'objref' ) + IInitaView = Init.InPort( 'aView' , 'objref' ) + IInitGate = Init.GetInPort( 'Gate' ) + OInitDoLoop = Init.GetOutPort( 'DoLoop' ) + OInitindex = Init.GetOutPort( 'index' ) + OInitmin = Init.GetOutPort( 'min' ) + OInitmax = Init.GetOutPort( 'max' ) + OInitmedfield = Init.GetOutPort( 'medfield' ) + OInitx1 = Init.GetOutPort( 'x1' ) + OInitaVisu = Init.GetOutPort( 'aVisu' ) + OInitaView = Init.GetOutPort( 'aView' ) + IEndInitDoLoop = EndInit.GetInPort( 'DoLoop' ) + IEndInitindex = EndInit.GetInPort( 'index' ) + IEndInitmin = EndInit.GetInPort( 'min' ) + IEndInitmax = EndInit.GetInPort( 'max' ) + IEndInitmedfield = EndInit.GetInPort( 'medfield' ) + IEndInitx1 = EndInit.GetInPort( 'x1' ) + IEndInitaVisu = EndInit.GetInPort( 'aVisu' ) + IEndInitaView = EndInit.GetInPort( 'aView' ) + IEndInitGate = EndInit.GetInPort( 'Gate' ) + OEndInitDoLoop = EndInit.GetOutPort( 'DoLoop' ) + OEndInitindex = EndInit.GetOutPort( 'index' ) + OEndInitmin = EndInit.GetOutPort( 'min' ) + OEndInitmax = EndInit.GetOutPort( 'max' ) + OEndInitmedfield = EndInit.GetOutPort( 'medfield' ) + OEndInitx1 = EndInit.GetOutPort( 'x1' ) + OEndInitaVisu = EndInit.GetOutPort( 'aVisu' ) + OEndInitaView = EndInit.GetOutPort( 'aView' ) + OEndInitGate = EndInit.GetOutPort( 'Gate' ) + Init.SetName( 'Init' ) + Init.SetAuthor( 'LD' ) + Init.SetComment( 'no comment' ) + Init.Coords( 205 , 63 ) + + # Creation of Links + LInitDisplayaVisuInitaVisu = TestSupervMedfieldLoopForiVisu.Link( OInitDisplayaVisu , IInitaVisu ) + + LInitDisplayaViewInitaView = TestSupervMedfieldLoopForiVisu.Link( OInitDisplayaView , IInitaView ) + + LInitindexEndInitindex = TestSupervMedfieldLoopForiVisu.Link( OInitindex , IEndInitindex ) + + LInitindexDisplayMedindex = TestSupervMedfieldLoopForiVisu.Link( OInitindex , IDisplayMedindex ) + LInitindexDisplayMedindex.AddCoord( 1 , 566 , 215 ) + LInitindexDisplayMedindex.AddCoord( 2 , 566 , 96 ) + + LInitminEndInitmin = TestSupervMedfieldLoopForiVisu.Link( OInitmin , IEndInitmin ) + + LInitmaxEndInitmax = TestSupervMedfieldLoopForiVisu.Link( OInitmax , IEndInitmax ) + + LInitmedfieldMulfield1 = TestSupervMedfieldLoopForiVisu.Link( OInitmedfield , IMulfield1 ) + + LInitx1EndInitx1 = TestSupervMedfieldLoopForiVisu.Link( OInitx1 , IEndInitx1 ) + + LInitx1Mulx1 = TestSupervMedfieldLoopForiVisu.Link( OInitx1 , IMulx1 ) + + LInitaVisuEndInitaVisu = TestSupervMedfieldLoopForiVisu.Link( OInitaVisu , IEndInitaVisu ) + + LInitaVisuDisplayMedaVisu = TestSupervMedfieldLoopForiVisu.Link( OInitaVisu , IDisplayMedaVisu ) + LInitaVisuDisplayMedaVisu.AddCoord( 1 , 570 , 242 ) + LInitaVisuDisplayMedaVisu.AddCoord( 2 , 569 , 263 ) + LInitaVisuDisplayMedaVisu.AddCoord( 3 , 377 , 264 ) + LInitaVisuDisplayMedaVisu.AddCoord( 4 , 376 , 242 ) + + LInitaViewEndInitaView = TestSupervMedfieldLoopForiVisu.Link( OInitaView , IEndInitaView ) + + LInitaViewDisplayMedaView = TestSupervMedfieldLoopForiVisu.Link( OInitaView , IDisplayMedaView ) + + LMulreturnDisplayMedINmedfield = TestSupervMedfieldLoopForiVisu.Link( OMulreturn , IDisplayMedINmedfield ) + + LDisplayMedOUTmedfieldEndInitmedfield = TestSupervMedfieldLoopForiVisu.Link( ODisplayMedOUTmedfield , IEndInitmedfield ) + + # Input datas + IInitindex.Input( 0 ) + IInitmin.Input( 0 ) + IInitmax.Input( 4 ) + IInitx1.Input( 2 ) + + # Input Ports of the graph + #IInitmedfield = Init.GetInPort( 'medfield' ) + + # Output Ports of the graph + #OEndInitindex = EndInit.GetOutPort( 'index' ) + #OEndInitmin = EndInit.GetOutPort( 'min' ) + #OEndInitmax = EndInit.GetOutPort( 'max' ) + #OEndInitmedfield = EndInit.GetOutPort( 'medfield' ) + #OEndInitx1 = EndInit.GetOutPort( 'x1' ) + #OEndInitaVisu = EndInit.GetOutPort( 'aVisu' ) + #OEndInitaView = EndInit.GetOutPort( 'aView' ) + return TestSupervMedfieldLoopForiVisu + + +TestSupervMedfieldLoopForiVisu = DefTestSupervMedfieldLoopForiVisu() diff --git a/examples/TestSupervMedfieldLoopForiVisu.xml b/examples/TestSupervMedfieldLoopForiVisu.xml index 569f0f7..9604a66 100755 --- a/examples/TestSupervMedfieldLoopForiVisu.xml +++ b/examples/TestSupervMedfieldLoopForiVisu.xml @@ -1,536 +1,539 @@ - + + ? - ? - LoopGraph - 1 - ? - -LoopGraph - + ? + TestSupervMedfieldLoopForiVisu + 1 + ? + +LoopGraph_1 + long - Init\index - + Init__index + long - Init\min - + Init__min + long - Init\max - + Init__max + objref - Init\medfield - + Init__medfield + double - Init\x1 - + Init__x1 + long - EndInit\index - + EndInit__index + long - EndInit\min - + EndInit__min + long - EndInit\max - + EndInit__max + objref - EndInit\medfield - + EndInit__medfield + double - EndInit\x1 - + EndInit__x1 + objref - EndInit\aVisu - + EndInit__aVisu + objref - EndInit\aView - - - 20/6/2003 - 15:13:42 - 19/9/2003 - 16:10:16 - 1.04 - ? - ? - ? - 0 - 0 - + EndInit__aView + + + 20/6/2003 - 15:13:42 + 8/4/2005 - 13:52:51 + 1.04 + ? + ? + ? + 0 + 0 + ? - ? - InitDisplay - 3 - ? - + ? + InitDisplay + 3 + ? + InitDisplay - - + + objref - aVisu - + aVisu + objref - aView - - + aView + + InitDisplay - - - - - - - - - - - aVisu = ",aVisu ]]> - - aViewManager = ",aViewManager ]]> - - - aView = ",aView ]]> - - 19/9/2003 - 16:10:16 - 19/9/2003 - 16:10:16 - 1.04 - ? - ? - Compute Node - 0 - 163 - + + + + + + + + + + + aVisu = ",aVisu ]]> + + aViewManager = ",aViewManager ]]> + + + aView = ",aView ]]> + + 8/4/2005 - 13:52:51 + 8/4/2005 - 13:52:51 + 1.04 + ? + ? + Compute Node + 0 + 163 + ? - ? - Init - 4 - EndInit - + ? + Init + 4 + EndInit + Init - + long - index - + index + long - min - + min + long - max - + max + objref - medfield - + medfield + double - x1 - + x1 + objref - aVisu - + aVisu + objref - aView - + aView + long - index - + index + long - min - + min + long - max - + max + objref - medfield - + medfield + double - x1 - + x1 + objref - aVisu - + aVisu + objref - aView - - + aView + + Init - - = min : ]]> - - - - index = ",index ]]> - - - - - + + = min : ]]> + + + + index = ",index ]]> + + + + + More - - = index : ]]> - - - - DoLoop = ",DoLoop ]]> - - - - - - + + = index : ]]> + + + + DoLoop = ",DoLoop ]]> + + + + + + Next - - - index = ",index ]]> - - - - - 19/9/2003 - 16:10:16 - 19/9/2003 - 16:10:16 - 1.04 - LD - ? - no comment - 205 - 63 - + + + index = ",index ]]> + + + + + 8/4/2005 - 13:52:51 + 8/4/2005 - 13:52:51 + 1.04 + LD + ? + no comment + 205 + 63 + ? - ? - EndInit - 5 - Init - + ? + EndInit + 5 + Init + EndInit - + long - index - + index + long - min - + min + long - max - + max + objref - medfield - + medfield + double - x1 - + x1 + objref - aVisu - + aVisu + objref - aView - + aView + long - index - + index + long - min - + min + long - max - + max + objref - medfield - + medfield + double - x1 - + x1 + objref - aVisu - + aVisu + objref - aView - - - - 19/9/2003 - 16:10:16 - 19/9/2003 - 16:10:16 - 1.04 - LD - ? - no comment - 776 - 64 - + aView + + + +? + + 8/4/2005 - 13:52:51 + 8/4/2005 - 13:52:51 + 1.04 + LD + ? + no comment + 776 + 64 + Calculator - Calculator - Mul - 0 - ? - + Calculator + Mul + 0 + ? + Mul - + objref - field1 - + field1 + double - x1 - + x1 + objref - return - - - 19/9/2003 - 16:10:16 - 19/9/2003 - 16:10:16 - 1.04 - LD - localhost/FactoryServer - Multiply a field by a constant - 387 - 104 - + return + + + 8/4/2005 - 13:52:51 + 8/4/2005 - 13:52:51 + 1.04 + LD + localhost/FactoryServer + Multiply a field by a constant + 387 + 104 + ? - ? - DisplayMed - 3 - ? - + ? + DisplayMed + 3 + ? + DisplayMed - + objref - INmedfield - + INmedfield + long - index - + index + objref - aVisu - + aVisu + objref - aView - + aView + objref - OUTmedfield - - + OUTmedfield + + DisplayMed - - - - - - - - - - - - - calc = ",calc ]]> - - Writing Med field in temporary file : ",medfilename ]]> - - calc = ",calc ]]> - - - myResult1 = ",myResult1 ]]> - - field_name = ",field_name ]]> - - mesh_name = ",mesh_name ]]> - - aMesh1 = ",aMesh1 ]]> - - aScalarMap1 = ",aScalarMap1 ]]> - - - - - Delete temporary Med file : ",medfilename ]]> - - - - 19/9/2003 - 16:10:16 - 19/9/2003 - 16:10:16 - 1.04 - ? - ? - Compute Node - 594 - 105 - + + + + + + + + + + + + + calc = ",calc ]]> + + Writing Med field in temporary file : ",medfilename ]]> + + calc = ",calc ]]> + + + myResult1 = ",myResult1 ]]> + + field_name = ",field_name ]]> + + mesh_name = ",mesh_name ]]> + + aMesh1 = ",aMesh1 ]]> + + aScalarMap1 = ",aScalarMap1 ]]> + + + + + Delete temporary Med file : ",medfilename ]]> + + + + 8/4/2005 - 13:52:51 + 8/4/2005 - 13:52:51 + 1.04 + ? + ? + Compute Node + 594 + 105 + InitDisplay - aVisu - Init - aVisu - - + aVisu + Init + aVisu + + InitDisplay - aView - Init - aView - - + aView + Init + aView + + Init - DoLoop - EndInit - DoLoop - - + DoLoop + EndInit + DoLoop + + Init - index - EndInit - index - - + index + EndInit + index + + Init - index - DisplayMed - index - + index + DisplayMed + index + 566 - 215 - + 215 + 566 - 96 - + 96 + Init - min - EndInit - min - - + min + EndInit + min + + Init - max - EndInit - max - - + max + EndInit + max + + Init - medfield - Mul - field1 - - + medfield + Mul + field1 + + Init - x1 - EndInit - x1 - - + x1 + EndInit + x1 + + Init - x1 - Mul - x1 - - + x1 + Mul + x1 + + Init - aVisu - EndInit - aVisu - - + aVisu + EndInit + aVisu + + Init - aVisu - DisplayMed - aVisu - + aVisu + DisplayMed + aVisu + 570 - 242 - + 242 + 569 - 263 - + 263 + 377 - 264 - + 264 + 376 - 242 - + 242 + Init - aView - EndInit - aView - - + aView + EndInit + aView + + Init - aView - DisplayMed - aView - - + aView + DisplayMed + aView + + EndInit - DoLoop - Init - DoLoop - + DoLoop + Init + DoLoop + 205 - 233 - + 233 + 204 - 21 - + 21 + 936 - 20 - + 20 + 935 - 235 - + 235 + Mul - return - DisplayMed - INmedfield - - + return + DisplayMed + INmedfield + + DisplayMed - OUTmedfield - EndInit - medfield - - + OUTmedfield + EndInit + medfield + + -LoopGraph - Init\index - Init - index - +TestSupervMedfieldLoopForiVisu + Init__index + Init + index + 3 - 0 - - -LoopGraph - Init\min - Init - min - + 0 + + +TestSupervMedfieldLoopForiVisu + Init__min + Init + min + 3 - 0 - - -LoopGraph - Init\max - Init - max - + 0 + + +TestSupervMedfieldLoopForiVisu + Init__max + Init + max + 3 - 4 - - -LoopGraph - Init\x1 - Init - x1 - + 4 + + +TestSupervMedfieldLoopForiVisu + Init__x1 + Init + x1 + 7 - 2 - + 2 + diff --git a/examples/testvisu20.xml b/examples/testvisu20.xml index bfb5866..532ee48 100644 --- a/examples/testvisu20.xml +++ b/examples/testvisu20.xml @@ -1,490 +1,493 @@ - + + ? - ? - aNewDataFlow - 1 - ? - -aNewDataFlow - + ? + TestVisu20 + 1 + ? + +aNewDataFlow_1 + long - Init\index - + Init__index + long - Init\min - + Init__min + long - Init\max - + Init__max + double - Init\x1 - + Init__x1 + long - EndOfInit\index - + EndOfInit__index + long - EndOfInit\min - + EndOfInit__min + long - EndOfInit\max - + EndOfInit__max + objref - EndOfInit\aVisu - + EndOfInit__aVisu + objref - EndOfInit\aView - + EndOfInit__aView + objref - EndOfInit\aResult - + EndOfInit__aResult + double - EndOfInit\x1 - - - 13/11/2003 - 11:15:53 - 19/1/2004 - 15:33:34 - 1.05 - ? - ? - ? - 0 - 0 - + EndOfInit__x1 + + + 13/11/2003 - 11:15:53 + 8/4/2005 - 14:3:47 + 1.05 + ? + ? + ? + 0 + 0 + ? - ? - InitDisplay - 3 - ? - + ? + InitDisplay + 3 + ? + InitDisplay - - + + objref - aVisu - + aVisu + objref - aView - + aView + objref - myResult - - + myResult + + InitDisplay - - - - - - - - - - - - - - - - - - - - - aVisu ", aVisu ]]> - - - aViewManager ", aViewManager ]]> - - - - aView ", aView ]]> - - - - - myResult ", myResult ]]> - - - 19/1/2004 - 15:33:34 - 19/1/2004 - 15:33:34 - 1.05 - ? - ? - Compute Node - 0 - 46 - + + + + + + + + + + + + + + + + + + + + + aVisu ", aVisu ]]> + + + aViewManager ", aViewManager ]]> + + + + aView ", aView ]]> + + + + + myResult ", myResult ]]> + + + 8/4/2005 - 14:3:47 + 8/4/2005 - 14:3:47 + 1.05 + ? + ? + Compute Node + 0 + 46 + ? - ? - Init - 4 - EndOfInit - + ? + Init + 4 + EndOfInit + Init - + long - index - + index + long - min - + min + long - max - + max + objref - aVisu - + aVisu + objref - aView - + aView + objref - aResult - + aResult + double - x1 - + x1 + long - index - + index + long - min - + min + long - max - + max + objref - aVisu - + aVisu + objref - aView - + aView + objref - aResult - + aResult + double - x1 - - + x1 + + Init - - = min : ]]> - - - - - - + + = min : ]]> + + + + + + More - - = index : ]]> - - - - - - + + = index : ]]> + + + + + + Next - - - - - - 19/1/2004 - 15:33:34 - 19/1/2004 - 15:33:34 - 1.05 - ? - ? - ? - 190 - 4 - + + + + + + 8/4/2005 - 14:3:47 + 8/4/2005 - 14:3:47 + 1.05 + ? + ? + Compute Node + 190 + 4 + ? - ? - EndOfInit - 5 - Init - + ? + EndOfInit + 5 + Init + EndOfInit - + long - index - + index + long - min - + min + long - max - + max + objref - aVisu - + aVisu + objref - aView - + aView + objref - aResult - + aResult + double - x1 - + x1 + long - index - + index + long - min - + min + long - max - + max + objref - aVisu - + aVisu + objref - aView - + aView + objref - aResult - + aResult + double - x1 - - - - 19/1/2004 - 15:33:34 - 19/1/2004 - 15:33:34 - 1.05 - ? - ? - ? - 553 - 5 - + x1 + + + +? + + 8/4/2005 - 14:3:47 + 8/4/2005 - 14:3:47 + 1.05 + ? + ? + Compute Node + 553 + 5 + ? - ? - DisplayVitesse - 3 - ? - + ? + DisplayVitesse + 3 + ? + DisplayVitesse - + string - index - + index + objref - aVisu - + aVisu + objref - aView - + aView + objref - aResult - + aResult + double - x1 - + x1 + objref - theResult - - + theResult + + DisplayVitesse - - - - - - - - - - - - - - - - - - - - - - - - - - 19/1/2004 - 15:33:34 - 19/1/2004 - 15:33:34 - 1.05 - ? - ? - Compute Node - 374 - 16 - + + + + + + + + + + + + + + + + + + + + + + + + + + 8/4/2005 - 14:3:47 + 8/4/2005 - 14:3:47 + 1.05 + ? + ? + Compute Node + 374 + 16 + InitDisplay - aVisu - Init - aVisu - - + aVisu + Init + aVisu + + InitDisplay - aView - Init - aView - - + aView + Init + aView + + InitDisplay - myResult - Init - aResult - - + myResult + Init + aResult + + Init - DoLoop - EndOfInit - DoLoop - - + DoLoop + EndOfInit + DoLoop + + Init - index - EndOfInit - index - - + index + EndOfInit + index + + Init - index - DisplayVitesse - index - + index + DisplayVitesse + index + 351 - 96 - + 96 + 350 - 38 - + 38 + Init - min - EndOfInit - min - - + min + EndOfInit + min + + Init - max - EndOfInit - max - - + max + EndOfInit + max + + Init - aVisu - EndOfInit - aVisu - - + aVisu + EndOfInit + aVisu + + Init - aVisu - DisplayVitesse - aVisu - - + aVisu + DisplayVitesse + aVisu + + Init - aView - EndOfInit - aView - - + aView + EndOfInit + aView + + Init - aView - DisplayVitesse - aView - - + aView + DisplayVitesse + aView + + Init - aResult - DisplayVitesse - aResult - - + aResult + DisplayVitesse + aResult + + Init - x1 - EndOfInit - x1 - - + x1 + EndOfInit + x1 + + Init - x1 - DisplayVitesse - x1 - - + x1 + DisplayVitesse + x1 + + EndOfInit - DoLoop - Init - DoLoop - - + DoLoop + Init + DoLoop + + DisplayVitesse - theResult - EndOfInit - aResult - + theResult + EndOfInit + aResult + 548 - 183 - + 183 + 548 - 97 - + 97 + -aNewDataFlow - Init\index - Init - index - +TestVisu20 + Init__index + Init + index + 3 - 1 - - -aNewDataFlow - Init\min - Init - min - + 1 + + +TestVisu20 + Init__min + Init + min + 3 - 1 - - -aNewDataFlow - Init\max - Init - max - + 1 + + +TestVisu20 + Init__max + Init + max + 3 - 100 - - -aNewDataFlow - Init\x1 - Init - x1 - + 100 + + +TestVisu20 + Init__x1 + Init + x1 + 7 - 1 - + 1 + diff --git a/examples/testvisu20_multi.py b/examples/testvisu20_multi.py index b83273a..55c5c67 100644 --- a/examples/testvisu20_multi.py +++ b/examples/testvisu20_multi.py @@ -1,15 +1,15 @@ -# Generated python file of Graph aNewDataFlow +# Generated python file of Graph TestVisu20_multi from SuperV import * -# Graph creation of aNewDataFlow -def DefaNewDataFlow() : - aNewDataFlow = Graph( 'aNewDataFlow' ) - aNewDataFlow.SetName( 'aNewDataFlow' ) - aNewDataFlow.SetAuthor( '' ) - aNewDataFlow.SetComment( '' ) - aNewDataFlow.Coords( 0 , 0 ) +# Graph creation of TestVisu20_multi +def DefTestVisu20_multi() : + TestVisu20_multi = Graph( 'TestVisu20_multi' ) + TestVisu20_multi.SetName( 'TestVisu20_multi' ) + TestVisu20_multi.SetAuthor( '' ) + TestVisu20_multi.SetComment( '' ) + TestVisu20_multi.Coords( 0 , 0 ) # Creation of Factory Nodes @@ -50,7 +50,7 @@ def DefaNewDataFlow() : PyInitDisplay.append( ' print "InitDisplay --> myResult ", myResult ' ) PyInitDisplay.append( ' return aVisu,myResult ' ) PyInitDisplay.append( '' ) - InitDisplay = aNewDataFlow.INode( 'InitDisplay' , PyInitDisplay ) + InitDisplay = TestVisu20_multi.INode( 'InitDisplay' , PyInitDisplay ) InitDisplay.SetName( 'InitDisplay' ) InitDisplay.SetAuthor( '' ) InitDisplay.SetComment( 'Compute Node' ) @@ -86,7 +86,7 @@ def DefaNewDataFlow() : PyDisplayVitesse.append( ' #time.sleep(2) ' ) PyDisplayVitesse.append( ' return theResult ' ) PyDisplayVitesse.append( '' ) - DisplayVitesse = aNewDataFlow.INode( 'DisplayVitesse' , PyDisplayVitesse ) + DisplayVitesse = TestVisu20_multi.INode( 'DisplayVitesse' , PyDisplayVitesse ) DisplayVitesse.SetName( 'DisplayVitesse' ) DisplayVitesse.SetAuthor( '' ) DisplayVitesse.SetComment( 'Compute Node' ) @@ -107,7 +107,7 @@ def DefaNewDataFlow() : PyCreateView.append( ' theVisu=aVisu ' ) PyCreateView.append( ' theResult=aResult ' ) PyCreateView.append( ' return aView,theVisu,theResult ' ) - CreateView = aNewDataFlow.INode( 'CreateView' , PyCreateView ) + CreateView = TestVisu20_multi.INode( 'CreateView' , PyCreateView ) CreateView.SetName( 'CreateView' ) CreateView.SetAuthor( '' ) CreateView.SetComment( 'Compute Node' ) @@ -143,7 +143,7 @@ def DefaNewDataFlow() : PyNextInit.append( ' x1=x1+1.0 ' ) PyNextInit.append( ' print "---- Next",index,min,max,aVisu,aView,myResult,x1 ' ) PyNextInit.append( ' return index,min,max,aVisu,aView,myResult,x1 ' ) - Init,EndOfInit = aNewDataFlow.LNode( 'Init' , PyInit , 'More' , PyMoreInit , 'Next' , PyNextInit ) + Init,EndOfInit = TestVisu20_multi.LNode( 'Init' , PyInit , 'More' , PyMoreInit , 'Next' , PyNextInit ) EndOfInit.SetName( 'EndOfInit' ) EndOfInit.SetAuthor( '' ) EndOfInit.SetComment( 'Compute Node' ) @@ -203,7 +203,7 @@ def DefaNewDataFlow() : PyNextLoopOnViews.append( 'def NextViews( aVisu,aResult,ViewCount,MinCount,MaxCount ): ' ) PyNextLoopOnViews.append( ' ViewCount = ViewCount + 1 ' ) PyNextLoopOnViews.append( ' return aVisu,aResult,ViewCount,MinCount,MaxCount ' ) - LoopOnViews,EndOfLoopOnViews = aNewDataFlow.LNode( 'InitViews' , PyLoopOnViews , 'MoreViews' , PyMoreLoopOnViews , 'NextViews' , PyNextLoopOnViews ) + LoopOnViews,EndOfLoopOnViews = TestVisu20_multi.LNode( 'InitViews' , PyLoopOnViews , 'MoreViews' , PyMoreLoopOnViews , 'NextViews' , PyNextLoopOnViews ) EndOfLoopOnViews.SetName( 'EndOfLoopOnViews' ) EndOfLoopOnViews.SetAuthor( '' ) EndOfLoopOnViews.SetComment( 'Compute Node' ) @@ -243,69 +243,69 @@ def DefaNewDataFlow() : LoopOnViews.Coords( 219 , 218 ) # Creation of Links - LInitDisplayaVisuLoopOnViewsaVisu = aNewDataFlow.Link( OInitDisplayaVisu , ILoopOnViewsaVisu ) + LInitDisplayaVisuLoopOnViewsaVisu = TestVisu20_multi.Link( OInitDisplayaVisu , ILoopOnViewsaVisu ) - LInitDisplaymyResultLoopOnViewsaResult = aNewDataFlow.Link( OInitDisplaymyResult , ILoopOnViewsaResult ) + LInitDisplaymyResultLoopOnViewsaResult = TestVisu20_multi.Link( OInitDisplaymyResult , ILoopOnViewsaResult ) - LInitindexEndOfInitindex = aNewDataFlow.Link( OInitindex , IEndOfInitindex ) + LInitindexEndOfInitindex = TestVisu20_multi.Link( OInitindex , IEndOfInitindex ) - LInitindexDisplayVitesseindex = aNewDataFlow.Link( OInitindex , IDisplayVitesseindex ) + LInitindexDisplayVitesseindex = TestVisu20_multi.Link( OInitindex , IDisplayVitesseindex ) LInitindexDisplayVitesseindex.AddCoord( 1 , 590 , 587 ) LInitindexDisplayVitesseindex.AddCoord( 2 , 591 , 527 ) - LInitminEndOfInitmin = aNewDataFlow.Link( OInitmin , IEndOfInitmin ) + LInitminEndOfInitmin = TestVisu20_multi.Link( OInitmin , IEndOfInitmin ) - LInitmaxEndOfInitmax = aNewDataFlow.Link( OInitmax , IEndOfInitmax ) + LInitmaxEndOfInitmax = TestVisu20_multi.Link( OInitmax , IEndOfInitmax ) - LInitaVisuEndOfInitaVisu = aNewDataFlow.Link( OInitaVisu , IEndOfInitaVisu ) + LInitaVisuEndOfInitaVisu = TestVisu20_multi.Link( OInitaVisu , IEndOfInitaVisu ) - LInitaVisuDisplayVitesseaVisu = aNewDataFlow.Link( OInitaVisu , IDisplayVitesseaVisu ) + LInitaVisuDisplayVitesseaVisu = TestVisu20_multi.Link( OInitaVisu , IDisplayVitesseaVisu ) - LInitaViewEndOfInitaView = aNewDataFlow.Link( OInitaView , IEndOfInitaView ) + LInitaViewEndOfInitaView = TestVisu20_multi.Link( OInitaView , IEndOfInitaView ) - LInitaViewDisplayVitesseaView = aNewDataFlow.Link( OInitaView , IDisplayVitesseaView ) + LInitaViewDisplayVitesseaView = TestVisu20_multi.Link( OInitaView , IDisplayVitesseaView ) - LInitaResultDisplayVitesseaResult = aNewDataFlow.Link( OInitaResult , IDisplayVitesseaResult ) + LInitaResultDisplayVitesseaResult = TestVisu20_multi.Link( OInitaResult , IDisplayVitesseaResult ) - LInitx1EndOfInitx1 = aNewDataFlow.Link( OInitx1 , IEndOfInitx1 ) + LInitx1EndOfInitx1 = TestVisu20_multi.Link( OInitx1 , IEndOfInitx1 ) - LInitx1DisplayVitessex1 = aNewDataFlow.Link( OInitx1 , IDisplayVitessex1 ) + LInitx1DisplayVitessex1 = TestVisu20_multi.Link( OInitx1 , IDisplayVitessex1 ) - LEndOfInitaResultEndOfLoopOnViewsaResult = aNewDataFlow.Link( OEndOfInitaResult , IEndOfLoopOnViewsaResult ) + LEndOfInitaResultEndOfLoopOnViewsaResult = TestVisu20_multi.Link( OEndOfInitaResult , IEndOfLoopOnViewsaResult ) LEndOfInitaResultEndOfLoopOnViewsaResult.AddCoord( 1 , 762 , 288 ) LEndOfInitaResultEndOfLoopOnViewsaResult.AddCoord( 2 , 763 , 424 ) LEndOfInitaResultEndOfLoopOnViewsaResult.AddCoord( 3 , 972 , 425 ) LEndOfInitaResultEndOfLoopOnViewsaResult.AddCoord( 4 , 971 , 687 ) - LDisplayVitessetheResultEndOfInitaResult = aNewDataFlow.Link( ODisplayVitessetheResult , IEndOfInitaResult ) + LDisplayVitessetheResultEndOfInitaResult = TestVisu20_multi.Link( ODisplayVitessetheResult , IEndOfInitaResult ) LDisplayVitessetheResultEndOfInitaResult.AddCoord( 1 , 787 , 687 ) LDisplayVitessetheResultEndOfInitaResult.AddCoord( 2 , 786 , 585 ) - LLoopOnViewsaVisuEndOfLoopOnViewsaVisu = aNewDataFlow.Link( OLoopOnViewsaVisu , IEndOfLoopOnViewsaVisu ) + LLoopOnViewsaVisuEndOfLoopOnViewsaVisu = TestVisu20_multi.Link( OLoopOnViewsaVisu , IEndOfLoopOnViewsaVisu ) - LLoopOnViewsaVisuCreateViewaVisu = aNewDataFlow.Link( OLoopOnViewsaVisu , ICreateViewaVisu ) + LLoopOnViewsaVisuCreateViewaVisu = TestVisu20_multi.Link( OLoopOnViewsaVisu , ICreateViewaVisu ) LLoopOnViewsaVisuCreateViewaVisu.AddCoord( 1 , 186 , 643 ) LLoopOnViewsaVisuCreateViewaVisu.AddCoord( 2 , 186 , 442 ) LLoopOnViewsaVisuCreateViewaVisu.AddCoord( 3 , 400 , 441 ) LLoopOnViewsaVisuCreateViewaVisu.AddCoord( 4 , 401 , 251 ) - LLoopOnViewsaResultCreateViewaResult = aNewDataFlow.Link( OLoopOnViewsaResult , ICreateViewaResult ) + LLoopOnViewsaResultCreateViewaResult = TestVisu20_multi.Link( OLoopOnViewsaResult , ICreateViewaResult ) LLoopOnViewsaResultCreateViewaResult.AddCoord( 1 , 169 , 671 ) LLoopOnViewsaResultCreateViewaResult.AddCoord( 2 , 170 , 412 ) LLoopOnViewsaResultCreateViewaResult.AddCoord( 3 , 386 , 413 ) LLoopOnViewsaResultCreateViewaResult.AddCoord( 4 , 387 , 280 ) - LLoopOnViewsViewCountEndOfLoopOnViewsViewCount = aNewDataFlow.Link( OLoopOnViewsViewCount , IEndOfLoopOnViewsViewCount ) + LLoopOnViewsViewCountEndOfLoopOnViewsViewCount = TestVisu20_multi.Link( OLoopOnViewsViewCount , IEndOfLoopOnViewsViewCount ) - LLoopOnViewsMinCountEndOfLoopOnViewsMinCount = aNewDataFlow.Link( OLoopOnViewsMinCount , IEndOfLoopOnViewsMinCount ) + LLoopOnViewsMinCountEndOfLoopOnViewsMinCount = TestVisu20_multi.Link( OLoopOnViewsMinCount , IEndOfLoopOnViewsMinCount ) - LLoopOnViewsMaxCountEndOfLoopOnViewsMaxCount = aNewDataFlow.Link( OLoopOnViewsMaxCount , IEndOfLoopOnViewsMaxCount ) + LLoopOnViewsMaxCountEndOfLoopOnViewsMaxCount = TestVisu20_multi.Link( OLoopOnViewsMaxCount , IEndOfLoopOnViewsMaxCount ) - LCreateViewaViewInitaView = aNewDataFlow.Link( OCreateViewaView , IInitaView ) + LCreateViewaViewInitaView = TestVisu20_multi.Link( OCreateViewaView , IInitaView ) - LCreateViewtheVisuInitaVisu = aNewDataFlow.Link( OCreateViewtheVisu , IInitaVisu ) + LCreateViewtheVisuInitaVisu = TestVisu20_multi.Link( OCreateViewtheVisu , IInitaVisu ) - LCreateViewtheResultInitaResult = aNewDataFlow.Link( OCreateViewtheResult , IInitaResult ) + LCreateViewtheResultInitaResult = TestVisu20_multi.Link( OCreateViewtheResult , IInitaResult ) # Input datas IInitindex.Input( 1 ) @@ -328,7 +328,7 @@ def DefaNewDataFlow() : #OEndOfLoopOnViewsViewCount = EndOfLoopOnViews.GetOutPort( 'ViewCount' ) #OEndOfLoopOnViewsMinCount = EndOfLoopOnViews.GetOutPort( 'MinCount' ) #OEndOfLoopOnViewsMaxCount = EndOfLoopOnViews.GetOutPort( 'MaxCount' ) - return aNewDataFlow + return TestVisu20_multi -aNewDataFlow = DefaNewDataFlow() +TestVisu20_multi = DefTestVisu20_multi() diff --git a/examples/testvisu20_multi.xml b/examples/testvisu20_multi.xml index c8e247c..3023243 100644 --- a/examples/testvisu20_multi.xml +++ b/examples/testvisu20_multi.xml @@ -5,7 +5,7 @@ ? ? - aNewDataFlow + TestVisu20_multi 1 ? @@ -69,7 +69,7 @@ 13/11/2003 - 11:15:53 - 26/1/2005 - 15:3:36 + 8/4/2005 - 14:2:18 1.05 ? ? @@ -132,8 +132,8 @@ myResult ", myResult ]]> - 26/1/2005 - 15:3:29 - 26/1/2005 - 15:3:29 + 8/4/2005 - 14:2:18 + 8/4/2005 - 14:2:18 1.05 ? ? @@ -219,8 +219,8 @@ - 26/1/2005 - 15:3:29 - 26/1/2005 - 15:3:29 + 8/4/2005 - 14:2:18 + 8/4/2005 - 14:2:18 1.05 ? ? @@ -284,8 +284,8 @@ ? - 26/1/2005 - 15:3:29 - 26/1/2005 - 15:3:29 + 8/4/2005 - 14:2:18 + 8/4/2005 - 14:2:18 1.05 ? ? @@ -349,8 +349,8 @@ - 26/1/2005 - 15:3:29 - 26/1/2005 - 15:3:29 + 8/4/2005 - 14:2:18 + 8/4/2005 - 14:2:18 1.05 ? ? @@ -415,8 +415,8 @@ - 26/1/2005 - 15:3:29 - 26/1/2005 - 15:3:29 + 8/4/2005 - 14:2:18 + 8/4/2005 - 14:2:18 1.05 ? ? @@ -468,8 +468,8 @@ EndLoop - 26/1/2005 - 15:3:29 - 26/1/2005 - 15:3:29 + 8/4/2005 - 14:2:18 + 8/4/2005 - 14:2:18 1.05 ? ? @@ -511,8 +511,8 @@ - 26/1/2005 - 15:3:29 - 26/1/2005 - 15:3:29 + 8/4/2005 - 14:2:18 + 8/4/2005 - 14:2:18 1.05 ? ? @@ -738,7 +738,7 @@ -aNewDataFlow +TestVisu20_multi Init__index Init index @@ -747,7 +747,7 @@ 1 -aNewDataFlow +TestVisu20_multi Init__min Init min @@ -756,7 +756,7 @@ 1 -aNewDataFlow +TestVisu20_multi Init__max Init max @@ -765,7 +765,7 @@ 10 -aNewDataFlow +TestVisu20_multi Init__x1 Init x1 @@ -774,7 +774,7 @@ 1 -aNewDataFlow +TestVisu20_multi LoopOnViews__ViewCount LoopOnViews ViewCount @@ -783,7 +783,7 @@ 0 -aNewDataFlow +TestVisu20_multi LoopOnViews__MinCount LoopOnViews MinCount @@ -792,7 +792,7 @@ 0 -aNewDataFlow +TestVisu20_multi LoopOnViews__MaxCount LoopOnViews MaxCount -- 2.39.2