From f3705061a094942e4fac137dc9fa7242832cb92c Mon Sep 17 00:00:00 2001 From: rahuel Date: Tue, 15 Feb 2005 12:26:01 +0000 Subject: [PATCH] Many tests of Switch Control and behavior : Validity before execution and control of SwitchPorts at execution time --- 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/GraphLoopSwitchOddEven.py | 162 ++ examples/GraphLoopSwitchOddEven.xml | 377 ++++ examples/GraphLoopSwitchOfSwitch1.py | 249 +++ examples/GraphLoopSwitchOfSwitch1.xml | 590 ++++++ examples/GraphLoopSwitchOfSwitchAborted.py | 244 +++ examples/GraphLoopSwitchOfSwitchAborted.xml | 575 ++++++ examples/GraphLoopSwitchs.py | 77 +- examples/GraphLoopSwitchs.xml | 177 +- 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/GraphSwitch.py | 262 +-- examples/GraphSwitch.xml | 521 +++-- examples/GraphSwitch2.py | 69 +- examples/GraphSwitch2.xml | 59 +- examples/GraphSwitchCheckDefault.py | 33 +- examples/GraphSwitchCheckDefault.xml | 126 +- examples/GraphSwitchCheckDefault1.py | 34 +- examples/GraphSwitchCheckDefault1.xml | 133 +- examples/GraphSwitchCheckDefault2.py | 100 +- examples/GraphSwitchCheckDefault2.xml | 100 +- examples/GraphSwitchCrash.py | 483 ++--- examples/GraphSwitchCrash.xml | 1017 +++++----- examples/GraphSwitchErrExec.py | 54 +- examples/GraphSwitchErrExec.xml | 46 +- examples/GraphSwitchOutput.py | 102 +- examples/GraphSwitchOutput.xml | 124 +- examples/GraphSwitchs.py | 478 ++--- examples/GraphSwitchs.xml | 1004 +++++----- examples/GraphSyrControl.py | 545 +++--- examples/GraphSyrControl.xml | 1045 +++++------ examples/GraphSyrControl1.py | 464 ++--- examples/GraphSyrControl1.xml | 919 +++++---- examples/GraphSyrControlAve.py | 793 ++++---- examples/GraphSyrControlAve.xml | 1669 ++++++++--------- examples/GraphSyrControlDefault.py | 504 ++--- examples/GraphSyrControlDefault.xml | 1018 +++++----- examples/GraphSyrControlGUI.py | 449 ++--- examples/GraphSyrControlGUI.xml | 880 +++++---- 52 files changed, 14842 insertions(+), 6783 deletions(-) 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/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 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..a4095a8 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 + 14/2/2005 - 16:42:13 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 + + + + + + 14/2/2005 - 16:40:46 + 14/2/2005 - 16:40:46 1.05 ? ? @@ -119,8 +116,8 @@ ? - 16/12/2004 - 16:45:0 - 16/12/2004 - 16:45:0 + 14/2/2005 - 16:40:46 + 14/2/2005 - 16:40:46 1.05 ? ? @@ -166,8 +163,8 @@ - 16/12/2004 - 16:45:0 - 16/12/2004 - 16:45:0 + 14/2/2005 - 16:40:46 + 14/2/2005 - 16:40:46 1.05 ? ? @@ -205,8 +202,8 @@ - 16/12/2004 - 16:45:0 - 16/12/2004 - 16:45:0 + 14/2/2005 - 16:40:46 + 14/2/2005 - 16:40:46 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 + + + + 14/2/2005 - 16:40:46 + 14/2/2005 - 16:40:46 1.05 ? ? Compute Node 587 - 103 + 103 + +? + ? + ValEven + 3 + ? + +Vala + + +long + Even + + +long + Even + + + +ValEven + + + + + + 14/2/2005 - 16:40:46 + 14/2/2005 - 16:40:46 + 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/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/GraphLoopSwitchOfSwitch1.py b/examples/GraphLoopSwitchOfSwitch1.py new file mode 100644 index 0000000..00f5c14 --- /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( 65 ) + + # 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..2b0407b --- /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 + 11/2/2005 - 12:16:50 + 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 + + + + 11/2/2005 - 12:10:26 + 11/2/2005 - 12:10:26 + 1.05 + ? + ? + Compute Node + 6 + 233 + +? + ? + EndOfLoopSwitch + 5 + LoopSwitch + +EndOfLoopSwitch + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +? + + 11/2/2005 - 12:10:26 + 11/2/2005 - 12:10:26 + 1.05 + ? + ? + Compute Node + 1268 + 210 + +? + ? + IsEven + 3 + ? + +IsEven + + +long + a + + +long + a + + + +IsEven + + + + + + 11/2/2005 - 12:10:26 + 11/2/2005 - 12:10:26 + 2.0 + ? + ? + Compute Node + 437 + 520 + +? + ? + Switch + 6 + EndOfSwitch + +Switch + + +long + a + + +long + Odd + +int + a + +boolean + Even + + + +Switch + + + + + + + 11/2/2005 - 12:10:26 + 11/2/2005 - 12:10:26 + 2.0 + ? + ? + Compute Node + 201 + 233 + +? + ? + EndOfSwitch + 7 + Switch + +EndOfSwitch + + +long + a + + +long + a + + + +EndSwitch_1 + + 11/2/2005 - 12:10:26 + 11/2/2005 - 12:10:26 + 2.0 + ? + ? + Compute Node + 1075 + 210 + +? + ? + SwitchOdd + 6 + EndOfSwitchOdd + +SwitchOdd + + +long + a + + +boolean + POne + +boolean + PThree + +boolean + PFive + +long + n + + + +SwitchOdd + + + + + + + + + + + + + + 11/2/2005 - 12:10:26 + 11/2/2005 - 12:10:26 + 2.0 + ? + ? + Compute Node + 412 + 169 + +? + ? + EndOfSwitchOdd + 7 + SwitchOdd + +EndOfSwitchOdd + + +long + n + + +long + n + + + +EndSwitch + + 11/2/2005 - 12:10:26 + 11/2/2005 - 12:10:26 + 2.0 + ? + ? + Compute Node + 851 + 210 + +? + ? + PseudoPOne + 3 + ? + +PseudoPOne + + +long + POne + + +long + a + + + +PseudoPOne + + + + + 11/2/2005 - 12:10:26 + 11/2/2005 - 12:10:26 + 2.0 + ? + ? + Compute Node + 612 + 5 + +? + ? + PseudoPThree + 3 + ? + +PseudoPThree + + +long + PThree + + +long + a + + + +PseudoPThree_1 + + + + + 11/2/2005 - 12:10:26 + 11/2/2005 - 12:10:26 + 2.0 + ? + ? + Compute Node + 620 + 149 + +? + ? + PseudoPFive + 3 + ? + +PseudoPFive + + +long + PFive + + +long + a + + + +PseudoPFive + + + + + 11/2/2005 - 12:10:26 + 11/2/2005 - 12:10:26 + 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 + 65 + diff --git a/examples/GraphLoopSwitchOfSwitchAborted.py b/examples/GraphLoopSwitchOfSwitchAborted.py new file mode 100644 index 0000000..93381b1 --- /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( 65 ) + + # 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..0c8debb --- /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 + 11/2/2005 - 12:21:6 + 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 + + + + 11/2/2005 - 12:10:26 + 11/2/2005 - 12:10:26 + 1.05 + ? + ? + Compute Node + 6 + 233 + +? + ? + EndOfLoopSwitch + 5 + LoopSwitch + +EndOfLoopSwitch + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +? + + 11/2/2005 - 12:10:26 + 11/2/2005 - 12:10:26 + 1.05 + ? + ? + Compute Node + 1268 + 210 + +? + ? + IsEven + 3 + ? + +IsEven + + +long + a + + +long + a + + + +IsEven + + + + + + 11/2/2005 - 12:10:26 + 11/2/2005 - 12:10:26 + 2.0 + ? + ? + Compute Node + 437 + 520 + +? + ? + Switch + 6 + EndOfSwitch + +Switch + + +long + a + + +long + Odd + +int + a + +boolean + Even + + + +Switch + + + + + + + 11/2/2005 - 12:10:26 + 11/2/2005 - 12:10:26 + 2.0 + ? + ? + Compute Node + 201 + 233 + +? + ? + EndOfSwitch + 7 + Switch + +EndOfSwitch + + +long + a + + +long + a + + + +EndSwitch_1 + + 11/2/2005 - 12:10:26 + 11/2/2005 - 12:10:26 + 2.0 + ? + ? + Compute Node + 1075 + 210 + +? + ? + SwitchOdd + 6 + EndOfSwitchOdd + +SwitchOdd + + +long + a + + +boolean + POne + +boolean + PThree + +boolean + PFive + +long + n + + + +SwitchOdd + + + + + + + + + + + + + + 11/2/2005 - 12:10:26 + 11/2/2005 - 12:10:26 + 2.0 + ? + ? + Compute Node + 412 + 169 + +? + ? + EndOfSwitchOdd + 7 + SwitchOdd + +EndOfSwitchOdd + + +long + n + + +long + n + + + +EndSwitch + + 11/2/2005 - 12:10:26 + 11/2/2005 - 12:10:26 + 2.0 + ? + ? + Compute Node + 851 + 210 + +? + ? + PseudoPOne + 3 + ? + +PseudoPOne + + +long + POne + + +long + a + + + +PseudoPOne + + + + + 11/2/2005 - 12:10:26 + 11/2/2005 - 12:10:26 + 2.0 + ? + ? + Compute Node + 612 + 5 + +? + ? + PseudoPThree + 3 + ? + +PseudoPThree + + +long + PThree + + +long + a + + + +PseudoPThree_1 + + + + + 11/2/2005 - 12:10:26 + 11/2/2005 - 12:10:26 + 2.0 + ? + ? + Compute Node + 620 + 149 + +? + ? + PseudoPFive + 3 + ? + +PseudoPFive + + +long + PFive + + +long + a + + + +PseudoPFive + + + + + 11/2/2005 - 12:10:26 + 11/2/2005 - 12:10:26 + 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 + 65 + diff --git a/examples/GraphLoopSwitchs.py b/examples/GraphLoopSwitchs.py index 637832a..647fbea 100644 --- a/examples/GraphLoopSwitchs.py +++ b/examples/GraphLoopSwitchs.py @@ -15,11 +15,11 @@ def DefGraphLoopSwitchs() : # 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 ' ) + 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.INode( 'IsOdd' , PyIsOdd ) IsOdd.SetName( 'IsOdd' ) IsOdd.SetAuthor( '' ) @@ -28,27 +28,31 @@ 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 ' ) + 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.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 ' ) + PySwitchsCompare.append( ' sleep(1) ' ) + PySwitchsCompare.append( ' return aOdd ' ) SwitchsCompare = GraphLoopSwitchs.INode( 'SwitchsCompare' , PySwitchsCompare ) SwitchsCompare.SetName( 'SwitchsCompare' ) SwitchsCompare.SetAuthor( '' ) @@ -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 ' ) + 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.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 ' ) + 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.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' ) @@ -172,13 +182,11 @@ def DefGraphLoopSwitchs() : # Creation of Links LIsOddaEndOfSwitchOdda = GraphLoopSwitchs.Link( OIsOdda , IEndOfSwitchOdda ) - LSwitchOddOddIsOddGate = GraphLoopSwitchs.Link( OSwitchOddOdd , IIsOddGate ) + LIsOddOddEndOfSwitchOddOdd = GraphLoopSwitchs.Link( OIsOddOdd , IEndOfSwitchOddOdd ) - LSwitchOddOddEndOfSwitchOddOdd = GraphLoopSwitchs.Link( OSwitchOddOdd , IEndOfSwitchOddOdd ) + LSwitchOddOddIsOddGate = GraphLoopSwitchs.Link( OSwitchOddOdd , IIsOddGate ) LSwitchOddaIsOdda = GraphLoopSwitchs.Link( OSwitchOdda , IIsOdda ) - LSwitchOddaIsOdda.AddCoord( 1 , 443 , 121 ) - LSwitchOddaIsOdda.AddCoord( 2 , 443 , 212 ) LSwitchOddDefaultEndOfSwitchOddDefault = GraphLoopSwitchs.Link( OSwitchOddDefault , IEndOfSwitchOddDefault ) @@ -188,6 +196,8 @@ def DefGraphLoopSwitchs() : LIsEvenaEndOfSwitchEvena = GraphLoopSwitchs.Link( OIsEvena , IEndOfSwitchEvena ) + LIsEvenEvenEndOfSwitchEvenEven = GraphLoopSwitchs.Link( OIsEvenEven , IEndOfSwitchEvenEven ) + LLoopIndexSwitchEvena = GraphLoopSwitchs.Link( OLoopIndex , ISwitchEvena ) LLoopIndexSwitchOdda = GraphLoopSwitchs.Link( OLoopIndex , ISwitchOdda ) @@ -196,13 +206,11 @@ def DefGraphLoopSwitchs() : LLoopMaxEndOfLoopMax = GraphLoopSwitchs.Link( OLoopMax , IEndOfLoopMax ) - LSwitchEvenOddIsEvenGate = GraphLoopSwitchs.Link( OSwitchEvenOdd , IIsEvenGate ) - - LSwitchEvenEvenEndOfSwitchEvenDefault = GraphLoopSwitchs.Link( OSwitchEvenEven , IEndOfSwitchEvenDefault ) + LSwitchEvenEvenIsEvenGate = GraphLoopSwitchs.Link( OSwitchEvenEven , IIsEvenGate ) LSwitchEvenaIsEvena = GraphLoopSwitchs.Link( OSwitchEvena , IIsEvena ) - LSwitchEvenaIsEvena.AddCoord( 1 , 434 , 382 ) - LSwitchEvenaIsEvena.AddCoord( 2 , 434 , 457 ) + + LSwitchEvenDefaultEndOfSwitchEvenDefault = GraphLoopSwitchs.Link( OSwitchEvenDefault , IEndOfSwitchEvenDefault ) LEndOfSwitchEvenaSwitchsCompareaEven = GraphLoopSwitchs.Link( OEndOfSwitchEvena , ISwitchsCompareaEven ) @@ -213,13 +221,14 @@ def DefGraphLoopSwitchs() : # 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' ) + #OSwitchEvenOdd = SwitchEven.GetOutPort( 'Odd' ) return GraphLoopSwitchs diff --git a/examples/GraphLoopSwitchs.xml b/examples/GraphLoopSwitchs.xml index 7403dd0..7e9ba1f 100644 --- a/examples/GraphLoopSwitchs.xml +++ b/examples/GraphLoopSwitchs.xml @@ -9,7 +9,7 @@ 1 ? -GraphLoopSwitchs +GraphLoopSwitchs_1_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 + 11/2/2005 - 12:25:10 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 + + + + + + 11/2/2005 - 12:25:10 + 11/2/2005 - 12:25:10 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 + + + + + 11/2/2005 - 12:25:10 + 11/2/2005 - 12:25:10 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 + + + + + 11/2/2005 - 12:25:10 + 11/2/2005 - 12:25:10 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 + + + + + + 11/2/2005 - 12:25:10 + 11/2/2005 - 12:25:10 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 + 11/2/2005 - 12:25:10 + 11/2/2005 - 12:25:10 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 + 11/2/2005 - 12:25:10 + 11/2/2005 - 12:25:10 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 + + + + + 11/2/2005 - 12:25:10 + 11/2/2005 - 12:25:10 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 + + + + + 11/2/2005 - 12:25:10 + 11/2/2005 - 12:25:10 1.05 ? ? @@ -383,10 +396,12 @@ SwitchsCompare + - - 19/1/2005 - 18:34:18 - 19/1/2005 - 18:34:18 + + + 11/2/2005 - 12:25:10 + 11/2/2005 - 12:25:10 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 @@ -552,5 +561,5 @@ 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/GraphSwitch.py b/examples/GraphSwitch.py index 8515637..8a2a1ea 100644 --- a/examples/GraphSwitch.py +++ b/examples/GraphSwitch.py @@ -2,129 +2,141 @@ # Generated python file of Graph GraphSwitch from SuperV import * -# Graph creation -GraphSwitch = Graph( 'GraphSwitch' ) -GraphSwitch.SetName( 'GraphSwitch' ) -GraphSwitch.SetAuthor( '' ) -GraphSwitch.SetComment( '' ) -GraphSwitch.Coords( 0 , 0 ) -# Creation of Factory Nodes - -# Creation of InLine Nodes -PyIsOdd = [] -PyIsOdd.append( 'from time import * ' ) -PyIsOdd.append( 'def IsOdd(a) : ' ) -PyIsOdd.append( ' print a,"IsOdd (GraphSwitch)" ' ) -PyIsOdd.append( ' sleep( 1 ) ' ) -PyIsOdd.append( ' return a ' ) -IsOdd = GraphSwitch.INode( 'IsOdd' , PyIsOdd ) -IsOdd.SetName( 'IsOdd' ) -IsOdd.SetAuthor( '' ) -IsOdd.SetComment( 'Python function' ) -IsOdd.Coords( 388 , 50 ) -IsOdd.InPort( 'a' , 'long' ) -IsOdd.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 = GraphSwitch.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' ) - -# 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 = GraphSwitch.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' ) - -# Creation of Links -IsOdda = IsOdd.Port( 'a' ) -EndOfSwitcha = GraphSwitch.Link( IsOdda , EndOfSwitch.Port( 'a' ) ) -EndOfSwitcha.AddCoord( 1 , 571 , 161 ) -EndOfSwitcha.AddCoord( 2 , 571 , 131 ) - -InitLoopSwitchIndex = InitLoopSwitch.Port( 'Index' ) -Switcha = GraphSwitch.Link( InitLoopSwitchIndex , Switch.Port( 'a' ) ) - -InitLoopSwitchMin = InitLoopSwitch.Port( 'Min' ) -EndOfInitLoopSwitchMin = GraphSwitch.Link( InitLoopSwitchMin , EndOfInitLoopSwitch.Port( 'Min' ) ) - -InitLoopSwitchMax = InitLoopSwitch.Port( 'Max' ) -EndOfInitLoopSwitchMax = GraphSwitch.Link( InitLoopSwitchMax , EndOfInitLoopSwitch.Port( 'Max' ) ) - -SwitchOdd = Switch.Port( 'Odd' ) -IsOddInGate = GraphSwitch.Link( SwitchOdd , IsOdd.Port( 'InGate' ) ) - -Switcha = Switch.Port( 'a' ) -IsOdda = GraphSwitch.Link( Switcha , IsOdd.Port( 'a' ) ) -IsOdda.AddCoord( 1 , 372 , 129 ) -IsOdda.AddCoord( 2 , 371 , 223 ) - -SwitchDefault = Switch.Port( 'Default' ) -EndOfSwitchDefault = GraphSwitch.Link( SwitchDefault , EndOfSwitch.Port( 'Default' ) ) -EndOfSwitchDefault.AddCoord( 1 , 572 , 194 ) -EndOfSwitchDefault.AddCoord( 2 , 571 , 257 ) - -EndOfSwitcha = EndOfSwitch.Port( 'a' ) -EndOfInitLoopSwitchIndex = GraphSwitch.Link( EndOfSwitcha , EndOfInitLoopSwitch.Port( 'Index' ) ) - -# Creation of Input datas -InitLoopSwitchIndex = InitLoopSwitch.Input( 'Index' , 0) -InitLoopSwitchMin = InitLoopSwitch.Input( 'Min' , 0) -InitLoopSwitchMax = InitLoopSwitch.Input( 'Max' , 100) - -# Creation of Output variables -EndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.Port( 'Index' ) -EndOfInitLoopSwitchMin = EndOfInitLoopSwitch.Port( 'Min' ) -EndOfInitLoopSwitchMax = EndOfInitLoopSwitch.Port( 'Max' ) -SwitchEven = Switch.Port( 'Even' ) - -GraphSwitch.Run() -GraphSwitch.DoneW() -print GraphSwitch.State() -GraphSwitch.PrintPorts() +# Graph creation of GraphSwitch +def DefGraphSwitch() : + GraphSwitch = Graph( 'GraphSwitch' ) + GraphSwitch.SetName( 'GraphSwitch' ) + GraphSwitch.SetAuthor( '' ) + GraphSwitch.SetComment( '' ) + GraphSwitch.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsOdd = [] + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd(a) : ' ) + PyIsOdd.append( ' print a,"IsOdd (GraphSwitch)" ' ) + PyIsOdd.append( ' sleep( 1 ) ' ) + PyIsOdd.append( ' return a ' ) + IsOdd = GraphSwitch.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 = GraphSwitch.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 = GraphSwitch.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' ) + OSwitcha = Switch.OutPort( 'a' , 'int' ) + OSwitchDefault = Switch.GetOutPort( 'Default' ) + + # Creation of Links + LIsOddaEndOfSwitcha = GraphSwitch.Link( OIsOdda , IEndOfSwitcha ) + LIsOddaEndOfSwitcha.AddCoord( 1 , 564 , 201 ) + LIsOddaEndOfSwitcha.AddCoord( 2 , 564 , 137 ) + + LInitLoopSwitchIndexSwitcha = GraphSwitch.Link( OInitLoopSwitchIndex , ISwitcha ) + + LInitLoopSwitchMinEndOfInitLoopSwitchMin = GraphSwitch.Link( OInitLoopSwitchMin , IEndOfInitLoopSwitchMin ) + + LInitLoopSwitchMaxEndOfInitLoopSwitchMax = GraphSwitch.Link( OInitLoopSwitchMax , IEndOfInitLoopSwitchMax ) + + LSwitchOddIsOddGate = GraphSwitch.Link( OSwitchOdd , IIsOddGate ) + + LSwitchaIsOdda = GraphSwitch.Link( OSwitcha , IIsOdda ) + LSwitchaIsOdda.AddCoord( 1 , 371 , 136 ) + LSwitchaIsOdda.AddCoord( 2 , 371 , 200 ) + + LSwitchDefaultEndOfSwitchDefault = GraphSwitch.Link( OSwitchDefault , IEndOfSwitchDefault ) + + LEndOfSwitchaEndOfInitLoopSwitchIndex = GraphSwitch.Link( OEndOfSwitcha , IEndOfInitLoopSwitchIndex ) + + # Input datas + IInitLoopSwitchIndex.Input( 0 ) + IInitLoopSwitchMin.Input( 3 ) + IInitLoopSwitchMax.Input( 23 ) + + # Output Ports of the graph + #OEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetOutPort( 'Index' ) + #OEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetOutPort( 'Min' ) + #OEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetOutPort( 'Max' ) + #OSwitchEven = Switch.GetOutPort( 'Even' ) + return GraphSwitch + + +GraphSwitch = DefGraphSwitch() diff --git a/examples/GraphSwitch.xml b/examples/GraphSwitch.xml index f25242c..72b79e6 100644 --- a/examples/GraphSwitch.xml +++ b/examples/GraphSwitch.xml @@ -1,345 +1,344 @@ - + + ? - ? - GraphSwitch - 1 - ? - + ? + GraphSwitch + 1 + ? + GraphSwitch - + long - InitLoopSwitch\Index - + InitLoopSwitch__Index + long - InitLoopSwitch\Min - + InitLoopSwitch__Min + long - InitLoopSwitch\Max - + InitLoopSwitch__Max + long - EndOfInitLoopSwitch\Index - + EndOfInitLoopSwitch__Index + long - EndOfInitLoopSwitch\Min - + EndOfInitLoopSwitch__Min + long - EndOfInitLoopSwitch\Max - + EndOfInitLoopSwitch__Max + int - Switch\Even - - - 1/10/2003 - 17:23:54 - 13/10/2003 - 10:53:44 - 1.05 - ? - ? - ? - 0 - 0 - + Switch__Even + + + 1/10/2003 - 17:23:54 + 9/2/2005 - 15:24:45 + 1.05 + ? + ? + ? + 0 + 0 + ? - ? - IsOdd - 3 - ? - + ? + IsOdd + 3 + ? + IsOdd - + long - a - + a + long - a - - + a + + IsOdd - - - - - - 13/10/2003 - 10:53:44 - 13/10/2003 - 10:53:44 - 1.05 - ? - ? - Python function - 388 - 50 - + + + + + + 9/2/2005 - 15:24:45 + 9/2/2005 - 15:24:45 + 1.05 + ? + ? + Python function + 389 + 65 + ? - ? - 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 - - - - 13/10/2003 - 10:53:44 - 13/10/2003 - 10:53:44 - 1.05 - ? - ? - ? - 10 - 129 - + + + + 9/2/2005 - 15:24:45 + 9/2/2005 - 15:24:45 + 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 - - - - 13/10/2003 - 10:53:44 - 13/10/2003 - 10:53:44 - 1.05 - ? - ? - ? - 766 - 127 - + Max + + + +? + + 9/2/2005 - 15:24:45 + 9/2/2005 - 15:24:45 + 1.05 + ? + ? + Compute Node + 776 + 170 + ? - ? - Switch - 6 - EndOfSwitch - + ? + Switch + 6 + EndOfSwitch + Switch - + long - a - + a + long - Odd - + Odd + int - Even - + Even + int - a - - + a + + Switch - - - - - - 13/10/2003 - 10:53:44 - 13/10/2003 - 10:53:44 - 1.05 - ? - ? - ? - 186 - 130 - + + + + + + 9/2/2005 - 15:24:45 + 9/2/2005 - 15:24:45 + 1.05 + ? + ? + Compute Node + 194 + 129 + ? - ? - EndOfSwitch - 7 - Switch - + ? + EndOfSwitch + 7 + Switch + EndOfSwitch - + long - a - + a + long - a - - - - 13/10/2003 - 10:53:44 - 13/10/2003 - 10:53:44 - 1.05 - ? - ? - ? - 587 - 126 - + a + + + +? + + 9/2/2005 - 15:24:45 + 9/2/2005 - 15:24:45 + 1.05 + ? + ? + Compute Node + 582 + 170 + IsOdd - a - EndOfSwitch - a - + a + EndOfSwitch + a + -571 - 161 - -571 - 131 - +564 + 201 + +564 + 137 + 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 + -372 - 129 - 371 - 223 - + 136 + +371 + 200 + Switch - Default - EndOfSwitch - Default - - -572 - 194 - -571 - 257 - + Default + EndOfSwitch + Default + + EndOfSwitch - a - EndOfInitLoopSwitch - Index - - + a + EndOfInitLoopSwitch + Index + + GraphSwitch - InitLoopSwitch\Index - InitLoopSwitch - Index - + InitLoopSwitch__Index + InitLoopSwitch + Index + 3 - 0 - - + 0 + + GraphSwitch - InitLoopSwitch\Min - InitLoopSwitch - Min - + InitLoopSwitch__Min + InitLoopSwitch + Min + 3 - 0 - - + 3 + + GraphSwitch - InitLoopSwitch\Max - InitLoopSwitch - Max - + InitLoopSwitch__Max + InitLoopSwitch + Max + 3 - 100 - + 23 + diff --git a/examples/GraphSwitch2.py b/examples/GraphSwitch2.py index 3bdae8d..6f3df36 100644 --- a/examples/GraphSwitch2.py +++ b/examples/GraphSwitch2.py @@ -1,15 +1,15 @@ -# Generated python file of Graph GraphSwitch_1_1 +# Generated python file of Graph GraphSwitch2 from SuperV import * -# Graph creation of GraphSwitch_1_1 -def DefGraphSwitch_1_1() : - GraphSwitch_1_1 = Graph( 'GraphSwitch_1_1' ) - GraphSwitch_1_1.SetName( 'GraphSwitch_1_1' ) - GraphSwitch_1_1.SetAuthor( '' ) - GraphSwitch_1_1.SetComment( '' ) - GraphSwitch_1_1.Coords( 0 , 0 ) +# Graph creation of GraphSwitch2 +def DefGraphSwitch2() : + GraphSwitch2 = Graph( 'GraphSwitch2' ) + GraphSwitch2.SetName( 'GraphSwitch2' ) + GraphSwitch2.SetAuthor( 'JR' ) + GraphSwitch2.SetComment( '' ) + GraphSwitch2.Coords( 0 , 0 ) # Creation of Factory Nodes @@ -20,7 +20,7 @@ def DefGraphSwitch_1_1() : PyIsOdd.append( ' print a,"IsOdd (GraphSwitch)" ' ) PyIsOdd.append( ' sleep( 1 ) ' ) PyIsOdd.append( ' return a ' ) - IsOdd = GraphSwitch_1_1.INode( 'IsOdd' , PyIsOdd ) + IsOdd = GraphSwitch2.INode( 'IsOdd' , PyIsOdd ) IsOdd.SetName( 'IsOdd' ) IsOdd.SetAuthor( '' ) IsOdd.SetComment( 'Python function' ) @@ -36,7 +36,7 @@ def DefGraphSwitch_1_1() : PyIsEven.append( ' print a,"IsEven (GraphSwitch)" ' ) PyIsEven.append( ' sleep( 1 ) ' ) PyIsEven.append( ' return a ' ) - IsEven = GraphSwitch_1_1.INode( 'IsEven' , PyIsEven ) + IsEven = GraphSwitch2.INode( 'IsEven' , PyIsEven ) IsEven.SetName( 'IsEven' ) IsEven.SetAuthor( '' ) IsEven.SetComment( 'Compute Node' ) @@ -62,11 +62,11 @@ def DefGraphSwitch_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.LNode( 'InitLoop' , PyInitLoopSwitch , 'MoreLoop' , PyMoreInitLoopSwitch , 'NextLoop' , PyNextInitLoopSwitch ) + InitLoopSwitch,EndOfInitLoopSwitch = GraphSwitch2.LNode( 'InitLoop' , PyInitLoopSwitch , 'MoreLoop' , PyMoreInitLoopSwitch , 'NextLoop' , PyNextInitLoopSwitch ) EndOfInitLoopSwitch.SetName( 'EndOfInitLoopSwitch' ) EndOfInitLoopSwitch.SetAuthor( '' ) EndOfInitLoopSwitch.SetComment( 'Compute Node' ) - EndOfInitLoopSwitch.Coords( 766 , 127 ) + EndOfInitLoopSwitch.Coords( 775 , 169 ) PyEndOfInitLoopSwitch = [] EndOfInitLoopSwitch.SetPyFunction( '' , PyEndOfInitLoopSwitch ) IInitLoopSwitchDoLoop = InitLoopSwitch.GetInPort( 'DoLoop' ) @@ -95,18 +95,17 @@ def DefGraphSwitch_1_1() : # Creation of Switch Nodes PySwitch = [] - PySwitch.append( 'from time import * ' ) - PySwitch.append( 'def Switch(a) : ' ) - PySwitch.append( ' if a <= 0 : ' ) - 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 = GraphSwitch_1_1.SNode( 'Switch' , PySwitch ) + PySwitch.append( 'from time import * ' ) + PySwitch.append( 'def Switch(a) : ' ) + PySwitch.append( ' sleep(1) ' ) + PySwitch.append( ' if a <= 0 : ' ) + PySwitch.append( ' return 0,0,a ' ) + PySwitch.append( ' return a & 1,1-(a&1),a ' ) + Switch,EndOfSwitch = GraphSwitch2.SNode( 'Switch' , PySwitch ) EndOfSwitch.SetName( 'EndOfSwitch' ) EndOfSwitch.SetAuthor( '' ) EndOfSwitch.SetComment( 'Compute Node' ) - EndOfSwitch.Coords( 580 , 147 ) + EndOfSwitch.Coords( 583 , 169 ) PyEndOfSwitch = [] EndOfSwitch.SetPyFunction( 'EndSwitch_1' , PyEndOfSwitch ) IEndOfSwitcha = EndOfSwitch.InPort( 'a' , 'long' ) @@ -125,38 +124,38 @@ def DefGraphSwitch_1_1() : OSwitchDefault = Switch.GetOutPort( 'Default' ) # Creation of Links - LIsOddaEndOfSwitcha = GraphSwitch_1_1.Link( OIsOdda , IEndOfSwitcha ) + LIsOddaEndOfSwitcha = GraphSwitch2.Link( OIsOdda , IEndOfSwitcha ) - LInitLoopSwitchIndexSwitcha = GraphSwitch_1_1.Link( OInitLoopSwitchIndex , ISwitcha ) + LInitLoopSwitchIndexSwitcha = GraphSwitch2.Link( OInitLoopSwitchIndex , ISwitcha ) - LInitLoopSwitchMinEndOfInitLoopSwitchMin = GraphSwitch_1_1.Link( OInitLoopSwitchMin , IEndOfInitLoopSwitchMin ) + LInitLoopSwitchMinEndOfInitLoopSwitchMin = GraphSwitch2.Link( OInitLoopSwitchMin , IEndOfInitLoopSwitchMin ) - LInitLoopSwitchMaxEndOfInitLoopSwitchMax = GraphSwitch_1_1.Link( OInitLoopSwitchMax , IEndOfInitLoopSwitchMax ) + LInitLoopSwitchMaxEndOfInitLoopSwitchMax = GraphSwitch2.Link( OInitLoopSwitchMax , IEndOfInitLoopSwitchMax ) - LIsEvenaEndOfSwitcha = GraphSwitch_1_1.Link( OIsEvena , IEndOfSwitcha ) + LIsEvenaEndOfSwitcha = GraphSwitch2.Link( OIsEvena , IEndOfSwitcha ) - LSwitchOddIsOddGate = GraphSwitch_1_1.Link( OSwitchOdd , IIsOddGate ) + LSwitchOddIsOddGate = GraphSwitch2.Link( OSwitchOdd , IIsOddGate ) - LSwitchEvenIsEvenGate = GraphSwitch_1_1.Link( OSwitchEven , IIsEvenGate ) + LSwitchEvenIsEvenGate = GraphSwitch2.Link( OSwitchEven , IIsEvenGate ) - LSwitchaIsOdda = GraphSwitch_1_1.Link( OSwitcha , IIsOdda ) + LSwitchaIsOdda = GraphSwitch2.Link( OSwitcha , IIsOdda ) - LSwitchaIsEvena = GraphSwitch_1_1.Link( OSwitcha , IIsEvena ) + LSwitchaIsEvena = GraphSwitch2.Link( OSwitcha , IIsEvena ) - LSwitchDefaultEndOfSwitchDefault = GraphSwitch_1_1.Link( OSwitchDefault , IEndOfSwitchDefault ) + LSwitchDefaultEndOfSwitchDefault = GraphSwitch2.Link( OSwitchDefault , IEndOfSwitchDefault ) - LEndOfSwitchaEndOfInitLoopSwitchIndex = GraphSwitch_1_1.Link( OEndOfSwitcha , IEndOfInitLoopSwitchIndex ) + LEndOfSwitchaEndOfInitLoopSwitchIndex = GraphSwitch2.Link( OEndOfSwitcha , IEndOfInitLoopSwitchIndex ) # Input datas IInitLoopSwitchIndex.Input( 0 ) IInitLoopSwitchMin.Input( -5 ) - IInitLoopSwitchMax.Input( 10 ) + IInitLoopSwitchMax.Input( 23 ) # Output Ports of the graph #OEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetOutPort( 'Index' ) #OEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetOutPort( 'Min' ) #OEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetOutPort( 'Max' ) - return GraphSwitch_1_1 + return GraphSwitch2 -GraphSwitch_1_1 = DefGraphSwitch_1_1() +GraphSwitch2 = DefGraphSwitch2() diff --git a/examples/GraphSwitch2.xml b/examples/GraphSwitch2.xml index 98d34c1..0181fdf 100644 --- a/examples/GraphSwitch2.xml +++ b/examples/GraphSwitch2.xml @@ -5,7 +5,7 @@ ? ? - GraphSwitch_1_1 + GraphSwitch2 1 ? @@ -33,9 +33,9 @@ 1/10/2003 - 17:23:54 - 12/1/2005 - 17:7:20 + 14/2/2005 - 17:25:12 1.05 - ? + JR ? ? 0 @@ -66,8 +66,8 @@ - 12/1/2005 - 17:7:20 - 12/1/2005 - 17:7:20 + 14/2/2005 - 17:25:12 + 14/2/2005 - 17:25:12 1.05 ? ? @@ -122,8 +122,8 @@ - 12/1/2005 - 17:7:20 - 12/1/2005 - 17:7:20 + 14/2/2005 - 17:25:12 + 14/2/2005 - 17:25:12 1.05 ? ? @@ -163,14 +163,14 @@ ? - 12/1/2005 - 17:7:20 - 12/1/2005 - 17:7:20 + 14/2/2005 - 17:25:12 + 14/2/2005 - 17:25:12 1.05 ? ? Compute Node - 766 - 127 + 775 + 169 ? ? @@ -196,8 +196,8 @@ - 12/1/2005 - 17:7:20 - 12/1/2005 - 17:7:20 + 14/2/2005 - 17:25:12 + 14/2/2005 - 17:25:12 2.0 ? ? @@ -230,15 +230,14 @@ Switch - - - - - - - - 12/1/2005 - 17:7:20 - 12/1/2005 - 17:7:20 + + + + + + + 14/2/2005 - 17:25:12 + 14/2/2005 - 17:25:12 2.0 ? ? @@ -266,14 +265,14 @@ EndSwitch_1 - 12/1/2005 - 17:7:20 - 12/1/2005 - 17:7:20 + 14/2/2005 - 17:25:12 + 14/2/2005 - 17:25:12 2.0 ? ? Compute Node - 580 - 147 + 583 + 169 IsOdd @@ -355,7 +354,7 @@ -GraphSwitch_1_1 +GraphSwitch2 InitLoopSwitch__Index InitLoopSwitch Index @@ -364,7 +363,7 @@ 0 -GraphSwitch_1_1 +GraphSwitch2 InitLoopSwitch__Min InitLoopSwitch Min @@ -373,11 +372,11 @@ -5 -GraphSwitch_1_1 +GraphSwitch2 InitLoopSwitch__Max InitLoopSwitch Max 3 - 10 + 23 diff --git a/examples/GraphSwitchCheckDefault.py b/examples/GraphSwitchCheckDefault.py index 8232e30..f281785 100644 --- a/examples/GraphSwitchCheckDefault.py +++ b/examples/GraphSwitchCheckDefault.py @@ -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) : ' ) @@ -223,10 +206,6 @@ def DefGraphSwitchCheckDefault() : LEmptyNodeBranchEndOfSwitchBranch = GraphSwitchCheckDefault.Link( OEmptyNodeBranch , IEndOfSwitchBranch ) - LDefaultaEndOfSwitcha = GraphSwitchCheckDefault.Link( ODefaulta , IEndOfSwitcha ) - - LDefaultBranchEndOfSwitchBranch = GraphSwitchCheckDefault.Link( ODefaultBranch , IEndOfSwitchBranch ) - LInitLoopSwitchIndexSwitcha = GraphSwitchCheckDefault.Link( OInitLoopSwitchIndex , ISwitcha ) LInitLoopSwitchMinEndOfInitLoopSwitchMin = GraphSwitchCheckDefault.Link( OInitLoopSwitchMin , IEndOfInitLoopSwitchMin ) @@ -263,23 +242,13 @@ def DefGraphSwitchCheckDefault() : 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.Link( OSwitchBranch , IPrintOddBranch ) LSwitchBranchPrintEvenBranch = GraphSwitchCheckDefault.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.Link( OSwitchDefault , IEndOfSwitchDefault ) LEndOfSwitchaEndOfInitLoopSwitchIndex = GraphSwitchCheckDefault.Link( OEndOfSwitcha , IEndOfInitLoopSwitchIndex ) diff --git a/examples/GraphSwitchCheckDefault.xml b/examples/GraphSwitchCheckDefault.xml index 81e7ab6..9263de8 100644 --- a/examples/GraphSwitchCheckDefault.xml +++ b/examples/GraphSwitchCheckDefault.xml @@ -9,7 +9,7 @@ 1 ? -GraphSwitchCheck_2 +GraphSwitchCheckDefault long @@ -36,7 +36,7 @@ 13/1/2005 - 12:21:43 - 13/1/2005 - 12:23:17 + 9/2/2005 - 17:21:4 2.0 JR ? @@ -69,8 +69,8 @@ - 13/1/2005 - 12:23:17 - 13/1/2005 - 12:23:17 + 9/2/2005 - 17:20:8 + 9/2/2005 - 17:20:8 2.0 ? ? @@ -102,8 +102,8 @@ - 13/1/2005 - 12:23:17 - 13/1/2005 - 12:23:17 + 9/2/2005 - 17:20:8 + 9/2/2005 - 17:20:8 2.0 ? ? @@ -138,8 +138,8 @@ - 13/1/2005 - 12:23:17 - 13/1/2005 - 12:23:17 + 9/2/2005 - 17:20:8 + 9/2/2005 - 17:20:8 2.0 ? ? @@ -174,8 +174,8 @@ - 13/1/2005 - 12:23:17 - 13/1/2005 - 12:23:17 + 9/2/2005 - 17:20:8 + 9/2/2005 - 17:20:8 2.0 ? ? @@ -212,8 +212,8 @@ - 13/1/2005 - 12:23:17 - 13/1/2005 - 12:23:17 + 9/2/2005 - 17:20:8 + 9/2/2005 - 17:20:8 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 + 9/2/2005 - 17:20:8 + 9/2/2005 - 17:20:8 2.0 ? ? @@ -352,8 +314,8 @@ - 13/1/2005 - 12:23:17 - 13/1/2005 - 12:23:17 + 9/2/2005 - 17:20:8 + 9/2/2005 - 17:20:8 2.0 ? ? @@ -403,8 +365,8 @@ - 13/1/2005 - 12:23:17 - 13/1/2005 - 12:23:17 + 9/2/2005 - 17:20:8 + 9/2/2005 - 17:20:8 2.0 ? ? @@ -438,8 +400,8 @@ - 13/1/2005 - 12:23:17 - 13/1/2005 - 12:23:17 + 9/2/2005 - 17:20:8 + 9/2/2005 - 17:20:8 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 diff --git a/examples/GraphSwitchCheckDefault1.py b/examples/GraphSwitchCheckDefault1.py index a7cbc2a..cf92c40 100644 --- a/examples/GraphSwitchCheckDefault1.py +++ b/examples/GraphSwitchCheckDefault1.py @@ -97,23 +97,6 @@ def DefGraphSwitchCheckDefault1() : 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 = GraphSwitchCheckDefault1.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) : ' ) @@ -223,10 +206,6 @@ def DefGraphSwitchCheckDefault1() : LEmptyNodeBranchEndOfSwitchBranch = GraphSwitchCheckDefault1.Link( OEmptyNodeBranch , IEndOfSwitchBranch ) - LDefaultaEndOfSwitcha = GraphSwitchCheckDefault1.Link( ODefaulta , IEndOfSwitcha ) - - LDefaultBranchEndOfSwitchBranch = GraphSwitchCheckDefault1.Link( ODefaultBranch , IEndOfSwitchBranch ) - LInitLoopSwitchIndexSwitcha = GraphSwitchCheckDefault1.Link( OInitLoopSwitchIndex , ISwitcha ) LInitLoopSwitchMinEndOfInitLoopSwitchMin = GraphSwitchCheckDefault1.Link( OInitLoopSwitchMin , IEndOfInitLoopSwitchMin ) @@ -263,23 +242,13 @@ def DefGraphSwitchCheckDefault1() : LSwitchaPrintEvena.AddCoord( 1 , 381 , 361 ) LSwitchaPrintEvena.AddCoord( 2 , 382 , 200 ) - LSwitchaDefaulta = GraphSwitchCheckDefault1.Link( OSwitcha , IDefaulta ) - LSwitchaDefaulta.AddCoord( 1 , 382 , 663 ) - LSwitchaDefaulta.AddCoord( 2 , 382 , 199 ) - LSwitchBranchPrintOddBranch = GraphSwitchCheckDefault1.Link( OSwitchBranch , IPrintOddBranch ) LSwitchBranchPrintEvenBranch = GraphSwitchCheckDefault1.Link( OSwitchBranch , IPrintEvenBranch ) LSwitchBranchPrintEvenBranch.AddCoord( 1 , 369 , 381 ) LSwitchBranchPrintEvenBranch.AddCoord( 2 , 369 , 219 ) - LSwitchBranchDefaultBranch = GraphSwitchCheckDefault1.Link( OSwitchBranch , IDefaultBranch ) - LSwitchBranchDefaultBranch.AddCoord( 1 , 370 , 683 ) - LSwitchBranchDefaultBranch.AddCoord( 2 , 370 , 220 ) - - LSwitchdefaultDefaultGate = GraphSwitchCheckDefault1.Link( OSwitchdefault , IDefaultGate ) - LSwitchdefaultDefaultGate.AddCoord( 1 , 363 , 707 ) - LSwitchdefaultDefaultGate.AddCoord( 2 , 362 , 239 ) + LSwitchDefaultEndOfSwitchDefault = GraphSwitchCheckDefault1.Link( OSwitchDefault , IEndOfSwitchDefault ) LEndOfSwitchaEndOfInitLoopSwitchIndex = GraphSwitchCheckDefault1.Link( OEndOfSwitcha , IEndOfInitLoopSwitchIndex ) @@ -292,6 +261,7 @@ def DefGraphSwitchCheckDefault1() : #OEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetOutPort( 'Index' ) #OEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetOutPort( 'Min' ) #OEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetOutPort( 'Max' ) + #OSwitchdefault = Switch.GetOutPort( 'default' ) return GraphSwitchCheckDefault1 diff --git a/examples/GraphSwitchCheckDefault1.xml b/examples/GraphSwitchCheckDefault1.xml index 317bc92..227fb59 100644 --- a/examples/GraphSwitchCheckDefault1.xml +++ b/examples/GraphSwitchCheckDefault1.xml @@ -9,7 +9,7 @@ 1 ? -GraphSwitchCheckDefault +GraphSwitchCheckDefault_1 long @@ -29,11 +29,14 @@ EndOfInitLoopSwitch__Min long - EndOfInitLoopSwitch__Max + EndOfInitLoopSwitch__Max + +boolean + Switch__default 13/1/2005 - 12:21:43 - 13/1/2005 - 12:28:19 + 9/2/2005 - 17:21:22 2.0 JR ? @@ -66,8 +69,8 @@ - 13/1/2005 - 12:23:17 - 13/1/2005 - 12:23:17 + 9/2/2005 - 17:21:22 + 9/2/2005 - 17:21:22 2.0 ? ? @@ -99,8 +102,8 @@ - 13/1/2005 - 12:23:17 - 13/1/2005 - 12:23:17 + 9/2/2005 - 17:21:22 + 9/2/2005 - 17:21:22 2.0 ? ? @@ -135,8 +138,8 @@ - 13/1/2005 - 12:23:17 - 13/1/2005 - 12:23:17 + 9/2/2005 - 17:21:22 + 9/2/2005 - 17:21:22 2.0 ? ? @@ -171,8 +174,8 @@ - 13/1/2005 - 12:23:17 - 13/1/2005 - 12:23:17 + 9/2/2005 - 17:21:22 + 9/2/2005 - 17:21:22 2.0 ? ? @@ -209,8 +212,8 @@ - 13/1/2005 - 12:23:17 - 13/1/2005 - 12:23:17 + 9/2/2005 - 17:21:22 + 9/2/2005 - 17:21:22 2.0 ? ? @@ -218,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 @@ -305,8 +270,8 @@ - 13/1/2005 - 12:23:17 - 13/1/2005 - 12:23:17 + 9/2/2005 - 17:21:22 + 9/2/2005 - 17:21:22 2.0 ? ? @@ -349,8 +314,8 @@ - 13/1/2005 - 12:23:17 - 13/1/2005 - 12:23:17 + 9/2/2005 - 17:21:22 + 9/2/2005 - 17:21:22 2.0 ? ? @@ -400,8 +365,8 @@ - 13/1/2005 - 12:23:17 - 13/1/2005 - 12:23:17 + 9/2/2005 - 17:21:22 + 9/2/2005 - 17:21:22 2.0 ? ? @@ -435,8 +400,8 @@ - 13/1/2005 - 12:23:17 - 13/1/2005 - 12:23:17 + 9/2/2005 - 17:21:22 + 9/2/2005 - 17:21:22 2.0 ? ? @@ -484,18 +449,6 @@ Branch -Default - a - EndOfSwitch - a - - -Default - Branch - EndOfSwitch - Branch - - InitLoopSwitch DoLoop EndOfInitLoopSwitch @@ -616,18 +569,6 @@ 382 200 -Switch - a - Default - a - - -382 - 663 - -382 - 199 - Switch Branch PrintOdd @@ -647,28 +588,10 @@ 219 Switch - Branch - Default - Branch - - -370 - 683 - -370 - 220 - -Switch - default - Default - Gate - - -363 - 707 - -362 - 239 + Default + EndOfSwitch + Default + EndOfSwitch a diff --git a/examples/GraphSwitchCheckDefault2.py b/examples/GraphSwitchCheckDefault2.py index e26b64a..d33f06e 100644 --- a/examples/GraphSwitchCheckDefault2.py +++ b/examples/GraphSwitchCheckDefault2.py @@ -1,15 +1,15 @@ -# Generated python file of Graph GraphSwitchCheckDefault1 +# Generated python file of Graph GraphSwitchCheckDefault2 from SuperV import * -# Graph creation of GraphSwitchCheckDefault1 -def DefGraphSwitchCheckDefault1() : - GraphSwitchCheckDefault1 = Graph( 'GraphSwitchCheckDefault1' ) - GraphSwitchCheckDefault1.SetName( 'GraphSwitchCheckDefault1' ) - GraphSwitchCheckDefault1.SetAuthor( 'JR' ) - GraphSwitchCheckDefault1.SetComment( '' ) - GraphSwitchCheckDefault1.Coords( 0 , 0 ) +# Graph creation of GraphSwitchCheckDefault2 +def DefGraphSwitchCheckDefault2() : + GraphSwitchCheckDefault2 = Graph( 'GraphSwitchCheckDefault2' ) + GraphSwitchCheckDefault2.SetName( 'GraphSwitchCheckDefault2' ) + GraphSwitchCheckDefault2.SetAuthor( 'JR' ) + GraphSwitchCheckDefault2.SetComment( '' ) + GraphSwitchCheckDefault2.Coords( 0 , 0 ) # Creation of Factory Nodes @@ -20,7 +20,7 @@ def DefGraphSwitchCheckDefault1() : PyIsOdd.append( ' print a,"IsOdd (GraphSwitch)" ' ) PyIsOdd.append( ' sleep( 1 ) ' ) PyIsOdd.append( ' return a ' ) - IsOdd = GraphSwitchCheckDefault1.INode( 'IsOdd' , PyIsOdd ) + IsOdd = GraphSwitchCheckDefault2.INode( 'IsOdd' , PyIsOdd ) IsOdd.SetName( 'IsOdd' ) IsOdd.SetAuthor( '' ) IsOdd.SetComment( 'Python function' ) @@ -36,7 +36,7 @@ def DefGraphSwitchCheckDefault1() : PyIsEven.append( ' print a,"IsEven (GraphSwitch)" ' ) PyIsEven.append( ' sleep( 1 ) ' ) PyIsEven.append( ' return a ' ) - IsEven = GraphSwitchCheckDefault1.INode( 'IsEven' , PyIsEven ) + IsEven = GraphSwitchCheckDefault2.INode( 'IsEven' , PyIsEven ) IsEven.SetName( 'IsEven' ) IsEven.SetAuthor( '' ) IsEven.SetComment( 'Compute Node' ) @@ -52,7 +52,7 @@ def DefGraphSwitchCheckDefault1() : PyPrintOdd.append( ' print "Print ",a,Branch ' ) PyPrintOdd.append( ' sleep(1) ' ) PyPrintOdd.append( ' return Branch ' ) - PrintOdd = GraphSwitchCheckDefault1.INode( 'Print' , PyPrintOdd ) + PrintOdd = GraphSwitchCheckDefault2.INode( 'Print' , PyPrintOdd ) PrintOdd.SetName( 'PrintOdd' ) PrintOdd.SetAuthor( '' ) PrintOdd.SetComment( 'Compute Node' ) @@ -69,7 +69,7 @@ def DefGraphSwitchCheckDefault1() : PyPrintEven.append( ' print "Print ",a,Branch ' ) PyPrintEven.append( ' sleep(1) ' ) PyPrintEven.append( ' return Branch ' ) - PrintEven = GraphSwitchCheckDefault1.INode( 'Print_1' , PyPrintEven ) + PrintEven = GraphSwitchCheckDefault2.INode( 'Print_1' , PyPrintEven ) PrintEven.SetName( 'PrintEven' ) PrintEven.SetAuthor( '' ) PrintEven.SetComment( 'Compute Node' ) @@ -85,7 +85,7 @@ def DefGraphSwitchCheckDefault1() : PyEmptyNode.append( 'def EmptyNode(a,Branch) : ' ) PyEmptyNode.append( ' sleep(1) ' ) PyEmptyNode.append( ' return a,Branch ' ) - EmptyNode = GraphSwitchCheckDefault1.INode( 'EmptyNode' , PyEmptyNode ) + EmptyNode = GraphSwitchCheckDefault2.INode( 'EmptyNode' , PyEmptyNode ) EmptyNode.SetName( 'EmptyNode' ) EmptyNode.SetAuthor( '' ) EmptyNode.SetComment( 'Compute Node' ) @@ -102,7 +102,7 @@ def DefGraphSwitchCheckDefault1() : PyDefault.append( 'def Default(a,Branch) : ' ) PyDefault.append( ' sleep(1) ' ) PyDefault.append( ' return a,Branch ' ) - Default = GraphSwitchCheckDefault1.INode( 'Default' , PyDefault ) + Default = GraphSwitchCheckDefault2.INode( 'Default' , PyDefault ) Default.SetName( 'Default' ) Default.SetAuthor( '' ) Default.SetComment( 'Compute Node' ) @@ -119,11 +119,11 @@ def DefGraphSwitchCheckDefault1() : PyPuta.append( 'def Puta(a) : ' ) PyPuta.append( ' sleep(1) ' ) PyPuta.append( ' return a ' ) - Puta = GraphSwitchCheckDefault1.INode( 'Puta' , PyPuta ) + Puta = GraphSwitchCheckDefault2.INode( 'Puta' , PyPuta ) Puta.SetName( 'Puta' ) Puta.SetAuthor( '' ) Puta.SetComment( 'Compute Node' ) - Puta.Coords( 658 , 472 ) + Puta.Coords( 665 , 486 ) IPutaa = Puta.InPort( 'a' , 'long' ) IPutaGate = Puta.GetInPort( 'Gate' ) OPutaa = Puta.OutPort( 'a' , 'long' ) @@ -134,7 +134,7 @@ def DefGraphSwitchCheckDefault1() : PyPutBranch.append( 'def PutBranch(Branch) : ' ) PyPutBranch.append( ' sleep(1) ' ) PyPutBranch.append( ' return Branch ' ) - PutBranch = GraphSwitchCheckDefault1.INode( 'PutBranch' , PyPutBranch ) + PutBranch = GraphSwitchCheckDefault2.INode( 'PutBranch' , PyPutBranch ) PutBranch.SetName( 'PutBranch' ) PutBranch.SetAuthor( '' ) PutBranch.SetComment( 'Compute Node' ) @@ -162,7 +162,7 @@ def DefGraphSwitchCheckDefault1() : PyNextInitLoopSwitch.append( 'def NextLoop(Index,Min,Max) : ' ) PyNextInitLoopSwitch.append( ' Index = Index - 1 ' ) PyNextInitLoopSwitch.append( ' return Index,Min,Max ' ) - InitLoopSwitch,EndOfInitLoopSwitch = GraphSwitchCheckDefault1.LNode( 'InitLoop' , PyInitLoopSwitch , 'MoreLoop' , PyMoreInitLoopSwitch , 'NextLoop' , PyNextInitLoopSwitch ) + InitLoopSwitch,EndOfInitLoopSwitch = GraphSwitchCheckDefault2.LNode( 'InitLoop' , PyInitLoopSwitch , 'MoreLoop' , PyMoreInitLoopSwitch , 'NextLoop' , PyNextInitLoopSwitch ) EndOfInitLoopSwitch.SetName( 'EndOfInitLoopSwitch' ) EndOfInitLoopSwitch.SetAuthor( '' ) EndOfInitLoopSwitch.SetComment( 'Compute Node' ) @@ -210,7 +210,7 @@ def DefGraphSwitchCheckDefault1() : PySwitch.append( ' else : ' ) PySwitch.append( ' Branch = "Odd" ' ) PySwitch.append( ' return a & 1,1-(a&1),a,Branch,0 ' ) - Switch,EndOfSwitch = GraphSwitchCheckDefault1.SNode( 'Switch' , PySwitch ) + Switch,EndOfSwitch = GraphSwitchCheckDefault2.SNode( 'Switch' , PySwitch ) EndOfSwitch.SetName( 'EndOfSwitch' ) EndOfSwitch.SetAuthor( '' ) EndOfSwitch.SetComment( 'Compute Node' ) @@ -240,82 +240,84 @@ def DefGraphSwitchCheckDefault1() : OSwitchDefault = Switch.GetOutPort( 'Default' ) # Creation of Links - LIsOddaEmptyNodea = GraphSwitchCheckDefault1.Link( OIsOdda , IEmptyNodea ) + LIsOddaEmptyNodea = GraphSwitchCheckDefault2.Link( OIsOdda , IEmptyNodea ) LIsOddaEmptyNodea.AddCoord( 1 , 646 , 78 ) - LPrintOddBranchEmptyNodeBranch = GraphSwitchCheckDefault1.Link( OPrintOddBranch , IEmptyNodeBranch ) + LIsEvenaEndOfSwitcha = GraphSwitchCheckDefault2.Link( OIsEvena , IEndOfSwitcha ) - LEmptyNodeaEndOfSwitcha = GraphSwitchCheckDefault1.Link( OEmptyNodea , IEndOfSwitcha ) + LPrintOddBranchEmptyNodeBranch = GraphSwitchCheckDefault2.Link( OPrintOddBranch , IEmptyNodeBranch ) - LEmptyNodeBranchEndOfSwitchBranch = GraphSwitchCheckDefault1.Link( OEmptyNodeBranch , IEndOfSwitchBranch ) + LPrintEvenBranchEndOfSwitchBranch = GraphSwitchCheckDefault2.Link( OPrintEvenBranch , IEndOfSwitchBranch ) - LDefaultaEndOfSwitcha = GraphSwitchCheckDefault1.Link( ODefaulta , IEndOfSwitcha ) + LEmptyNodeaEndOfSwitcha = GraphSwitchCheckDefault2.Link( OEmptyNodea , IEndOfSwitcha ) - LDefaultaPutaa = GraphSwitchCheckDefault1.Link( ODefaulta , IPutaa ) + LEmptyNodeBranchEndOfSwitchBranch = GraphSwitchCheckDefault2.Link( OEmptyNodeBranch , IEndOfSwitchBranch ) - LDefaultBranchEndOfSwitchBranch = GraphSwitchCheckDefault1.Link( ODefaultBranch , IEndOfSwitchBranch ) + LDefaultaPutaa = GraphSwitchCheckDefault2.Link( ODefaulta , IPutaa ) - LDefaultBranchPutBranchBranch = GraphSwitchCheckDefault1.Link( ODefaultBranch , IPutBranchBranch ) + LDefaultBranchPutBranchBranch = GraphSwitchCheckDefault2.Link( ODefaultBranch , IPutBranchBranch ) - LInitLoopSwitchIndexSwitcha = GraphSwitchCheckDefault1.Link( OInitLoopSwitchIndex , ISwitcha ) + LInitLoopSwitchIndexSwitcha = GraphSwitchCheckDefault2.Link( OInitLoopSwitchIndex , ISwitcha ) - LInitLoopSwitchMinEndOfInitLoopSwitchMin = GraphSwitchCheckDefault1.Link( OInitLoopSwitchMin , IEndOfInitLoopSwitchMin ) + LInitLoopSwitchMinEndOfInitLoopSwitchMin = GraphSwitchCheckDefault2.Link( OInitLoopSwitchMin , IEndOfInitLoopSwitchMin ) - LInitLoopSwitchMaxEndOfInitLoopSwitchMax = GraphSwitchCheckDefault1.Link( OInitLoopSwitchMax , IEndOfInitLoopSwitchMax ) + LInitLoopSwitchMaxEndOfInitLoopSwitchMax = GraphSwitchCheckDefault2.Link( OInitLoopSwitchMax , IEndOfInitLoopSwitchMax ) - LSwitchOddIsOddGate = GraphSwitchCheckDefault1.Link( OSwitchOdd , IIsOddGate ) + LSwitchOddIsOddGate = GraphSwitchCheckDefault2.Link( OSwitchOdd , IIsOddGate ) LSwitchOddIsOddGate.AddCoord( 1 , 401 , 101 ) LSwitchOddIsOddGate.AddCoord( 2 , 401 , 160 ) - LSwitchOddPrintOddGate = GraphSwitchCheckDefault1.Link( OSwitchOdd , IPrintOddGate ) + LSwitchOddPrintOddGate = GraphSwitchCheckDefault2.Link( OSwitchOdd , IPrintOddGate ) LSwitchOddPrintOddGate.AddCoord( 1 , 401 , 245 ) LSwitchOddPrintOddGate.AddCoord( 2 , 401 , 159 ) - LSwitchEvenIsEvenGate = GraphSwitchCheckDefault1.Link( OSwitchEven , IIsEvenGate ) + LSwitchEvenIsEvenGate = GraphSwitchCheckDefault2.Link( OSwitchEven , IIsEvenGate ) LSwitchEvenIsEvenGate.AddCoord( 1 , 392 , 533 ) LSwitchEvenIsEvenGate.AddCoord( 2 , 392 , 182 ) - LSwitchEvenPrintEvenGate = GraphSwitchCheckDefault1.Link( OSwitchEven , IPrintEvenGate ) + LSwitchEvenPrintEvenGate = GraphSwitchCheckDefault2.Link( OSwitchEven , IPrintEvenGate ) LSwitchEvenPrintEvenGate.AddCoord( 1 , 392 , 403 ) LSwitchEvenPrintEvenGate.AddCoord( 2 , 392 , 181 ) - LSwitchaIsOdda = GraphSwitchCheckDefault1.Link( OSwitcha , IIsOdda ) + LSwitchaIsOdda = GraphSwitchCheckDefault2.Link( OSwitcha , IIsOdda ) LSwitchaIsOdda.AddCoord( 1 , 382 , 78 ) LSwitchaIsOdda.AddCoord( 2 , 382 , 199 ) - LSwitchaIsEvena = GraphSwitchCheckDefault1.Link( OSwitcha , IIsEvena ) + LSwitchaIsEvena = GraphSwitchCheckDefault2.Link( OSwitcha , IIsEvena ) LSwitchaIsEvena.AddCoord( 1 , 381 , 509 ) LSwitchaIsEvena.AddCoord( 2 , 382 , 200 ) - LSwitchaPrintOdda = GraphSwitchCheckDefault1.Link( OSwitcha , IPrintOdda ) + LSwitchaPrintOdda = GraphSwitchCheckDefault2.Link( OSwitcha , IPrintOdda ) - LSwitchaPrintEvena = GraphSwitchCheckDefault1.Link( OSwitcha , IPrintEvena ) + LSwitchaPrintEvena = GraphSwitchCheckDefault2.Link( OSwitcha , IPrintEvena ) LSwitchaPrintEvena.AddCoord( 1 , 381 , 361 ) LSwitchaPrintEvena.AddCoord( 2 , 382 , 200 ) - LSwitchaDefaulta = GraphSwitchCheckDefault1.Link( OSwitcha , IDefaulta ) + LSwitchaDefaulta = GraphSwitchCheckDefault2.Link( OSwitcha , IDefaulta ) LSwitchaDefaulta.AddCoord( 1 , 382 , 663 ) LSwitchaDefaulta.AddCoord( 2 , 382 , 199 ) - LSwitchBranchPrintOddBranch = GraphSwitchCheckDefault1.Link( OSwitchBranch , IPrintOddBranch ) + LSwitchBranchPrintOddBranch = GraphSwitchCheckDefault2.Link( OSwitchBranch , IPrintOddBranch ) - LSwitchBranchPrintEvenBranch = GraphSwitchCheckDefault1.Link( OSwitchBranch , IPrintEvenBranch ) + LSwitchBranchPrintEvenBranch = GraphSwitchCheckDefault2.Link( OSwitchBranch , IPrintEvenBranch ) LSwitchBranchPrintEvenBranch.AddCoord( 1 , 369 , 381 ) LSwitchBranchPrintEvenBranch.AddCoord( 2 , 369 , 219 ) - LSwitchBranchDefaultBranch = GraphSwitchCheckDefault1.Link( OSwitchBranch , IDefaultBranch ) + LSwitchBranchDefaultBranch = GraphSwitchCheckDefault2.Link( OSwitchBranch , IDefaultBranch ) LSwitchBranchDefaultBranch.AddCoord( 1 , 370 , 683 ) LSwitchBranchDefaultBranch.AddCoord( 2 , 370 , 220 ) - LSwitchdefaultDefaultGate = GraphSwitchCheckDefault1.Link( OSwitchdefault , IDefaultGate ) + LSwitchdefaultDefaultGate = GraphSwitchCheckDefault2.Link( OSwitchdefault , IDefaultGate ) LSwitchdefaultDefaultGate.AddCoord( 1 , 363 , 707 ) LSwitchdefaultDefaultGate.AddCoord( 2 , 362 , 239 ) - LEndOfSwitchaEndOfInitLoopSwitchIndex = GraphSwitchCheckDefault1.Link( OEndOfSwitcha , IEndOfInitLoopSwitchIndex ) + LSwitchDefaultEndOfSwitchDefault = GraphSwitchCheckDefault2.Link( OSwitchDefault , IEndOfSwitchDefault ) - LPutaaEndOfSwitcha = GraphSwitchCheckDefault1.Link( OPutaa , IEndOfSwitcha ) + LEndOfSwitchaEndOfInitLoopSwitchIndex = GraphSwitchCheckDefault2.Link( OEndOfSwitcha , IEndOfInitLoopSwitchIndex ) - LPutBranchBranchEndOfSwitchBranch = GraphSwitchCheckDefault1.Link( OPutBranchBranch , IEndOfSwitchBranch ) + LPutaaEndOfSwitcha = GraphSwitchCheckDefault2.Link( OPutaa , IEndOfSwitcha ) + + LPutBranchBranchEndOfSwitchBranch = GraphSwitchCheckDefault2.Link( OPutBranchBranch , IEndOfSwitchBranch ) # Input datas IInitLoopSwitchIndex.Input( 0 ) @@ -323,12 +325,10 @@ def DefGraphSwitchCheckDefault1() : IInitLoopSwitchMax.Input( 10 ) # Output Ports of the graph - #OIsEvena = IsEven.GetOutPort( 'a' ) - #OPrintEvenBranch = PrintEven.GetOutPort( 'Branch' ) #OEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetOutPort( 'Index' ) #OEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetOutPort( 'Min' ) #OEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetOutPort( 'Max' ) - return GraphSwitchCheckDefault1 + return GraphSwitchCheckDefault2 -GraphSwitchCheckDefault1 = DefGraphSwitchCheckDefault1() +GraphSwitchCheckDefault2 = DefGraphSwitchCheckDefault2() diff --git a/examples/GraphSwitchCheckDefault2.xml b/examples/GraphSwitchCheckDefault2.xml index 3022d34..ba59f46 100644 --- a/examples/GraphSwitchCheckDefault2.xml +++ b/examples/GraphSwitchCheckDefault2.xml @@ -5,11 +5,11 @@ ? ? - GraphSwitchCheckDefault1 + GraphSwitchCheckDefault2 1 ? -GraphSwitchCheckDefault1 +GraphSwitchCheckDefault1_1_1 long @@ -22,12 +22,6 @@ InitLoopSwitch__Max -long - IsEven__a - -string - PrintEven__Branch - long EndOfInitLoopSwitch__Index @@ -39,7 +33,7 @@ 13/1/2005 - 12:21:43 - 13/1/2005 - 12:33:25 + 19/1/2005 - 12:15:25 2.0 JR ? @@ -72,8 +66,8 @@ - 13/1/2005 - 12:23:17 - 13/1/2005 - 12:23:17 + 19/1/2005 - 12:15:25 + 19/1/2005 - 12:15:25 2.0 ? ? @@ -105,8 +99,8 @@ - 13/1/2005 - 12:23:17 - 13/1/2005 - 12:23:17 + 19/1/2005 - 12:15:25 + 19/1/2005 - 12:15:25 2.0 ? ? @@ -141,8 +135,8 @@ - 13/1/2005 - 12:23:17 - 13/1/2005 - 12:23:17 + 19/1/2005 - 12:15:25 + 19/1/2005 - 12:15:25 2.0 ? ? @@ -177,8 +171,8 @@ - 13/1/2005 - 12:23:17 - 13/1/2005 - 12:23:17 + 19/1/2005 - 12:15:25 + 19/1/2005 - 12:15:25 2.0 ? ? @@ -215,8 +209,8 @@ - 13/1/2005 - 12:23:17 - 13/1/2005 - 12:23:17 + 19/1/2005 - 12:15:25 + 19/1/2005 - 12:15:25 2.0 ? ? @@ -253,8 +247,8 @@ - 13/1/2005 - 12:23:17 - 13/1/2005 - 12:23:17 + 19/1/2005 - 12:15:25 + 19/1/2005 - 12:15:25 2.0 ? ? @@ -311,8 +305,8 @@ - 13/1/2005 - 12:23:17 - 13/1/2005 - 12:23:17 + 19/1/2005 - 12:15:25 + 19/1/2005 - 12:15:25 2.0 ? ? @@ -355,8 +349,8 @@ - 13/1/2005 - 12:23:17 - 13/1/2005 - 12:23:17 + 19/1/2005 - 12:15:25 + 19/1/2005 - 12:15:25 2.0 ? ? @@ -406,8 +400,8 @@ - 13/1/2005 - 12:23:17 - 13/1/2005 - 12:23:17 + 19/1/2005 - 12:15:25 + 19/1/2005 - 12:15:25 2.0 ? ? @@ -441,8 +435,8 @@ - 13/1/2005 - 12:23:17 - 13/1/2005 - 12:23:17 + 19/1/2005 - 12:15:25 + 19/1/2005 - 12:15:25 2.0 ? ? @@ -473,14 +467,14 @@ - 13/1/2005 - 12:31:48 - 13/1/2005 - 12:31:48 + 19/1/2005 - 12:15:25 + 19/1/2005 - 12:15:25 2.0 ? ? Compute Node - 658 - 472 + 665 + 486 ? ? @@ -505,8 +499,8 @@ - 13/1/2005 - 12:32:11 - 13/1/2005 - 12:32:11 + 19/1/2005 - 12:15:25 + 19/1/2005 - 12:15:25 2.0 ? ? @@ -524,12 +518,24 @@ 646 78 +IsEven + a + EndOfSwitch + a + + PrintOdd Branch EmptyNode Branch +PrintEven + Branch + EndOfSwitch + Branch + + EmptyNode a EndOfSwitch @@ -542,24 +548,12 @@ Branch -Default - a - EndOfSwitch - a - - Default a Puta a -Default - Branch - EndOfSwitch - Branch - - Default Branch PutBranch @@ -740,6 +734,12 @@ 362 239 +Switch + Default + EndOfSwitch + Default + + EndOfSwitch a EndOfInitLoopSwitch @@ -759,7 +759,7 @@ -GraphSwitchCheckDefault1 +GraphSwitchCheckDefault2 InitLoopSwitch__Index InitLoopSwitch Index @@ -768,7 +768,7 @@ 0 -GraphSwitchCheckDefault1 +GraphSwitchCheckDefault2 InitLoopSwitch__Min InitLoopSwitch Min @@ -777,7 +777,7 @@ -5 -GraphSwitchCheckDefault1 +GraphSwitchCheckDefault2 InitLoopSwitch__Max InitLoopSwitch Max diff --git a/examples/GraphSwitchCrash.py b/examples/GraphSwitchCrash.py index f22827a..8c222c3 100755 --- a/examples/GraphSwitchCrash.py +++ b/examples/GraphSwitchCrash.py @@ -2,236 +2,259 @@ # Generated python file of Graph GraphSwitchCrash 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 +def DefGraphSwitchCrash() : + GraphSwitchCrash = Graph( 'GraphSwitchCrash' ) + GraphSwitchCrash.SetName( 'GraphSwitchCrash' ) + GraphSwitchCrash.SetAuthor( '' ) + GraphSwitchCrash.SetComment( '' ) + GraphSwitchCrash.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.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.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.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.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.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.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.Link( OIsOdda , IEndOfSwitcha ) + LIsOddaEndOfSwitcha.AddCoord( 1 , 572 , 157 ) + LIsOddaEndOfSwitcha.AddCoord( 2 , 572 , 130 ) + + LInitLoopSwitchIndexSwitcha = GraphSwitchCrash.Link( OInitLoopSwitchIndex , ISwitcha ) + + LInitLoopSwitchMinEndOfInitLoopSwitchMin = GraphSwitchCrash.Link( OInitLoopSwitchMin , IEndOfInitLoopSwitchMin ) + + LInitLoopSwitchMaxEndOfInitLoopSwitchMax = GraphSwitchCrash.Link( OInitLoopSwitchMax , IEndOfInitLoopSwitchMax ) + + LSwitchOddIsOddGate = GraphSwitchCrash.Link( OSwitchOdd , IIsOddGate ) + + LSwitchaIsOdda = GraphSwitchCrash.Link( OSwitcha , IIsOdda ) + LSwitchaIsOdda.AddCoord( 1 , 365 , 129 ) + LSwitchaIsOdda.AddCoord( 2 , 365 , 201 ) + + LSwitchDefaultEndOfSwitchDefault = GraphSwitchCrash.Link( OSwitchDefault , IEndOfSwitchDefault ) + + LEndOfSwitchaEndOfInitLoopSwitchIndex = GraphSwitchCrash.Link( OEndOfSwitcha , IEndOfInitLoopSwitchIndex ) + + LIsOdd_1aEndSwitcha = GraphSwitchCrash.Link( OIsOdd_1a , IEndSwitcha ) + LIsOdd_1aEndSwitcha.AddCoord( 1 , 593 , 411 ) + LIsOdd_1aEndSwitcha.AddCoord( 2 , 593 , 358 ) + + LInitLoopIndexSwitch_1a = GraphSwitchCrash.Link( OInitLoopIndex , ISwitch_1a ) + + LInitLoopMinEndOfInitLoopMin = GraphSwitchCrash.Link( OInitLoopMin , IEndOfInitLoopMin ) + + LInitLoopMaxEndOfInitLoopMax = GraphSwitchCrash.Link( OInitLoopMax , IEndOfInitLoopMax ) + + LSwitch_1OddIsOdd_1Gate = GraphSwitchCrash.Link( OSwitch_1Odd , IIsOdd_1Gate ) + + LSwitch_1EvenIsOdd_1Even = GraphSwitchCrash.Link( OSwitch_1Even , IIsOdd_1Even ) + + LSwitch_1aIsOdd_1a = GraphSwitchCrash.Link( OSwitch_1a , IIsOdd_1a ) + LSwitch_1aIsOdd_1a.AddCoord( 1 , 377 , 358 ) + LSwitch_1aIsOdd_1a.AddCoord( 2 , 377 , 460 ) + + LSwitch_1DefaultEndSwitchDefault = GraphSwitchCrash.Link( OSwitch_1Default , IEndSwitchDefault ) + + LEndSwitchaEndOfInitLoopIndex = GraphSwitchCrash.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 -# 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 = DefGraphSwitchCrash() diff --git a/examples/GraphSwitchCrash.xml b/examples/GraphSwitchCrash.xml index 50c0b25..ba5135b 100755 --- a/examples/GraphSwitchCrash.xml +++ b/examples/GraphSwitchCrash.xml @@ -1,670 +1,667 @@ - + + ? - ? - GraphSwitchCrash - 1 - ? - + ? + GraphSwitchCrash + 1 + ? + GraphSwitchCrash - + 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 + 15/2/2005 - 9:47:50 + 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 - + + + + + + 15/2/2005 - 9:47:50 + 15/2/2005 - 9:47:50 + 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 - + + + + 15/2/2005 - 9:47:50 + 15/2/2005 - 9:47:50 + 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 + + + +? + + 15/2/2005 - 9:47:50 + 15/2/2005 - 9:47:50 + 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 - + + + + + + 15/2/2005 - 9:47:50 + 15/2/2005 - 9:47:50 + 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 + + + +? + + 15/2/2005 - 9:47:50 + 15/2/2005 - 9:47:50 + 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 - + + + + + + 15/2/2005 - 9:47:50 + 15/2/2005 - 9:47:50 + 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 - + + + + 15/2/2005 - 9:47:50 + 15/2/2005 - 9:47:50 + 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 + + + +? + + 15/2/2005 - 9:47:50 + 15/2/2005 - 9:47:50 + 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 - + + + + + + 15/2/2005 - 9:47:50 + 15/2/2005 - 9:47:50 + 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 + + + +? + + 15/2/2005 - 9:47:50 + 15/2/2005 - 9:47:50 + 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 - + InitLoopSwitch__Index + InitLoopSwitch + Index + 3 - 0 - - + 0 + + GraphSwitchCrash - InitLoopSwitch\Min - InitLoopSwitch - Min - + InitLoopSwitch__Min + InitLoopSwitch + Min + 3 - 0 - - + 0 + + GraphSwitchCrash - InitLoopSwitch\Max - InitLoopSwitch - Max - + InitLoopSwitch__Max + InitLoopSwitch + Max + 3 - 100 - - + 23 + + GraphSwitchCrash - InitLoop\Index - InitLoop - Index - + InitLoop__Index + InitLoop + Index + 3 - 0 - - + 0 + + GraphSwitchCrash - InitLoop\Min - InitLoop - Min - + InitLoop__Min + InitLoop + Min + 3 - 0 - - + 0 + + GraphSwitchCrash - InitLoop\Max - InitLoop - Max - + InitLoop__Max + InitLoop + Max + 3 - 100 - + 31 + diff --git a/examples/GraphSwitchErrExec.py b/examples/GraphSwitchErrExec.py index 4706bb0..6fd030e 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( 'JR' ) + 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,11 +62,11 @@ 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' ) - EndOfInitLoopSwitch.Coords( 766 , 127 ) + EndOfInitLoopSwitch.Coords( 772 , 169 ) PyEndOfInitLoopSwitch = [] EndOfInitLoopSwitch.SetPyFunction( '' , PyEndOfInitLoopSwitch ) IInitLoopSwitchDoLoop = InitLoopSwitch.GetInPort( 'DoLoop' ) @@ -104,11 +104,11 @@ 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' ) - EndOfSwitch.Coords( 580 , 147 ) + EndOfSwitch.Coords( 581 , 169 ) PyEndOfSwitch = [] EndOfSwitch.SetPyFunction( 'EndSwitch_1' , PyEndOfSwitch ) IEndOfSwitcha = EndOfSwitch.InPort( 'a' , 'long' ) @@ -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..86245a3 100644 --- a/examples/GraphSwitchErrExec.xml +++ b/examples/GraphSwitchErrExec.xml @@ -5,11 +5,11 @@ ? ? - GraphSwitch_1 + GraphSwitchErrExec 1 ? -GraphSwitch_1 +GraphSwitchErrExec long @@ -33,9 +33,9 @@ 1/10/2003 - 17:23:54 - 12/1/2005 - 16:10:58 + 15/2/2005 - 9:50:31 1.05 - ? + JR ? ? 0 @@ -66,8 +66,8 @@ - 12/1/2005 - 16:10:58 - 12/1/2005 - 16:10:58 + 15/2/2005 - 9:50:31 + 15/2/2005 - 9:50:31 1.05 ? ? @@ -122,8 +122,8 @@ - 12/1/2005 - 16:10:58 - 12/1/2005 - 16:10:58 + 15/2/2005 - 9:50:31 + 15/2/2005 - 9:50:31 1.05 ? ? @@ -163,14 +163,14 @@ ? - 12/1/2005 - 16:10:58 - 12/1/2005 - 16:10:58 + 15/2/2005 - 9:50:31 + 15/2/2005 - 9:50:31 1.05 ? ? Compute Node - 766 - 127 + 772 + 169 ? ? @@ -196,8 +196,8 @@ - 12/1/2005 - 16:10:58 - 12/1/2005 - 16:10:58 + 15/2/2005 - 9:50:31 + 15/2/2005 - 9:50:31 2.0 ? ? @@ -239,8 +239,8 @@ - 12/1/2005 - 16:10:58 - 12/1/2005 - 16:10:58 + 15/2/2005 - 9:50:31 + 15/2/2005 - 9:50:31 2.0 ? ? @@ -268,14 +268,14 @@ EndSwitch_1 - 12/1/2005 - 16:10:58 - 12/1/2005 - 16:10:58 + 15/2/2005 - 9:50:31 + 15/2/2005 - 9:50:31 2.0 ? ? Compute Node - 580 - 147 + 581 + 169 IsOdd @@ -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/GraphSwitchOutput.py b/examples/GraphSwitchOutput.py index 2c9c777..81e96cc 100644 --- a/examples/GraphSwitchOutput.py +++ b/examples/GraphSwitchOutput.py @@ -1,60 +1,64 @@ -# Generated python file of Graph GraphSwitch_1_1 +# Generated python file of Graph GraphSwitchOutput from SuperV import * -# Graph creation of GraphSwitch_1_1 -def DefGraphSwitch_1_1() : - GraphSwitch_1_1 = Graph( 'GraphSwitch_1_1' ) - GraphSwitch_1_1.SetName( 'GraphSwitch_1_1' ) - GraphSwitch_1_1.SetAuthor( '' ) - GraphSwitch_1_1.SetComment( '' ) - GraphSwitch_1_1.Coords( 0 , 0 ) +# Graph creation of GraphSwitchOutput +def DefGraphSwitchOutput() : + GraphSwitchOutput = Graph( 'GraphSwitchOutput' ) + GraphSwitchOutput.SetName( 'GraphSwitchOutput' ) + GraphSwitchOutput.SetAuthor( 'JR' ) + GraphSwitchOutput.SetComment( '' ) + GraphSwitchOutput.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 = GraphSwitch_1_1.INode( 'IsOdd' , PyIsOdd ) + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd(a,Branch) : ' ) + PyIsOdd.append( ' print a,"IsOdd (GraphSwitch)" ' ) + PyIsOdd.append( ' sleep( 1 ) ' ) + PyIsOdd.append( ' return a,Branch ' ) + IsOdd = GraphSwitchOutput.INode( 'IsOdd' , PyIsOdd ) IsOdd.SetName( 'IsOdd' ) IsOdd.SetAuthor( '' ) IsOdd.SetComment( 'Python function' ) - IsOdd.Coords( 388 , 50 ) + IsOdd.Coords( 438 , 50 ) IIsOdda = IsOdd.InPort( 'a' , 'long' ) + IIsOddBranch = IsOdd.InPort( 'Branch' , 'string' ) IIsOddGate = IsOdd.GetInPort( 'Gate' ) OIsOdda = IsOdd.OutPort( 'a' , 'long' ) + OIsOddBranch = IsOdd.OutPort( 'Branch' , 'string' ) 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 = GraphSwitch_1_1.INode( 'IsEven' , PyIsEven ) + PyIsEven.append( 'from time import * ' ) + PyIsEven.append( 'def IsEven(a,Branch) : ' ) + PyIsEven.append( ' print a,"IsEven (GraphSwitch)" ' ) + PyIsEven.append( ' sleep( 1 ) ' ) + PyIsEven.append( ' return a,Branch ' ) + IsEven = GraphSwitchOutput.INode( 'IsEven' , PyIsEven ) IsEven.SetName( 'IsEven' ) IsEven.SetAuthor( '' ) IsEven.SetComment( 'Compute Node' ) - IsEven.Coords( 395 , 334 ) + IsEven.Coords( 437 , 334 ) IIsEvena = IsEven.InPort( 'a' , 'long' ) + IIsEvenBranch = IsEven.InPort( 'Branch' , 'string' ) IIsEvenGate = IsEven.GetInPort( 'Gate' ) OIsEvena = IsEven.OutPort( 'a' , 'long' ) + OIsEvenBranch = IsEven.OutPort( 'Branch' , 'string' ) OIsEvenGate = IsEven.GetOutPort( 'Gate' ) PyPrint = [] PyPrint.append( 'def Print(a,Branch) : ' ) PyPrint.append( ' print "Print ",Branch ' ) PyPrint.append( ' return a,Branch ' ) - Print = GraphSwitch_1_1.INode( 'Print' , PyPrint ) + Print = GraphSwitchOutput.INode( 'Print' , PyPrint ) Print.SetName( 'Print' ) Print.SetAuthor( '' ) Print.SetComment( 'Compute Node' ) - Print.Coords( 639 , 63 ) + Print.Coords( 640 , 50 ) IPrinta = Print.InPort( 'a' , 'long' ) IPrintBranch = Print.InPort( 'Branch' , 'string' ) IPrintGate = Print.GetInPort( 'Gate' ) @@ -66,11 +70,11 @@ def DefGraphSwitch_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.INode( 'Print_1' , PyPrint_1 ) + Print_1 = GraphSwitchOutput.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( 634 , 334 ) IPrint_1a = Print_1.InPort( 'a' , 'long' ) IPrint_1Branch = Print_1.InPort( 'Branch' , 'string' ) IPrint_1Gate = Print_1.GetInPort( 'Gate' ) @@ -94,11 +98,11 @@ def DefGraphSwitch_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.LNode( 'InitLoop' , PyInitLoopSwitch , 'MoreLoop' , PyMoreInitLoopSwitch , 'NextLoop' , PyNextInitLoopSwitch ) + InitLoopSwitch,EndOfInitLoopSwitch = GraphSwitchOutput.LNode( 'InitLoop' , PyInitLoopSwitch , 'MoreLoop' , PyMoreInitLoopSwitch , 'NextLoop' , PyNextInitLoopSwitch ) EndOfInitLoopSwitch.SetName( 'EndOfInitLoopSwitch' ) EndOfInitLoopSwitch.SetAuthor( '' ) EndOfInitLoopSwitch.SetComment( 'Compute Node' ) - EndOfInitLoopSwitch.Coords( 1082 , 150 ) + EndOfInitLoopSwitch.Coords( 1067 , 209 ) PyEndOfInitLoopSwitch = [] EndOfInitLoopSwitch.SetPyFunction( '' , PyEndOfInitLoopSwitch ) IInitLoopSwitchDoLoop = InitLoopSwitch.GetInPort( 'DoLoop' ) @@ -138,11 +142,11 @@ def DefGraphSwitch_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.SNode( 'Switch' , PySwitch ) + Switch,EndOfSwitch = GraphSwitchOutput.SNode( 'Switch' , PySwitch ) EndOfSwitch.SetName( 'EndOfSwitch' ) EndOfSwitch.SetAuthor( '' ) EndOfSwitch.SetComment( 'Compute Node' ) - EndOfSwitch.Coords( 880 , 150 ) + EndOfSwitch.Coords( 872 , 209 ) PyEndOfSwitch = [] EndOfSwitch.SetPyFunction( 'EndSwitch_1' , PyEndOfSwitch ) IEndOfSwitcha = EndOfSwitch.InPort( 'a' , 'long' ) @@ -163,35 +167,39 @@ def DefGraphSwitch_1_1() : OSwitchDefault = Switch.GetOutPort( 'Default' ) # Creation of Links - LIsOddaPrinta = GraphSwitch_1_1.Link( OIsOdda , IPrinta ) + LIsOddaPrinta = GraphSwitchOutput.Link( OIsOdda , IPrinta ) - LInitLoopSwitchIndexSwitcha = GraphSwitch_1_1.Link( OInitLoopSwitchIndex , ISwitcha ) + LIsOddBranchPrintBranch = GraphSwitchOutput.Link( OIsOddBranch , IPrintBranch ) - LInitLoopSwitchMinEndOfInitLoopSwitchMin = GraphSwitch_1_1.Link( OInitLoopSwitchMin , IEndOfInitLoopSwitchMin ) + LInitLoopSwitchIndexSwitcha = GraphSwitchOutput.Link( OInitLoopSwitchIndex , ISwitcha ) - LInitLoopSwitchMaxEndOfInitLoopSwitchMax = GraphSwitch_1_1.Link( OInitLoopSwitchMax , IEndOfInitLoopSwitchMax ) + LInitLoopSwitchMinEndOfInitLoopSwitchMin = GraphSwitchOutput.Link( OInitLoopSwitchMin , IEndOfInitLoopSwitchMin ) - LIsEvenaPrint_1a = GraphSwitch_1_1.Link( OIsEvena , IPrint_1a ) + LInitLoopSwitchMaxEndOfInitLoopSwitchMax = GraphSwitchOutput.Link( OInitLoopSwitchMax , IEndOfInitLoopSwitchMax ) - LSwitchOddIsOddGate = GraphSwitch_1_1.Link( OSwitchOdd , IIsOddGate ) + LIsEvenaPrint_1a = GraphSwitchOutput.Link( OIsEvena , IPrint_1a ) - LSwitchEvenIsEvenGate = GraphSwitch_1_1.Link( OSwitchEven , IIsEvenGate ) + LIsEvenBranchPrint_1Branch = GraphSwitchOutput.Link( OIsEvenBranch , IPrint_1Branch ) - LSwitchaIsOdda = GraphSwitch_1_1.Link( OSwitcha , IIsOdda ) + LSwitchOddIsOddGate = GraphSwitchOutput.Link( OSwitchOdd , IIsOddGate ) - LSwitchaIsEvena = GraphSwitch_1_1.Link( OSwitcha , IIsEvena ) + LSwitchEvenIsEvenGate = GraphSwitchOutput.Link( OSwitchEven , IIsEvenGate ) - LSwitchBranchPrintBranch = GraphSwitch_1_1.Link( OSwitchBranch , IPrintBranch ) + LSwitchaIsOdda = GraphSwitchOutput.Link( OSwitcha , IIsOdda ) - LSwitchBranchPrint_1Branch = GraphSwitch_1_1.Link( OSwitchBranch , IPrint_1Branch ) + LSwitchaIsEvena = GraphSwitchOutput.Link( OSwitcha , IIsEvena ) - LSwitchDefaultEndOfSwitchDefault = GraphSwitch_1_1.Link( OSwitchDefault , IEndOfSwitchDefault ) + LSwitchBranchIsOddBranch = GraphSwitchOutput.Link( OSwitchBranch , IIsOddBranch ) - LEndOfSwitchaEndOfInitLoopSwitchIndex = GraphSwitch_1_1.Link( OEndOfSwitcha , IEndOfInitLoopSwitchIndex ) + LSwitchBranchIsEvenBranch = GraphSwitchOutput.Link( OSwitchBranch , IIsEvenBranch ) - LPrintaEndOfSwitcha = GraphSwitch_1_1.Link( OPrinta , IEndOfSwitcha ) + LSwitchDefaultEndOfSwitchDefault = GraphSwitchOutput.Link( OSwitchDefault , IEndOfSwitchDefault ) - LPrint_1aEndOfSwitcha = GraphSwitch_1_1.Link( OPrint_1a , IEndOfSwitcha ) + LEndOfSwitchaEndOfInitLoopSwitchIndex = GraphSwitchOutput.Link( OEndOfSwitcha , IEndOfInitLoopSwitchIndex ) + + LPrintaEndOfSwitcha = GraphSwitchOutput.Link( OPrinta , IEndOfSwitcha ) + + LPrint_1aEndOfSwitcha = GraphSwitchOutput.Link( OPrint_1a , IEndOfSwitcha ) # Input datas IInitLoopSwitchIndex.Input( 0 ) @@ -205,7 +213,7 @@ def DefGraphSwitch_1_1() : #OSwitchdefault = Switch.GetOutPort( 'default' ) #OPrintBranch = Print.GetOutPort( 'Branch' ) #OPrint_1Branch = Print_1.GetOutPort( 'Branch' ) - return GraphSwitch_1_1 + return GraphSwitchOutput -GraphSwitch_1_1 = DefGraphSwitch_1_1() +GraphSwitchOutput = DefGraphSwitchOutput() diff --git a/examples/GraphSwitchOutput.xml b/examples/GraphSwitchOutput.xml index 86d6720..8c7f0bd 100644 --- a/examples/GraphSwitchOutput.xml +++ b/examples/GraphSwitchOutput.xml @@ -5,11 +5,11 @@ ? ? - GraphSwitch_1_1 + GraphSwitchOutput 1 ? -GraphSwitch_1_1 +GraphSwitchOutput long @@ -42,9 +42,9 @@ 1/10/2003 - 17:23:54 - 13/1/2005 - 11:21:30 + 15/2/2005 - 9:59:57 1.05 - ? + JR ? ? 0 @@ -61,27 +61,33 @@ long - a + a + +string + Branch long - a + a + +string + Branch IsOdd - - - - - - 13/1/2005 - 11:17:18 - 13/1/2005 - 11:17:18 + + + + + + 15/2/2005 - 9:59:57 + 15/2/2005 - 9:59:57 1.05 ? ? Python function - 388 + 438 50 ? @@ -131,8 +137,8 @@ - 13/1/2005 - 11:17:18 - 13/1/2005 - 11:17:18 + 15/2/2005 - 9:59:57 + 15/2/2005 - 9:59:57 1.05 ? ? @@ -172,14 +178,14 @@ ? - 13/1/2005 - 11:17:18 - 13/1/2005 - 11:17:18 + 15/2/2005 - 9:59:57 + 15/2/2005 - 9:59:57 1.05 ? ? Compute Node - 1082 - 150 + 1067 + 209 ? ? @@ -191,27 +197,33 @@ long - a + a + +string + Branch long - a + a + +string + Branch IsEven - - - - - - 13/1/2005 - 11:17:18 - 13/1/2005 - 11:17:18 + + + + + + 15/2/2005 - 9:59:57 + 15/2/2005 - 9:59:57 2.0 ? ? Compute Node - 395 + 437 334 ? @@ -256,8 +268,8 @@ - 13/1/2005 - 11:17:18 - 13/1/2005 - 11:17:18 + 15/2/2005 - 9:59:57 + 15/2/2005 - 9:59:57 2.0 ? ? @@ -285,14 +297,14 @@ EndSwitch_1 - 13/1/2005 - 11:17:18 - 13/1/2005 - 11:17:18 + 15/2/2005 - 9:59:57 + 15/2/2005 - 9:59:57 2.0 ? ? Compute Node - 880 - 150 + 872 + 209 ? ? @@ -300,7 +312,7 @@ 3 ? -Void +Print long @@ -322,14 +334,14 @@ - 13/1/2005 - 11:17:18 - 13/1/2005 - 11:17:18 + 15/2/2005 - 9:59:57 + 15/2/2005 - 9:59:57 2.0 ? ? Compute Node - 639 - 63 + 640 + 50 ? ? @@ -359,14 +371,14 @@ - 13/1/2005 - 11:20:58 - 13/1/2005 - 11:20:58 + 15/2/2005 - 9:59:57 + 15/2/2005 - 9:59:57 2.0 ? ? Compute Node - 639 - 263 + 634 + 334 IsOdd @@ -375,6 +387,12 @@ a +IsOdd + Branch + Print + Branch + + InitLoopSwitch DoLoop EndOfInitLoopSwitch @@ -411,6 +429,12 @@ a +IsEven + Branch + Print_1 + Branch + + Switch Odd IsOdd @@ -437,13 +461,13 @@ Switch Branch - Print + IsOdd Branch Switch Branch - Print_1 + IsEven Branch @@ -472,7 +496,7 @@ -GraphSwitch_1_1 +GraphSwitchOutput InitLoopSwitch__Index InitLoopSwitch Index @@ -481,7 +505,7 @@ 0 -GraphSwitch_1_1 +GraphSwitchOutput InitLoopSwitch__Min InitLoopSwitch Min @@ -490,7 +514,7 @@ -5 -GraphSwitch_1_1 +GraphSwitchOutput InitLoopSwitch__Max InitLoopSwitch Max diff --git a/examples/GraphSwitchs.py b/examples/GraphSwitchs.py index bf78c81..78eb3ec 100755 --- a/examples/GraphSwitchs.py +++ b/examples/GraphSwitchs.py @@ -1,232 +1,258 @@ -# Generated python file of Graph GraphSwitch +# Generated python file of Graph GraphSwitchs from SuperV import * -# Graph creation -GraphSwitchs = Graph( 'GraphSwitchs' ) -GraphSwitchs.SetName( 'GraphSwitchs' ) -GraphSwitchs.SetAuthor( '' ) -GraphSwitchs.SetComment( '' ) -GraphSwitchs.Coords( 0 , 0 ) -# Creation of Factory Nodes +# Graph creation of GraphSwitchs +def DefGraphSwitchs() : + GraphSwitchs = Graph( 'GraphSwitchs' ) + GraphSwitchs.SetName( 'GraphSwitchs' ) + GraphSwitchs.SetAuthor( 'JR' ) + GraphSwitchs.SetComment( '' ) + GraphSwitchs.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 = GraphSwitchs.INode( 'IsOdd' , PyIsOdd ) + IsOdd.SetName( 'IsOdd' ) + IsOdd.SetAuthor( '' ) + IsOdd.SetComment( 'Python function' ) + IsOdd.Coords( 390 , 66 ) + 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 = GraphSwitchs.INode( 'IsOdd' , PyIsOdd_1 ) + IsOdd_1.SetName( 'IsOdd_1' ) + IsOdd_1.SetAuthor( '' ) + IsOdd_1.SetComment( 'Python function' ) + IsOdd_1.Coords( 415 , 324 ) + 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 = GraphSwitchs.LNode( 'InitLoop' , PyInitLoopSwitch , 'MoreLoop' , PyMoreInitLoopSwitch , 'NextLoop' , PyNextInitLoopSwitch ) + EndOfInitLoopSwitch.SetName( 'EndOfInitLoopSwitch' ) + EndOfInitLoopSwitch.SetAuthor( '' ) + EndOfInitLoopSwitch.SetComment( 'Compute Node' ) + EndOfInitLoopSwitch.Coords( 780 , 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 ) + + 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 = GraphSwitchs.LNode( 'InitLoop' , PyInitLoop , 'MoreLoop' , PyMoreInitLoop , 'NextLoop' , PyNextInitLoop ) + EndOfInitLoop.SetName( 'EndOfInitLoop' ) + EndOfInitLoop.SetAuthor( '' ) + EndOfInitLoop.SetComment( 'Compute Node' ) + EndOfInitLoop.Coords( 800 , 427 ) + 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 = GraphSwitchs.SNode( 'Switch' , PySwitch ) + EndOfSwitch.SetName( 'EndOfSwitch' ) + EndOfSwitch.SetAuthor( '' ) + EndOfSwitch.SetComment( 'Compute Node' ) + EndOfSwitch.Coords( 587 , 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( 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 = GraphSwitchs.SNode( 'Switch' , PySwitch_1 ) + EndSwitch.SetName( 'EndSwitch' ) + EndSwitch.SetAuthor( '' ) + EndSwitch.SetComment( 'Compute Node' ) + EndSwitch.Coords( 605 , 428 ) + 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 = GraphSwitchs.Link( OIsOdda , IEndOfSwitcha ) + LIsOddaEndOfSwitcha.AddCoord( 1 , 569 , 199 ) + LIsOddaEndOfSwitcha.AddCoord( 2 , 569 , 137 ) + + LInitLoopSwitchIndexSwitcha = GraphSwitchs.Link( OInitLoopSwitchIndex , ISwitcha ) + + LInitLoopSwitchMinEndOfInitLoopSwitchMin = GraphSwitchs.Link( OInitLoopSwitchMin , IEndOfInitLoopSwitchMin ) + + LInitLoopSwitchMaxEndOfInitLoopSwitchMax = GraphSwitchs.Link( OInitLoopSwitchMax , IEndOfInitLoopSwitchMax ) + + LSwitchOddIsOddGate = GraphSwitchs.Link( OSwitchOdd , IIsOddGate ) + + LSwitchaIsOdda = GraphSwitchs.Link( OSwitcha , IIsOdda ) + LSwitchaIsOdda.AddCoord( 1 , 365 , 137 ) + LSwitchaIsOdda.AddCoord( 2 , 365 , 201 ) + + LSwitchDefaultEndOfSwitchDefault = GraphSwitchs.Link( OSwitchDefault , IEndOfSwitchDefault ) + + LEndOfSwitchaEndOfInitLoopSwitchIndex = GraphSwitchs.Link( OEndOfSwitcha , IEndOfInitLoopSwitchIndex ) + + LIsOdd_1aEndSwitcha = GraphSwitchs.Link( OIsOdd_1a , IEndSwitcha ) + LIsOdd_1aEndSwitcha.AddCoord( 1 , 592 , 459 ) + LIsOdd_1aEndSwitcha.AddCoord( 2 , 592 , 395 ) + + LInitLoopIndexSwitch_1a = GraphSwitchs.Link( OInitLoopIndex , ISwitch_1a ) + + LInitLoopMinEndOfInitLoopMin = GraphSwitchs.Link( OInitLoopMin , IEndOfInitLoopMin ) + + LInitLoopMaxEndOfInitLoopMax = GraphSwitchs.Link( OInitLoopMax , IEndOfInitLoopMax ) + + LSwitch_1OddIsOdd_1Gate = GraphSwitchs.Link( OSwitch_1Odd , IIsOdd_1Gate ) + + LSwitch_1aIsOdd_1a = GraphSwitchs.Link( OSwitch_1a , IIsOdd_1a ) + LSwitch_1aIsOdd_1a.AddCoord( 1 , 381 , 394 ) + LSwitch_1aIsOdd_1a.AddCoord( 2 , 381 , 458 ) + + LSwitch_1DefaultEndSwitchDefault = GraphSwitchs.Link( OSwitch_1Default , IEndSwitchDefault ) + + LEndSwitchaEndOfInitLoopIndex = GraphSwitchs.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' ) + #OSwitchEven = Switch.GetOutPort( 'Even' ) + #OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) + #OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) + #OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) + #OSwitch_1Even = Switch_1.GetOutPort( 'Even' ) + return GraphSwitchs -# 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 = GraphSwitchs.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_1 (GraphSwitchs)" ' ) -PyIsOdd_1.append( ' sleep( 1 ) ' ) -PyIsOdd_1.append( ' return a ' ) -IsOdd_1 = GraphSwitchs.INode( 'IsOdd' , PyIsOdd_1 ) -IsOdd_1.SetName( 'IsOdd_1' ) -IsOdd_1.SetAuthor( '' ) -IsOdd_1.SetComment( 'Python function' ) -IsOdd_1.Coords( 419 , 308 ) -IsOdd_1.InPort( 'a' , 'long' ) -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 = GraphSwitchs.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 = GraphSwitchs.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 = GraphSwitchs.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 = GraphSwitchs.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 = GraphSwitchs.Link( IsOdda , EndOfSwitch.Port( 'a' ) ) -EndOfSwitcha.AddCoord( 1 , 573 , 160 ) -EndOfSwitcha.AddCoord( 2 , 572 , 130 ) - -InitLoopSwitchIndex = InitLoopSwitch.Port( 'Index' ) -Switcha = GraphSwitchs.Link( InitLoopSwitchIndex , Switch.Port( 'a' ) ) - -InitLoopSwitchMin = InitLoopSwitch.Port( 'Min' ) -EndOfInitLoopSwitchMin = GraphSwitchs.Link( InitLoopSwitchMin , EndOfInitLoopSwitch.Port( 'Min' ) ) - -InitLoopSwitchMax = InitLoopSwitch.Port( 'Max' ) -EndOfInitLoopSwitchMax = GraphSwitchs.Link( InitLoopSwitchMax , EndOfInitLoopSwitch.Port( 'Max' ) ) - -SwitchOdd = Switch.Port( 'Odd' ) -IsOddInGate = GraphSwitchs.Link( SwitchOdd , IsOdd.Port( 'InGate' ) ) - -Switcha = Switch.Port( 'a' ) -IsOdda = GraphSwitchs.Link( Switcha , IsOdd.Port( 'a' ) ) -IsOdda.AddCoord( 1 , 365 , 129 ) -IsOdda.AddCoord( 2 , 365 , 222 ) - -SwitchDefault = Switch.Port( 'Default' ) -EndOfSwitchDefault = GraphSwitchs.Link( SwitchDefault , EndOfSwitch.Port( 'Default' ) ) -EndOfSwitchDefault.AddCoord( 1 , 572 , 194 ) -EndOfSwitchDefault.AddCoord( 2 , 571 , 257 ) - -EndOfSwitcha = EndOfSwitch.Port( 'a' ) -EndOfInitLoopSwitchIndex = GraphSwitchs.Link( EndOfSwitcha , EndOfInitLoopSwitch.Port( 'Index' ) ) - -IsOdd_1a = IsOdd_1.Port( 'a' ) -EndSwitcha = GraphSwitchs.Link( IsOdd_1a , EndSwitch.Port( 'a' ) ) -EndSwitcha.AddCoord( 1 , 599 , 416 ) -EndSwitcha.AddCoord( 2 , 598 , 389 ) - -InitLoopIndex = InitLoop.Port( 'Index' ) -Switch_1a = GraphSwitchs.Link( InitLoopIndex , Switch_1.Port( 'a' ) ) - -InitLoopMin = InitLoop.Port( 'Min' ) -EndOfInitLoopMin = GraphSwitchs.Link( InitLoopMin , EndOfInitLoop.Port( 'Min' ) ) - -InitLoopMax = InitLoop.Port( 'Max' ) -EndOfInitLoopMax = GraphSwitchs.Link( InitLoopMax , EndOfInitLoop.Port( 'Max' ) ) - -Switch_1Odd = Switch_1.Port( 'Odd' ) -IsOdd_1InGate = GraphSwitchs.Link( Switch_1Odd , IsOdd_1.Port( 'InGate' ) ) - -Switch_1Even = Switch_1.Port( 'Even' ) -EndSwitchDefault = GraphSwitchs.Link( Switch_1Even , EndSwitch.Port( 'Default' ) ) - -Switch_1a = Switch_1.Port( 'a' ) -IsOdd_1a = GraphSwitchs.Link( Switch_1a , IsOdd_1.Port( 'a' ) ) -IsOdd_1a.AddCoord( 1 , 379 , 387 ) -IsOdd_1a.AddCoord( 2 , 378 , 481 ) - -EndSwitcha = EndSwitch.Port( 'a' ) -EndOfInitLoopIndex = GraphSwitchs.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' ) - -GraphSwitchs.Run() -GraphSwitchs.DoneW() -print GraphSwitchs.State() -GraphSwitchs.PrintPorts() +GraphSwitchs = DefGraphSwitchs() diff --git a/examples/GraphSwitchs.xml b/examples/GraphSwitchs.xml index 059040e..4ea913b 100755 --- a/examples/GraphSwitchs.xml +++ b/examples/GraphSwitchs.xml @@ -1,655 +1,661 @@ - + + ? - ? - GraphSwitchs - 1 - ? - + ? + GraphSwitchs + 1 + ? + GraphSwitchs - + 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 - 16/10/2003 - 10:57:24 - 1.05 - ? - ? - ? - 0 - 0 - + EndOfInitLoop__Max + +int + Switch_1__Even + + + 14/10/2003 - 10:29:4 + 15/2/2005 - 10:2:34 + 1.05 + JR + ? + ? + 0 + 0 + ? - ? - IsOdd - 3 - ? - + ? + IsOdd + 3 + ? + IsOdd - + long - a - + a + long - a - - + a + + IsOdd - - - - - - 16/10/2003 - 10:57:24 - 16/10/2003 - 10:57:24 - 1.05 - ? - ? - Python function - 388 - 50 - + + + + + + 15/2/2005 - 10:2:34 + 15/2/2005 - 10:2:34 + 1.05 + ? + ? + Python function + 390 + 66 + ? - ? - 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 - - - - 16/10/2003 - 10:57:24 - 16/10/2003 - 10:57:24 - 1.05 - ? - ? - ? - 10 - 129 - + + + + 15/2/2005 - 10:2:34 + 15/2/2005 - 10:2:34 + 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 - - - - 16/10/2003 - 10:57:24 - 16/10/2003 - 10:57:24 - 1.05 - ? - ? - ? - 766 - 127 - + Max + + + +? + + 15/2/2005 - 10:2:34 + 15/2/2005 - 10:2:34 + 1.05 + ? + ? + Compute Node + 780 + 170 + ? - ? - Switch - 6 - EndOfSwitch - + ? + Switch + 6 + EndOfSwitch + Switch - + long - a - + a + long - Odd - + Odd + int - Even - + Even + int - a - - + a + + Switch - - - - - - 16/10/2003 - 10:57:24 - 16/10/2003 - 10:57:24 - 1.05 - ? - ? - ? - 186 - 130 - + + + + + + 15/2/2005 - 10:2:34 + 15/2/2005 - 10:2:34 + 1.05 + ? + ? + Compute Node + 186 + 130 + ? - ? - EndOfSwitch - 7 - Switch - + ? + EndOfSwitch + 7 + Switch + EndOfSwitch - + long - a - + a + long - a - - - - 16/10/2003 - 10:57:24 - 16/10/2003 - 10:57:24 - 1.05 - ? - ? - ? - 587 - 126 - + a + + + +? + + 15/2/2005 - 10:2:34 + 15/2/2005 - 10:2:34 + 1.05 + ? + ? + Compute Node + 587 + 170 + ? - ? - IsOdd_1 - 3 - ? - + ? + IsOdd_1 + 3 + ? + IsOdd_1 - + long - a - + a + long - a - - + a + + IsOdd - - - - - - 16/10/2003 - 10:57:24 - 16/10/2003 - 10:57:24 - 1.05 - ? - ? - Python function - 419 - 308 - + + + + + + 15/2/2005 - 10:2:34 + 15/2/2005 - 10:2:34 + 1.05 + ? + ? + Python function + 415 + 324 + ? - ? - 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 - - - - 16/10/2003 - 10:57:24 - 16/10/2003 - 10:57:24 - 1.05 - ? - ? - ? - 10 - 388 - + + + + 15/2/2005 - 10:2:34 + 15/2/2005 - 10:2:34 + 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 - - - - 16/10/2003 - 10:57:24 - 16/10/2003 - 10:57:24 - 1.05 - ? - ? - ? - 783 - 381 - + Max + + + +? + + 15/2/2005 - 10:2:34 + 15/2/2005 - 10:2:34 + 1.05 + ? + ? + Compute Node + 800 + 427 + ? - ? - Switch_1 - 6 - EndSwitch - + ? + Switch_1 + 6 + EndSwitch + Switch_1 - + long - a - + a + long - Odd - + Odd + int - Even - + Even + int - a - - + a + + Switch - - - - - - 16/10/2003 - 10:57:24 - 16/10/2003 - 10:57:24 - 1.05 - ? - ? - ? - 193 - 388 - + + + + + + 15/2/2005 - 10:2:34 + 15/2/2005 - 10:2:34 + 1.05 + ? + ? + Compute Node + 193 + 388 + ? - ? - EndSwitch - 7 - Switch_1 - + ? + EndSwitch + 7 + Switch_1 + EndSwitch - + long - a - + a + long - a - - - - 16/10/2003 - 10:57:24 - 16/10/2003 - 10:57:24 - 1.05 - ? - ? - ? - 605 - 382 - + a + + + +? + + 15/2/2005 - 10:2:34 + 15/2/2005 - 10:2:34 + 1.05 + ? + ? + Compute Node + 605 + 428 + IsOdd - a - EndOfSwitch - a - + a + EndOfSwitch + a + -573 - 160 - -572 - 130 - +569 + 199 + +569 + 137 + 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 - + 137 + 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 - 389 - +592 + 459 + +592 + 395 + 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 - - + DoLoop + InitLoop + DoLoop + + Switch_1 - Odd - IsOdd_1 - InGate - - + Odd + IsOdd_1 + Gate + + Switch_1 - Even - EndSwitch - Default - - -Switch_1 - a - IsOdd_1 - a - + a + IsOdd_1 + a + -379 - 387 - -378 - 481 - +381 + 394 + +381 + 458 + +Switch_1 + Default + EndSwitch + Default + + EndSwitch - a - EndOfInitLoop - Index - - + a + EndOfInitLoop + Index + + GraphSwitchs - InitLoopSwitch\Index - InitLoopSwitch - Index - + InitLoopSwitch__Index + InitLoopSwitch + Index + 3 - 0 - - + 0 + + GraphSwitchs - InitLoopSwitch\Min - InitLoopSwitch - Min - + InitLoopSwitch__Min + InitLoopSwitch + Min + 3 - 0 - - + 0 + + GraphSwitchs - InitLoopSwitch\Max - InitLoopSwitch - Max - + InitLoopSwitch__Max + InitLoopSwitch + Max + 3 - 100 - - + 20 + + GraphSwitchs - InitLoop\Index - InitLoop - Index - + InitLoop__Index + InitLoop + Index + 3 - 0 - - + 0 + + GraphSwitchs - InitLoop\Min - InitLoop - Min - + InitLoop__Min + InitLoop + Min + 3 - 0 - - + 0 + + GraphSwitchs - InitLoop\Max - InitLoop - Max - + InitLoop__Max + InitLoop + Max + 3 - 100 - + 20 + diff --git a/examples/GraphSyrControl.py b/examples/GraphSyrControl.py index c1ea545..61d71dc 100644 --- a/examples/GraphSyrControl.py +++ b/examples/GraphSyrControl.py @@ -2,274 +2,279 @@ # Generated python file of Graph GraphSyrControl from SuperV import * -# Graph creation -GraphSyrControl = Graph( 'GraphSyrControl' ) -GraphSyrControl.SetName( 'GraphSyrControl' ) -GraphSyrControl.SetAuthor( 'JR' ) -GraphSyrControl.SetComment( 'Syracuse algorithm' ) -GraphSyrControl.Coords( 0 , 0 ) - -# Creation of Factory Nodes - -test_ISEVEN = GraphSyrControl.FNode( 'SyrComponent' , 'SyrComponent' , 'C_ISEVEN' ) -test_ISEVEN.SetName( 'test_ISEVEN' ) -test_ISEVEN.SetAuthor( '' ) -test_ISEVEN.SetContainer( 'localhost/FactoryServer' ) -test_ISEVEN.SetComment( 'C_ISEVEN from SyrComponent' ) -test_ISEVEN.Coords( 190 , 338 ) - -test_ISONE = GraphSyrControl.FNode( 'SyrComponent' , 'SyrComponent' , 'C_ISONE' ) -test_ISONE.SetName( 'test_ISONE' ) -test_ISONE.SetAuthor( '' ) -test_ISONE.SetContainer( 'localhost/FactoryServer' ) -test_ISONE.SetComment( 'C_ISONE from SyrComponent' ) -test_ISONE.Coords( 196 , 131 ) - -m3p1 = GraphSyrControl.FNode( 'SyrComponent' , 'SyrComponent' , 'C_M3P1' ) -m3p1.SetName( 'm3p1' ) -m3p1.SetAuthor( '' ) -m3p1.SetContainer( 'localhost/FactoryServer' ) -m3p1.SetComment( 'C_M3P1 from SyrComponent' ) -m3p1.Coords( 788 , 22 ) - -div2 = GraphSyrControl.FNode( 'SyrComponent' , 'SyrComponent' , 'C_DIV2' ) -div2.SetName( 'div2' ) -div2.SetAuthor( '' ) -div2.SetContainer( 'localhost/FactoryServer' ) -div2.SetComment( 'C_DIV2 from SyrComponent' ) -div2.Coords( 794 , 427 ) - -incr = GraphSyrControl.FNode( 'SyrComponent' , 'SyrComponent' , 'C_INCR' ) -incr.SetName( 'incr' ) -incr.SetAuthor( '' ) -incr.SetContainer( 'localhost/FactoryServer' ) -incr.SetComment( 'C_INCR from SyrComponent' ) -incr.Coords( 790 , 158 ) - -# Creation of InLine Nodes -Pylabel_begin = [] -Pylabel_begin.append( 'def label_begin( NB , KB ):' ) -Pylabel_begin.append( ' print "label_begin",NB,KB' ) -Pylabel_begin.append( ' return NB,KB' ) -label_begin = GraphSyrControl.INode( 'label_begin' , Pylabel_begin ) -label_begin.InPort( 'NB' , 'long' ) -label_begin.InPort( 'KB' , 'long' ) -label_begin.OutPort( 'NT' , 'long' ) -label_begin.OutPort( 'KT' , 'long' ) -label_begin.SetName( 'label_begin' ) -label_begin.SetAuthor( '' ) -label_begin.SetComment( 'Python function' ) -label_begin.Coords( 7 , 216 ) - -Pylabel_test = [] -Pylabel_test.append( 'def label_test( ValEven , ValOne , NB , KB ):' ) -Pylabel_test.append( ' print "label_begin",ValEven,ValOne,NB,KB' ) -Pylabel_test.append( ' return ValEven,ValOne,NB,KB' ) -label_test = GraphSyrControl.INode( 'label_test' , Pylabel_test ) -label_test.InPort( 'ValEven' , 'long' ) -label_test.InPort( 'ValOne' , 'long' ) -label_test.InPort( 'NT' , 'long' ) -label_test.InPort( 'KT' , 'long' ) -label_test.OutPort( 'ValEven' , 'long' ) -label_test.OutPort( 'ValOne' , 'long' ) -label_test.OutPort( 'NT' , 'long' ) -label_test.OutPort( 'KT' , 'long' ) -label_test.SetName( 'label_test' ) -label_test.SetAuthor( '' ) -label_test.SetComment( 'Python function' ) -label_test.Coords( 385 , 159 ) - -# Creation of Switch Nodes -Pytest = [] -Pytest.append( 'def Switch_OneEven( ValOne , ValEven , NT , KT ) :' ) -Pytest.append( ' Finished = ValOne' ) -Pytest.append( ' if Finished == 0 :' ) -Pytest.append( ' Incr = 1' ) -Pytest.append( ' Even = ValEven' ) -Pytest.append( ' if Even == 0 :' ) -Pytest.append( ' Odd = 1' ) -Pytest.append( ' else :' ) -Pytest.append( ' Odd = 0' ) -Pytest.append( ' else :' ) -Pytest.append( ' Incr = 0' ) -Pytest.append( ' Even = 0' ) -Pytest.append( ' Odd = 0' ) -Pytest.append( ' Even = ValEven' ) -Pytest.append( ' return Finished,Incr,Even,Odd,NT,KT' ) -test,EndSwitch_OneEven = GraphSyrControl.SNode( 'Switch_OneEven' , Pytest ) -EndSwitch_OneEven.SetName( 'EndSwitch_OneEven' ) -EndSwitch_OneEven.SetAuthor( '' ) -EndSwitch_OneEven.SetComment( '' ) -EndSwitch_OneEven.Coords( 1065 , 321 ) -PyEndSwitch_OneEven = [] -PyEndSwitch_OneEven.append( 'def EndSwitch_OneEven( Finished , K ):' ) -PyEndSwitch_OneEven.append( ' print "label_begin",Finished,K' ) -PyEndSwitch_OneEven.append( ' return Finished,K' ) -EndSwitch_OneEven.SetPyFunction( 'EndSwitch_OneEven' , PyEndSwitch_OneEven ) -EndSwitch_OneEven.InPort( 'Finished' , 'long' ) -EndSwitch_OneEven.InPort( 'K' , 'long' ) -EndSwitch_OneEven.OutPort( 'Finished' , 'long' ) -EndSwitch_OneEven.OutPort( 'K' , 'long' ) -test.InPort( 'ValOne' , 'long' ) -test.InPort( 'ValEven' , 'long' ) -test.InPort( 'NT' , 'long' ) -test.InPort( 'KT' , 'long' ) -test.OutPort( 'Finished' , 'long' ) -test.OutPort( 'Incr' , 'long' ) -test.OutPort( 'Even' , 'long' ) -test.OutPort( 'Odd' , 'long' ) -test.OutPort( 'N' , 'long' ) -test.OutPort( 'K' , 'long' ) -test.SetName( 'test' ) -test.SetAuthor( '' ) -test.SetComment( '' ) -test.Coords( 592 , 205 ) - -# Creation of GOTO Nodes -Pycontrol_m3p1 = [] -Pycontrol_m3p1.append( 'def control_m3p1( N , K ):' ) -Pycontrol_m3p1.append( ' return 0,1,N,K' ) -control_m3p1 = GraphSyrControl.GNode( 'control_m3p1' , Pycontrol_m3p1 , 'label_test' ) -control_m3p1.InPort( 'N' , 'long' ) -control_m3p1.InPort( 'K' , 'long' ) -control_m3p1.OutPort( 'ValOne' , 'long' ) -control_m3p1.OutPort( 'ValEven' , 'long' ) -control_m3p1.OutPort( 'NT' , 'long' ) -control_m3p1.OutPort( 'KT' , 'long' ) -control_m3p1.SetName( 'control_m3p1' ) -control_m3p1.SetAuthor( '' ) -control_m3p1.SetComment( '' ) -control_m3p1.Coords( 1012 , 68 ) - -Pycontrol_div2 = [] -Pycontrol_div2.append( 'def control_div2( N , NB ) :' ) -Pycontrol_div2.append( ' return N,NB' ) -control_div2 = GraphSyrControl.GNode( 'control_div2' , Pycontrol_div2 , 'label_begin' ) -control_div2.InPort( 'N' , 'long' ) -control_div2.InPort( 'K' , 'long' ) -control_div2.OutPort( 'NB' , 'long' ) -control_div2.OutPort( 'KB' , 'long' ) -control_div2.SetName( 'control_div2' ) -control_div2.SetAuthor( '' ) -control_div2.SetComment( '' ) -control_div2.Coords( 1010 , 473 ) - -# Creation of Links -test_ISEVENBoolEven = test_ISEVEN.Port( 'BoolEven' ) -label_testValEven = GraphSyrControl.Link( test_ISEVENBoolEven , label_test.Port( 'ValEven' ) ) -label_testValEven.AddCoord( 1 , 380 , 236 ) -label_testValEven.AddCoord( 2 , 379 , 419 ) - -test_ISONEBoolOne = test_ISONE.Port( 'BoolOne' ) -label_testValOne = GraphSyrControl.Link( test_ISONEBoolOne , label_test.Port( 'ValOne' ) ) -label_testValOne.AddCoord( 1 , 367 , 269 ) -label_testValOne.AddCoord( 2 , 367 , 213 ) - -m3p1anEvenInteger = m3p1.Port( 'anEvenInteger' ) -control_m3p1N = GraphSyrControl.Link( m3p1anEvenInteger , control_m3p1.Port( 'N' ) ) - -div2anInteger = div2.Port( 'anInteger' ) -control_div2N = GraphSyrControl.Link( div2anInteger , control_div2.Port( 'N' ) ) - -incraNewCount = incr.Port( 'aNewCount' ) -control_m3p1K = GraphSyrControl.Link( incraNewCount , control_m3p1.Port( 'K' ) ) -control_m3p1K.AddCoord( 1 , 978 , 132 ) -control_m3p1K.AddCoord( 2 , 978 , 239 ) - -control_div2K = GraphSyrControl.Link( incraNewCount , control_div2.Port( 'K' ) ) -control_div2K.AddCoord( 1 , 979 , 536 ) -control_div2K.AddCoord( 2 , 978 , 240 ) - -label_beginNT = label_begin.Port( 'NT' ) -label_testNT = GraphSyrControl.Link( label_beginNT , label_test.Port( 'NT' ) ) - -test_ISEVENanInteger = GraphSyrControl.Link( label_beginNT , test_ISEVEN.Port( 'anInteger' ) ) -test_ISEVENanInteger.AddCoord( 1 , 184 , 416 ) -test_ISEVENanInteger.AddCoord( 2 , 185 , 298 ) - -test_ISONEanInteger = GraphSyrControl.Link( label_beginNT , test_ISONE.Port( 'anInteger' ) ) -test_ISONEanInteger.AddCoord( 1 , 186 , 211 ) -test_ISONEanInteger.AddCoord( 2 , 185 , 297 ) - -label_beginKT = label_begin.Port( 'KT' ) -label_testKT = GraphSyrControl.Link( label_beginKT , label_test.Port( 'KT' ) ) - -label_testValEven = label_test.Port( 'ValEven' ) -testValEven = GraphSyrControl.Link( label_testValEven , test.Port( 'ValEven' ) ) - -label_testValOne = label_test.Port( 'ValOne' ) -testValOne = GraphSyrControl.Link( label_testValOne , test.Port( 'ValOne' ) ) - -label_testNT = label_test.Port( 'NT' ) -testNT = GraphSyrControl.Link( label_testNT , test.Port( 'NT' ) ) - -label_testKT = label_test.Port( 'KT' ) -testKT = GraphSyrControl.Link( label_testKT , test.Port( 'KT' ) ) - -testFinished = test.Port( 'Finished' ) -EndSwitch_OneEvenFinished = GraphSyrControl.Link( testFinished , EndSwitch_OneEven.Port( 'Finished' ) ) - -testIncr = test.Port( 'Incr' ) -incrInGate = GraphSyrControl.Link( testIncr , incr.Port( 'InGate' ) ) - -testEven = test.Port( 'Even' ) -div2InGate = GraphSyrControl.Link( testEven , div2.Port( 'InGate' ) ) -div2InGate.AddCoord( 1 , 764 , 536 ) -div2InGate.AddCoord( 2 , 763 , 297 ) - -testOdd = test.Port( 'Odd' ) -m3p1InGate = GraphSyrControl.Link( testOdd , m3p1.Port( 'InGate' ) ) -m3p1InGate.AddCoord( 1 , 773 , 133 ) -m3p1InGate.AddCoord( 2 , 773 , 326 ) - -testN = test.Port( 'N' ) -m3p1anOddInteger = GraphSyrControl.Link( testN , m3p1.Port( 'anOddInteger' ) ) -m3p1anOddInteger.AddCoord( 1 , 753 , 102 ) -m3p1anOddInteger.AddCoord( 2 , 752 , 355 ) - -div2anEvenInteger = GraphSyrControl.Link( testN , div2.Port( 'anEvenInteger' ) ) -div2anEvenInteger.AddCoord( 1 , 753 , 508 ) -div2anEvenInteger.AddCoord( 2 , 752 , 356 ) - -testK = test.Port( 'K' ) -EndSwitch_OneEvenK = GraphSyrControl.Link( testK , EndSwitch_OneEven.Port( 'K' ) ) - -incraCount = GraphSyrControl.Link( testK , incr.Port( 'aCount' ) ) -incraCount.AddCoord( 1 , 779 , 239 ) -incraCount.AddCoord( 2 , 780 , 385 ) - -testDefault = test.Port( 'Default' ) -EndSwitch_OneEvenDefault = GraphSyrControl.Link( testDefault , EndSwitch_OneEven.Port( 'Default' ) ) - -control_m3p1OutGate = control_m3p1.Port( 'OutGate' ) -label_testInGate = GraphSyrControl.Link( control_m3p1OutGate , label_test.Port( 'InGate' ) ) -label_testInGate.AddCoord( 1 , 373 , 354 ) -label_testInGate.AddCoord( 2 , 372 , 10 ) -label_testInGate.AddCoord( 3 , 1180 , 9 ) -label_testInGate.AddCoord( 4 , 1181 , 217 ) - -control_div2OutGate = control_div2.Port( 'OutGate' ) -label_beginInGate = GraphSyrControl.Link( control_div2OutGate , label_begin.Port( 'InGate' ) ) -label_beginInGate.AddCoord( 1 , 5 , 355 ) -label_beginInGate.AddCoord( 2 , 4 , 608 ) -label_beginInGate.AddCoord( 3 , 1177 , 608 ) -label_beginInGate.AddCoord( 4 , 1177 , 563 ) - -# Creation of Input datas -label_beginNB = label_begin.Input( 'NB' , 7) -label_beginKB = label_begin.Input( 'KB' , 0) - -# Creation of Output variables -EndSwitch_OneEvenFinished = EndSwitch_OneEven.Port( 'Finished' ) -EndSwitch_OneEvenK = EndSwitch_OneEven.Port( 'K' ) - -GraphSyrControl.Run( 7 ) - -GraphSyrControl.DoneW() - -print GraphSyrControl.State() - -GraphSyrControl.PrintPorts() - -label_begin.EPyFunc() +# Graph creation of GraphSyrControl +def DefGraphSyrControl() : + GraphSyrControl = Graph( 'GraphSyrControl' ) + GraphSyrControl.SetName( 'GraphSyrControl' ) + GraphSyrControl.SetAuthor( 'JR' ) + GraphSyrControl.SetComment( 'Syracuse algorithm' ) + GraphSyrControl.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + test_ISEVEN = GraphSyrControl.FNode( 'SyrComponent' , 'SyrComponent' , 'C_ISEVEN' ) + test_ISEVEN.SetName( 'test_ISEVEN' ) + test_ISEVEN.SetAuthor( '' ) + test_ISEVEN.SetContainer( 'localhost/FactoryServer' ) + test_ISEVEN.SetComment( 'C_ISEVEN from SyrComponent' ) + test_ISEVEN.Coords( 190 , 338 ) + 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 = GraphSyrControl.FNode( 'SyrComponent' , 'SyrComponent' , 'C_ISONE' ) + test_ISONE.SetName( 'test_ISONE' ) + test_ISONE.SetAuthor( '' ) + test_ISONE.SetContainer( 'localhost/FactoryServer' ) + test_ISONE.SetComment( 'C_ISONE from SyrComponent' ) + test_ISONE.Coords( 196 , 131 ) + 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 = GraphSyrControl.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 = GraphSyrControl.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 = GraphSyrControl.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 = GraphSyrControl.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 = GraphSyrControl.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 = GraphSyrControl.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 = GraphSyrControl.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 = GraphSyrControl.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 = GraphSyrControl.Link( Otest_ISEVENBoolEven , Ilabel_testValEven ) + Ltest_ISEVENBoolEvenlabel_testValEven.AddCoord( 1 , 381 , 234 ) + Ltest_ISEVENBoolEvenlabel_testValEven.AddCoord( 2 , 381 , 410 ) + + Ltest_ISONEBoolOnelabel_testValOne = GraphSyrControl.Link( Otest_ISONEBoolOne , Ilabel_testValOne ) + Ltest_ISONEBoolOnelabel_testValOne.AddCoord( 1 , 367 , 256 ) + Ltest_ISONEBoolOnelabel_testValOne.AddCoord( 2 , 367 , 201 ) + + Lm3p1anEvenIntegercontrol_m3p1N = GraphSyrControl.Link( Om3p1anEvenInteger , Icontrol_m3p1N ) + + Ldiv2anIntegercontrol_div2N = GraphSyrControl.Link( Odiv2anInteger , Icontrol_div2N ) + + LincraNewCountcontrol_m3p1K = GraphSyrControl.Link( OincraNewCount , Icontrol_m3p1K ) + LincraNewCountcontrol_m3p1K.AddCoord( 1 , 978 , 114 ) + LincraNewCountcontrol_m3p1K.AddCoord( 2 , 978 , 230 ) + + LincraNewCountcontrol_div2K = GraphSyrControl.Link( OincraNewCount , Icontrol_div2K ) + LincraNewCountcontrol_div2K.AddCoord( 1 , 981 , 524 ) + LincraNewCountcontrol_div2K.AddCoord( 2 , 978 , 229 ) + + Llabel_beginNTlabel_testNT = GraphSyrControl.Link( Olabel_beginNT , Ilabel_testNT ) + + Llabel_beginNTtest_ISEVENanInteger = GraphSyrControl.Link( Olabel_beginNT , Itest_ISEVENanInteger ) + Llabel_beginNTtest_ISEVENanInteger.AddCoord( 1 , 179 , 408 ) + Llabel_beginNTtest_ISEVENanInteger.AddCoord( 2 , 179 , 276 ) + + Llabel_beginNTtest_ISONEanInteger = GraphSyrControl.Link( Olabel_beginNT , Itest_ISONEanInteger ) + Llabel_beginNTtest_ISONEanInteger.AddCoord( 1 , 179 , 203 ) + Llabel_beginNTtest_ISONEanInteger.AddCoord( 2 , 180 , 275 ) + + Llabel_beginKTlabel_testKT = GraphSyrControl.Link( Olabel_beginKT , Ilabel_testKT ) + + Llabel_testValEventestValEven = GraphSyrControl.Link( Olabel_testValEven , ItestValEven ) + + Llabel_testValOnetestValOne = GraphSyrControl.Link( Olabel_testValOne , ItestValOne ) + + Llabel_testNTtestNT = GraphSyrControl.Link( Olabel_testNT , ItestNT ) + + Llabel_testKTtestKT = GraphSyrControl.Link( Olabel_testKT , ItestKT ) + + LtestFinishedEndSwitch_OneEvenFinished = GraphSyrControl.Link( OtestFinished , IEndSwitch_OneEvenFinished ) + + LtestEvendiv2Gate = GraphSyrControl.Link( OtestEven , Idiv2Gate ) + LtestEvendiv2Gate.AddCoord( 1 , 763 , 522 ) + LtestEvendiv2Gate.AddCoord( 2 , 763 , 278 ) + + LtestOddm3p1Gate = GraphSyrControl.Link( OtestOdd , Im3p1Gate ) + LtestOddm3p1Gate.AddCoord( 1 , 772 , 117 ) + LtestOddm3p1Gate.AddCoord( 2 , 772 , 297 ) + + LtestNm3p1anOddInteger = GraphSyrControl.Link( OtestN , Im3p1anOddInteger ) + LtestNm3p1anOddInteger.AddCoord( 1 , 751 , 93 ) + LtestNm3p1anOddInteger.AddCoord( 2 , 752 , 317 ) + + LtestNdiv2anEvenInteger = GraphSyrControl.Link( OtestN , Idiv2anEvenInteger ) + LtestNdiv2anEvenInteger.AddCoord( 1 , 751 , 498 ) + LtestNdiv2anEvenInteger.AddCoord( 2 , 752 , 318 ) + + LtestKEndSwitch_OneEvenK = GraphSyrControl.Link( OtestK , IEndSwitch_OneEvenK ) + + LtestKincraCount = GraphSyrControl.Link( OtestK , IincraCount ) + LtestKincraCount.AddCoord( 1 , 779 , 229 ) + LtestKincraCount.AddCoord( 2 , 779 , 336 ) + + LtestDefaultEndSwitch_OneEvenDefault = GraphSyrControl.Link( OtestDefault , IEndSwitch_OneEvenDefault ) + + Lcontrol_m3p1Gatelabel_testGate = GraphSyrControl.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 = GraphSyrControl.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 GraphSyrControl + + +GraphSyrControl = DefGraphSyrControl() diff --git a/examples/GraphSyrControl.xml b/examples/GraphSyrControl.xml index 1d1c489..92fca16 100644 --- a/examples/GraphSyrControl.xml +++ b/examples/GraphSyrControl.xml @@ -1,694 +1,689 @@ - + + ? - ? - GraphSyrControl - 1 - ? - + ? + GraphSyrControl + 1 + ? + GraphSyrControl - + long - label_begin\NB - + label_begin__NB + long - label_begin\KB - + label_begin__KB + long - EndSwitch_OneEven\Finished - + test__Incr + long - EndSwitch_OneEven\K - - - 11/3/2003 - 18:34:21 - 19/9/2003 - 15:2:2 - 1.04 - JR - ? - Syracuse algorithm - 0 - 0 - + EndSwitch_OneEven__Finished + +long + EndSwitch_OneEven__K + + + 11/3/2003 - 18:34:21 + 15/2/2005 - 10:5:34 + 1.04 + JR + ? + Syracuse algorithm + 0 + 0 + SyrComponent - SyrComponent - test_ISEVEN - 0 - ? - + SyrComponent + test_ISEVEN + 0 + ? + C_ISEVEN - + long - anInteger - + anInteger + long - BoolEven - - - 19/9/2003 - 15:2:2 - 19/9/2003 - 15:2:2 - 1.04 - ? - localhost/FactoryServer - C_ISEVEN from SyrComponent - 190 - 338 - + BoolEven + + + 15/2/2005 - 10:5:34 + 15/2/2005 - 10:5:34 + 1.04 + ? + localhost/FactoryServer + C_ISEVEN from SyrComponent + 190 + 338 + SyrComponent - SyrComponent - test_ISONE - 0 - ? - + SyrComponent + test_ISONE + 0 + ? + C_ISONE - + long - anInteger - + anInteger + long - BoolOne - - - 19/9/2003 - 15:2:2 - 19/9/2003 - 15:2:2 - 1.04 - ? - localhost/FactoryServer - C_ISONE from SyrComponent - 196 - 131 - + BoolOne + + + 15/2/2005 - 10:5:34 + 15/2/2005 - 10:5:34 + 1.04 + ? + localhost/FactoryServer + C_ISONE from SyrComponent + 196 + 131 + SyrComponent - SyrComponent - m3p1 - 0 - ? - + SyrComponent + m3p1 + 0 + ? + C_M3P1 - + long - anOddInteger - + anOddInteger + long - anEvenInteger - - - 19/9/2003 - 15:2:2 - 19/9/2003 - 15:2:2 - 1.04 - ? - localhost/FactoryServer - C_M3P1 from SyrComponent - 788 - 22 - + anEvenInteger + + + 15/2/2005 - 10:5:34 + 15/2/2005 - 10:5:34 + 1.04 + ? + localhost/FactoryServer + C_M3P1 from SyrComponent + 788 + 22 + SyrComponent - SyrComponent - div2 - 0 - ? - + SyrComponent + div2 + 0 + ? + C_DIV2 - + long - anEvenInteger - + anEvenInteger + long - anInteger - - - 19/9/2003 - 15:2:2 - 19/9/2003 - 15:2:2 - 1.04 - ? - localhost/FactoryServer - C_DIV2 from SyrComponent - 794 - 427 - + anInteger + + + 15/2/2005 - 10:5:34 + 15/2/2005 - 10:5:34 + 1.04 + ? + localhost/FactoryServer + C_DIV2 from SyrComponent + 794 + 427 + SyrComponent - SyrComponent - incr - 0 - ? - + SyrComponent + incr + 0 + ? + C_INCR - + long - aCount - + aCount + long - aNewCount - - - 19/9/2003 - 15:2:2 - 19/9/2003 - 15:2:2 - 1.04 - ? - localhost/FactoryServer - C_INCR from SyrComponent - 790 - 158 - + aNewCount + + + 15/2/2005 - 10:5:34 + 15/2/2005 - 10:5:34 + 1.04 + ? + localhost/FactoryServer + C_INCR from SyrComponent + 790 + 158 + ? - ? - label_begin - 3 - ? - + ? + label_begin + 3 + ? + label_begin - + long - NB - + NB + long - KB - + KB + long - NT - + NT + long - KT - - + KT + + label_begin - - - - 19/9/2003 - 15:2:2 - 19/9/2003 - 15:2:2 - 1.04 - ? - ? - Python function - 7 - 216 - + + + + 15/2/2005 - 10:5:34 + 15/2/2005 - 10:5:34 + 1.04 + ? + ? + Python function + 8 + 205 + ? - ? - label_test - 3 - ? - + ? + label_test + 3 + ? + label_test - + long - ValEven - + ValEven + long - ValOne - + ValOne + long - NT - + NT + long - KT - + KT + long - ValEven - + ValEven + long - ValOne - + ValOne + long - NT - + NT + long - KT - - + KT + + label_test - - - - 19/9/2003 - 15:2:2 - 19/9/2003 - 15:2:2 - 1.04 - ? - ? - Python function - 385 - 159 - + + + + 15/2/2005 - 10:5:34 + 15/2/2005 - 10:5:34 + 1.04 + ? + ? + Python function + 397 + 165 + ? - ? - test - 6 - EndSwitch_OneEven - + ? + test + 6 + EndSwitch_OneEven + test - + long - ValOne - + ValOne + long - ValEven - + ValEven + long - NT - + NT + long - KT - + KT + long - Finished - + Finished + long - Incr - + Incr + long - Even - + Even + long - Odd - + Odd + long - N - + N + long - K - - + K + + Switch_OneEven - - - - - - - - - - - - - - - - 19/9/2003 - 15:2:2 - 19/9/2003 - 15:2:2 - 1.04 - ? - ? - ? - 592 - 205 - + + + + + + + + + + + + + + + + 15/2/2005 - 10:5:34 + 15/2/2005 - 10:5:34 + 1.04 + ? + ? + Compute Node + 575 + 205 + ? - ? - EndSwitch_OneEven - 7 - test - + ? + EndSwitch_OneEven + 7 + test + EndSwitch_OneEven - + long - Finished - + Finished + long - K - + K + long - Finished - + Finished + long - K - - + K + + EndSwitch_OneEven - - - - 19/9/2003 - 15:2:2 - 19/9/2003 - 15:2:2 - 1.04 - ? - ? - ? - 1065 - 321 - + + + + 15/2/2005 - 10:5:34 + 15/2/2005 - 10:5:34 + 1.04 + ? + ? + Compute Node + 1065 + 356 + ? - ? - control_m3p1 - 8 - label_test - + ? + control_m3p1 + 8 + label_test + control_m3p1 - + long - N - + N + long - K - + K + long - ValOne - + ValOne + long - ValEven - + ValEven + long - NT - + NT + long - KT - - + KT + + control_m3p1 - - - 19/9/2003 - 15:2:2 - 19/9/2003 - 15:2:2 - 1.04 - ? - ? - ? - 1012 - 68 - + + + 15/2/2005 - 10:5:34 + 15/2/2005 - 10:5:34 + 1.04 + ? + ? + Compute Node + 1013 + 63 + ? - ? - control_div2 - 8 - label_begin - + ? + control_div2 + 8 + label_begin + control_div2 - + long - N - + N + long - K - + K + long - NB - + NB + long - KB - - + KB + + control_div2 - - - 19/9/2003 - 15:2:2 - 19/9/2003 - 15:2:2 - 1.04 - ? - ? - ? - 1010 - 473 - + + + 15/2/2005 - 10:5:34 + 15/2/2005 - 10:5:34 + 1.04 + ? + ? + Compute Node + 1010 + 473 + test_ISEVEN - BoolEven - label_test - ValEven - + BoolEven + label_test + ValEven + -380 - 236 - -379 - 419 - +381 + 234 + +381 + 410 + test_ISONE - BoolOne - label_test - ValOne - + BoolOne + label_test + ValOne + 367 - 269 - + 256 + 367 - 213 - + 201 + m3p1 - anEvenInteger - control_m3p1 - N - - + anEvenInteger + control_m3p1 + N + + div2 - anInteger - control_div2 - N - - + anInteger + control_div2 + N + + incr - aNewCount - control_m3p1 - K - + aNewCount + control_m3p1 + K + 978 - 132 - + 114 + 978 - 239 - + 230 + incr - aNewCount - control_div2 - K - + aNewCount + control_div2 + K + -979 - 536 - +981 + 524 + 978 - 240 - + 229 + label_begin - NT - label_test - NT - - + NT + label_test + NT + + label_begin - NT - test_ISEVEN - anInteger - + NT + test_ISEVEN + anInteger + -184 - 416 - -185 - 298 - +179 + 408 + +179 + 276 + label_begin - NT - test_ISONE - anInteger - + NT + test_ISONE + anInteger + -186 - 211 - -185 - 297 - +179 + 203 + +180 + 275 + label_begin - KT - label_test - KT - - + KT + label_test + KT + + label_test - ValEven - test - ValEven - - + ValEven + test + ValEven + + label_test - ValOne - test - ValOne - - + ValOne + test + ValOne + + label_test - NT - test - NT - - + NT + test + NT + + label_test - KT - test - KT - - -test - Finished - EndSwitch_OneEven - Finished - - + KT + test + KT + + test - Incr - incr - InGate - - + Finished + EndSwitch_OneEven + Finished + + test - Even - div2 - InGate - + Even + div2 + Gate + -764 - 536 - 763 - 297 - + 522 + +763 + 278 + test - Odd - m3p1 - InGate - + Odd + m3p1 + Gate + -773 - 133 - -773 - 326 - +772 + 117 + +772 + 297 + test - N - m3p1 - anOddInteger - + N + m3p1 + anOddInteger + -753 - 102 - +751 + 93 + 752 - 355 - + 317 + test - N - div2 - anEvenInteger - + N + div2 + anEvenInteger + -753 - 508 - +751 + 498 + 752 - 356 - + 318 + test - K - EndSwitch_OneEven - K - - + K + EndSwitch_OneEven + K + + test - K - incr - aCount - + K + incr + aCount + 779 - 239 - -780 - 385 - + 229 + +779 + 336 + test - Default - EndSwitch_OneEven - Default - - + Default + EndSwitch_OneEven + Default + + control_m3p1 - OutGate - label_test - InGate - + Gate + label_test + Gate + -373 - 354 - -372 - 10 - +374 + 321 + +374 + 15 + 1180 - 9 - + 9 + 1181 - 217 - + 217 + control_div2 - OutGate - label_begin - InGate - + Gate + label_begin + Gate + -5 - 355 - 4 - 608 - -1177 - 608 - -1177 - 563 - + 608 + +1184 + 604 + +1184 + 548 + GraphSyrControl - label_begin\NB - label_begin - NB - + label_begin__NB + label_begin + NB + 3 - 7 - - + 7 + + GraphSyrControl - label_begin\KB - label_begin - KB - + label_begin__KB + label_begin + KB + 3 - 0 - + 0 + diff --git a/examples/GraphSyrControl1.py b/examples/GraphSyrControl1.py index 254113c..4788256 100755 --- a/examples/GraphSyrControl1.py +++ b/examples/GraphSyrControl1.py @@ -2,236 +2,236 @@ # Generated python file of Graph GraphSyrControlGUI from SuperV import * -# Graph creation -GraphSyrControl1 = Graph( 'GraphSyrControl1' ) -GraphSyrControl1.SetName( 'GraphSyrControl1' ) -GraphSyrControl1.SetAuthor( 'JR' ) -GraphSyrControl1.SetComment( 'Syracuse algorithm' ) -GraphSyrControl1.Coords( 0 , 0 ) - -# Creation of Factory Nodes - -test_ISEVEN = GraphSyrControl1.FNode( 'SyrComponent' , 'SyrComponent' , 'C_ISEVEN' ) -test_ISEVEN.SetName( 'test_ISEVEN' ) -test_ISEVEN.SetAuthor( '' ) -test_ISEVEN.SetContainer( 'localhost/FactoryServer' ) -test_ISEVEN.SetComment( 'C_ISEVEN from SyrComponent' ) -test_ISEVEN.Coords( 190 , 338 ) - -test_ISONE = GraphSyrControl1.FNode( 'SyrComponent' , 'SyrComponent' , 'C_ISONE' ) -test_ISONE.SetName( 'test_ISONE' ) -test_ISONE.SetAuthor( '' ) -test_ISONE.SetContainer( 'localhost/FactoryServer' ) -test_ISONE.SetComment( 'C_ISONE from SyrComponent' ) -test_ISONE.Coords( 196 , 131 ) - -m3p1 = GraphSyrControl1.FNode( 'SyrComponent' , 'SyrComponent' , 'C_M3P1' ) -m3p1.SetName( 'm3p1' ) -m3p1.SetAuthor( '' ) -m3p1.SetContainer( 'localhost/FactoryServer' ) -m3p1.SetComment( 'C_M3P1 from SyrComponent' ) -m3p1.Coords( 615 , 30 ) - -div2 = GraphSyrControl1.FNode( 'SyrComponent' , 'SyrComponent' , 'C_DIV2' ) -div2.SetName( 'div2' ) -div2.SetAuthor( '' ) -div2.SetContainer( 'localhost/FactoryServer' ) -div2.SetComment( 'C_DIV2 from SyrComponent' ) -div2.Coords( 624 , 391 ) - -incr = GraphSyrControl1.FNode( 'SyrComponent' , 'SyrComponent' , 'C_INCR' ) -incr.SetName( 'incr' ) -incr.SetAuthor( '' ) -incr.SetContainer( 'localhost/FactoryServer' ) -incr.SetComment( 'C_INCR from SyrComponent' ) -incr.Coords( 623 , 206 ) - -# Creation of InLine Nodes -Pylabel_begin = [] -Pylabel_begin.append( 'def label_begin( NB , KB ) :' ) -Pylabel_begin.append( ' return NB,KB' ) -label_begin = GraphSyrControl1.INode( 'label_begin' , Pylabel_begin ) -label_begin.InPort( 'NB' , 'long' ) -label_begin.InPort( 'KB' , 'long' ) -label_begin.OutPort( 'NT' , 'long' ) -label_begin.OutPort( 'KT' , 'long' ) -label_begin.SetName( 'label_begin' ) -label_begin.SetAuthor( '' ) -label_begin.SetComment( 'Python function' ) -label_begin.Coords( 5 , 190 ) - -# Creation of Switch Nodes -Pylabel_test = [] -Pylabel_test.append( 'def L_OneEven( ValOne , ValEven , NT , KT ):' ) -Pylabel_test.append( ' Finished = ValOne' ) -Pylabel_test.append( ' if Finished == 0 :' ) -Pylabel_test.append( ' Incr = 1' ) -Pylabel_test.append( ' Even = ValEven' ) -Pylabel_test.append( ' if Even == 0 :' ) -Pylabel_test.append( ' Odd = 1' ) -Pylabel_test.append( ' else :' ) -Pylabel_test.append( ' Odd = 0' ) -Pylabel_test.append( ' else :' ) -Pylabel_test.append( ' Incr = 0' ) -Pylabel_test.append( ' Even = 0' ) -Pylabel_test.append( ' Odd = 0' ) -Pylabel_test.append( ' Even = ValEven' ) -Pylabel_test.append( ' return Finished,Incr,Even,Odd,NT,KT' ) -label_test,EndL_OneEven = GraphSyrControl1.SNode( 'L_OneEven' , Pylabel_test ) -EndL_OneEven.SetName( 'EndL_OneEven' ) -EndL_OneEven.SetAuthor( '' ) -EndL_OneEven.SetComment( '' ) -EndL_OneEven.Coords( 1017 , 247 ) -PyEndL_OneEven = [] -EndL_OneEven.SetPyFunction( 'EndL_OneEven' , PyEndL_OneEven ) -label_test.InPort( 'ValOne' , 'long' ) -label_test.InPort( 'ValEven' , 'long' ) -label_test.InPort( 'NT' , 'long' ) -label_test.InPort( 'KT' , 'long' ) -label_test.OutPort( 'Finished' , 'long' ) -label_test.OutPort( 'Incr' , 'long' ) -label_test.OutPort( 'Even' , 'long' ) -label_test.OutPort( 'Odd' , 'long' ) -label_test.OutPort( 'N' , 'long' ) -label_test.OutPort( 'K' , 'long' ) -label_test.SetName( 'label_test' ) -label_test.SetAuthor( '' ) -label_test.SetComment( '' ) -label_test.Coords( 399 , 177 ) - -# Creation of GOTO Nodes -Pycontrol_m3p1 = [] -Pycontrol_m3p1.append( 'def C_NotOneIsEven( N , K ):' ) -Pycontrol_m3p1.append( ' return 0,1,N,K' ) -control_m3p1 = GraphSyrControl1.GNode( 'C_NotOneIsEven' , Pycontrol_m3p1 , 'label_test' ) -control_m3p1.InPort( 'N' , 'long' ) -control_m3p1.InPort( 'K' , 'long' ) -control_m3p1.OutPort( 'ValOne' , 'long' ) -control_m3p1.OutPort( 'ValEven' , 'long' ) -control_m3p1.OutPort( 'NT' , 'long' ) -control_m3p1.OutPort( 'KT' , 'long' ) -control_m3p1.SetName( 'control_m3p1' ) -control_m3p1.SetAuthor( '' ) -control_m3p1.SetComment( '' ) -control_m3p1.Coords( 821 , 28 ) - -Pycontrol_div2 = [] -Pycontrol_div2.append( 'def control_div2( N , K ) :' ) -Pycontrol_div2.append( ' return N,K' ) -control_div2 = GraphSyrControl1.GNode( 'control_div2' , Pycontrol_div2 , 'label_begin' ) -control_div2.InPort( 'N' , 'long' ) -control_div2.InPort( 'K' , 'long' ) -control_div2.OutPort( 'NB' , 'long' ) -control_div2.OutPort( 'KB' , 'long' ) -control_div2.SetName( 'control_div2' ) -control_div2.SetAuthor( '' ) -control_div2.SetComment( '' ) -control_div2.Coords( 818 , 358 ) - -# Creation of Links -test_ISEVENBoolEven = test_ISEVEN.Port( 'BoolEven' ) -label_testValEven = GraphSyrControl1.Link( test_ISEVENBoolEven , label_test.Port( 'ValEven' ) ) -label_testValEven.AddCoord( 1 , 383 , 239 ) -label_testValEven.AddCoord( 2 , 382 , 417 ) - -test_ISONEBoolOne = test_ISONE.Port( 'BoolOne' ) -label_testValOne = GraphSyrControl1.Link( test_ISONEBoolOne , label_test.Port( 'ValOne' ) ) - -m3p1anEvenInteger = m3p1.Port( 'anEvenInteger' ) -control_m3p1N = GraphSyrControl1.Link( m3p1anEvenInteger , control_m3p1.Port( 'N' ) ) -control_m3p1N.AddCoord( 1 , 793 , 62 ) -control_m3p1N.AddCoord( 2 , 792 , 111 ) - -div2anInteger = div2.Port( 'anInteger' ) -control_div2N = GraphSyrControl1.Link( div2anInteger , control_div2.Port( 'N' ) ) -control_div2N.AddCoord( 1 , 797 , 392 ) -control_div2N.AddCoord( 2 , 798 , 471 ) - -incraNewCount = incr.Port( 'aNewCount' ) -control_div2K = GraphSyrControl1.Link( incraNewCount , control_div2.Port( 'K' ) ) -control_div2K.AddCoord( 1 , 809 , 420 ) -control_div2K.AddCoord( 2 , 808 , 288 ) - -control_m3p1K = GraphSyrControl1.Link( incraNewCount , control_m3p1.Port( 'K' ) ) -control_m3p1K.AddCoord( 1 , 807 , 91 ) -control_m3p1K.AddCoord( 2 , 808 , 286 ) - -label_beginNT = label_begin.Port( 'NT' ) -test_ISONEanInteger = GraphSyrControl1.Link( label_beginNT , test_ISONE.Port( 'anInteger' ) ) -test_ISONEanInteger.AddCoord( 1 , 180 , 211 ) -test_ISONEanInteger.AddCoord( 2 , 179 , 269 ) - -label_testNT = GraphSyrControl1.Link( label_beginNT , label_test.Port( 'NT' ) ) - -test_ISEVENanInteger = GraphSyrControl1.Link( label_beginNT , test_ISEVEN.Port( 'anInteger' ) ) -test_ISEVENanInteger.AddCoord( 1 , 179 , 417 ) -test_ISEVENanInteger.AddCoord( 2 , 179 , 271 ) - -label_beginKT = label_begin.Port( 'KT' ) -label_testKT = GraphSyrControl1.Link( label_beginKT , label_test.Port( 'KT' ) ) - -label_testIncr = label_test.Port( 'Incr' ) -incrInGate = GraphSyrControl1.Link( label_testIncr , incr.Port( 'InGate' ) ) -incrInGate.AddCoord( 1 , 565 , 315 ) -incrInGate.AddCoord( 2 , 564 , 240 ) - -label_testEven = label_test.Port( 'Even' ) -div2InGate = GraphSyrControl1.Link( label_testEven , div2.Port( 'InGate' ) ) -div2InGate.AddCoord( 1 , 583 , 500 ) -div2InGate.AddCoord( 2 , 582 , 269 ) - -label_testOdd = label_test.Port( 'Odd' ) -m3p1InGate = GraphSyrControl1.Link( label_testOdd , m3p1.Port( 'InGate' ) ) -m3p1InGate.AddCoord( 1 , 571 , 138 ) -m3p1InGate.AddCoord( 2 , 573 , 298 ) - -label_testN = label_test.Port( 'N' ) -m3p1anOddInteger = GraphSyrControl1.Link( label_testN , m3p1.Port( 'anOddInteger' ) ) -m3p1anOddInteger.AddCoord( 1 , 604 , 110 ) -m3p1anOddInteger.AddCoord( 2 , 605 , 328 ) - -div2anEvenInteger = GraphSyrControl1.Link( label_testN , div2.Port( 'anEvenInteger' ) ) -div2anEvenInteger.AddCoord( 1 , 606 , 471 ) -div2anEvenInteger.AddCoord( 2 , 605 , 328 ) - -label_testK = label_test.Port( 'K' ) -incraCount = GraphSyrControl1.Link( label_testK , incr.Port( 'aCount' ) ) -incraCount.AddCoord( 1 , 594 , 287 ) -incraCount.AddCoord( 2 , 595 , 356 ) - -label_testDefault = label_test.Port( 'Default' ) -EndL_OneEvenDefault = GraphSyrControl1.Link( label_testDefault , EndL_OneEven.Port( 'Default' ) ) -EndL_OneEvenDefault.AddCoord( 1 , 1008 , 281 ) -EndL_OneEvenDefault.AddCoord( 2 , 1008 , 560 ) -EndL_OneEvenDefault.AddCoord( 3 , 565 , 559 ) -EndL_OneEvenDefault.AddCoord( 4 , 564 , 385 ) - -control_m3p1OutGate = control_m3p1.Port( 'OutGate' ) -label_testInGate = GraphSyrControl1.Link( control_m3p1OutGate , label_test.Port( 'InGate' ) ) -label_testInGate.AddCoord( 1 , 368 , 327 ) -label_testInGate.AddCoord( 2 , 369 , 7 ) -label_testInGate.AddCoord( 3 , 1009 , 8 ) -label_testInGate.AddCoord( 4 , 1009 , 179 ) - -control_div2OutGate = control_div2.Port( 'OutGate' ) -label_beginInGate = GraphSyrControl1.Link( control_div2OutGate , label_begin.Port( 'InGate' ) ) -label_beginInGate.AddCoord( 1 , 3 , 327 ) -label_beginInGate.AddCoord( 2 , 2 , 582 ) -label_beginInGate.AddCoord( 3 , 991 , 583 ) -label_beginInGate.AddCoord( 4 , 991 , 451 ) - -# Creation of Input datas -label_beginNB = label_begin.Input( 'NB' , 7) -label_beginKB = label_begin.Input( 'KB' , 0) - -# Creation of Output variables -label_testFinished = label_test.Port( 'Finished' ) - -GraphSyrControl1.Run( 7 ) - -GraphSyrControl1.DoneW() - -print GraphSyrControl1.State() - -GraphSyrControl1.PrintPorts() +# Graph creation of GraphSyrControlGUI +def DefGraphSyrControlGUI() : + GraphSyrControlGUI = Graph( 'GraphSyrControlGUI' ) + GraphSyrControlGUI.SetName( 'GraphSyrControlGUI' ) + GraphSyrControlGUI.SetAuthor( 'JR' ) + GraphSyrControlGUI.SetComment( 'Syracuse algorithm' ) + GraphSyrControlGUI.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + test_ISEVEN = GraphSyrControlGUI.FNode( 'SyrComponent' , 'SyrComponent' , 'C_ISEVEN' ) + test_ISEVEN.SetName( 'test_ISEVEN' ) + test_ISEVEN.SetAuthor( '' ) + test_ISEVEN.SetContainer( 'localhost/FactoryServer' ) + test_ISEVEN.SetComment( 'C_ISEVEN from SyrComponent' ) + test_ISEVEN.Coords( 192 , 345 ) + 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 = GraphSyrControlGUI.FNode( 'SyrComponent' , 'SyrComponent' , 'C_ISONE' ) + test_ISONE.SetName( 'test_ISONE' ) + test_ISONE.SetAuthor( '' ) + test_ISONE.SetContainer( 'localhost/FactoryServer' ) + test_ISONE.SetComment( 'C_ISONE from SyrComponent' ) + test_ISONE.Coords( 197 , 147 ) + 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 = GraphSyrControlGUI.FNode( 'SyrComponent' , 'SyrComponent' , 'C_M3P1' ) + m3p1.SetName( 'm3p1' ) + m3p1.SetAuthor( '' ) + m3p1.SetContainer( 'localhost/FactoryServer' ) + m3p1.SetComment( 'C_M3P1 from SyrComponent' ) + m3p1.Coords( 615 , 30 ) + Im3p1anOddInteger = m3p1.GetInPort( 'anOddInteger' ) + Im3p1Gate = m3p1.GetInPort( 'Gate' ) + Om3p1anEvenInteger = m3p1.GetOutPort( 'anEvenInteger' ) + Om3p1Gate = m3p1.GetOutPort( 'Gate' ) + + div2 = GraphSyrControlGUI.FNode( 'SyrComponent' , 'SyrComponent' , 'C_DIV2' ) + div2.SetName( 'div2' ) + div2.SetAuthor( '' ) + div2.SetContainer( 'localhost/FactoryServer' ) + div2.SetComment( 'C_DIV2 from SyrComponent' ) + div2.Coords( 624 , 391 ) + Idiv2anEvenInteger = div2.GetInPort( 'anEvenInteger' ) + Idiv2Gate = div2.GetInPort( 'Gate' ) + Odiv2anInteger = div2.GetOutPort( 'anInteger' ) + Odiv2Gate = div2.GetOutPort( 'Gate' ) + + incr = GraphSyrControlGUI.FNode( 'SyrComponent' , 'SyrComponent' , 'C_INCR' ) + incr.SetName( 'incr' ) + incr.SetAuthor( '' ) + incr.SetContainer( 'localhost/FactoryServer' ) + incr.SetComment( 'C_INCR from SyrComponent' ) + incr.Coords( 624 , 216 ) + 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( ' return NB,KB' ) + label_begin = GraphSyrControlGUI.INode( 'label_begin' , Pylabel_begin ) + label_begin.SetName( 'label_begin' ) + label_begin.SetAuthor( '' ) + label_begin.SetComment( 'Python function' ) + label_begin.Coords( 5 , 190 ) + 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' ) + + # Creation of Switch Nodes + Pylabel_test = [] + Pylabel_test.append( 'def L_OneEven( ValOne , ValEven , NT , KT ):' ) + Pylabel_test.append( ' Finished = ValOne' ) + Pylabel_test.append( ' if Finished == 0 :' ) + Pylabel_test.append( ' Incr = 1' ) + Pylabel_test.append( ' Even = ValEven' ) + Pylabel_test.append( ' if Even == 0 :' ) + Pylabel_test.append( ' Odd = 1' ) + Pylabel_test.append( ' else :' ) + Pylabel_test.append( ' Odd = 0' ) + Pylabel_test.append( ' else :' ) + Pylabel_test.append( ' Incr = 0' ) + Pylabel_test.append( ' Even = 0' ) + Pylabel_test.append( ' Odd = 0' ) + Pylabel_test.append( ' Even = ValEven' ) + Pylabel_test.append( ' return Finished,Incr,Even,Odd,NT,KT' ) + label_test,EndL_OneEven = GraphSyrControlGUI.SNode( 'L_OneEven' , Pylabel_test ) + EndL_OneEven.SetName( 'EndL_OneEven' ) + EndL_OneEven.SetAuthor( '' ) + EndL_OneEven.SetComment( 'Compute Node' ) + EndL_OneEven.Coords( 1033 , 307 ) + PyEndL_OneEven = [] + EndL_OneEven.SetPyFunction( '' , PyEndL_OneEven ) + IEndL_OneEvenDefault = EndL_OneEven.GetInPort( 'Default' ) + OEndL_OneEvenGate = EndL_OneEven.GetOutPort( 'Gate' ) + label_test.SetName( 'label_test' ) + label_test.SetAuthor( '' ) + label_test.SetComment( 'Compute Node' ) + label_test.Coords( 398 , 188 ) + 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_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_testDefault = label_test.GetOutPort( 'Default' ) + + # Creation of GOTO Nodes + Pycontrol_m3p1 = [] + Pycontrol_m3p1.append( 'def C_NotOneIsEven( N , K ):' ) + Pycontrol_m3p1.append( ' return 0,1,N,K' ) + control_m3p1 = GraphSyrControlGUI.GNode( 'C_NotOneIsEven' , Pycontrol_m3p1 , 'label_test' ) + control_m3p1.SetName( 'control_m3p1' ) + control_m3p1.SetAuthor( '' ) + control_m3p1.SetComment( 'Compute Node' ) + control_m3p1.Coords( 823 , 70 ) + 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 , K ) :' ) + Pycontrol_div2.append( ' return N,K' ) + control_div2 = GraphSyrControlGUI.GNode( 'control_div2' , Pycontrol_div2 , 'label_begin' ) + control_div2.SetName( 'control_div2' ) + control_div2.SetAuthor( '' ) + control_div2.SetComment( 'Compute Node' ) + control_div2.Coords( 829 , 431 ) + 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 = GraphSyrControlGUI.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 ) + + Lm3p1anEvenIntegercontrol_m3p1N = GraphSyrControlGUI.Link( Om3p1anEvenInteger , Icontrol_m3p1N ) + + Ldiv2anIntegercontrol_div2N = GraphSyrControlGUI.Link( Odiv2anInteger , Icontrol_div2N ) + + LincraNewCountcontrol_div2K = GraphSyrControlGUI.Link( OincraNewCount , Icontrol_div2K ) + LincraNewCountcontrol_div2K.AddCoord( 1 , 810 , 482 ) + LincraNewCountcontrol_div2K.AddCoord( 2 , 808 , 288 ) + + LincraNewCountcontrol_m3p1K = GraphSyrControlGUI.Link( OincraNewCount , Icontrol_m3p1K ) + LincraNewCountcontrol_m3p1K.AddCoord( 1 , 803 , 120 ) + LincraNewCountcontrol_m3p1K.AddCoord( 2 , 809 , 288 ) + + Llabel_beginNTtest_ISONEanInteger = GraphSyrControlGUI.Link( Olabel_beginNT , Itest_ISONEanInteger ) + Llabel_beginNTtest_ISONEanInteger.AddCoord( 1 , 180 , 217 ) + Llabel_beginNTtest_ISONEanInteger.AddCoord( 2 , 180 , 258 ) + + Llabel_beginNTlabel_testNT = GraphSyrControlGUI.Link( Olabel_beginNT , Ilabel_testNT ) + + Llabel_beginNTtest_ISEVENanInteger = GraphSyrControlGUI.Link( Olabel_beginNT , Itest_ISEVENanInteger ) + Llabel_beginNTtest_ISEVENanInteger.AddCoord( 1 , 179 , 417 ) + Llabel_beginNTtest_ISEVENanInteger.AddCoord( 2 , 180 , 262 ) + + Llabel_beginKTlabel_testKT = GraphSyrControlGUI.Link( Olabel_beginKT , Ilabel_testKT ) + + Llabel_testEvendiv2Gate = GraphSyrControlGUI.Link( Olabel_testEven , Idiv2Gate ) + Llabel_testEvendiv2Gate.AddCoord( 1 , 584 , 486 ) + Llabel_testEvendiv2Gate.AddCoord( 2 , 583 , 261 ) + + Llabel_testOddm3p1Gate = GraphSyrControlGUI.Link( Olabel_testOdd , Im3p1Gate ) + Llabel_testOddm3p1Gate.AddCoord( 1 , 572 , 123 ) + Llabel_testOddm3p1Gate.AddCoord( 2 , 572 , 279 ) + + Llabel_testNm3p1anOddInteger = GraphSyrControlGUI.Link( Olabel_testN , Im3p1anOddInteger ) + Llabel_testNm3p1anOddInteger.AddCoord( 1 , 602 , 98 ) + Llabel_testNm3p1anOddInteger.AddCoord( 2 , 604 , 301 ) + + Llabel_testNdiv2anEvenInteger = GraphSyrControlGUI.Link( Olabel_testN , Idiv2anEvenInteger ) + Llabel_testNdiv2anEvenInteger.AddCoord( 1 , 605 , 461 ) + Llabel_testNdiv2anEvenInteger.AddCoord( 2 , 604 , 300 ) + + Llabel_testKincraCount = GraphSyrControlGUI.Link( Olabel_testK , IincraCount ) + Llabel_testKincraCount.AddCoord( 1 , 597 , 286 ) + Llabel_testKincraCount.AddCoord( 2 , 596 , 320 ) + + Llabel_testDefaultEndL_OneEvenDefault = GraphSyrControlGUI.Link( Olabel_testDefault , IEndL_OneEvenDefault ) + + Lcontrol_m3p1Gatelabel_testGate = GraphSyrControlGUI.Link( Ocontrol_m3p1Gate , Ilabel_testGate ) + Lcontrol_m3p1Gatelabel_testGate.AddCoord( 1 , 369 , 343 ) + Lcontrol_m3p1Gatelabel_testGate.AddCoord( 2 , 368 , 22 ) + Lcontrol_m3p1Gatelabel_testGate.AddCoord( 3 , 1003 , 24 ) + Lcontrol_m3p1Gatelabel_testGate.AddCoord( 4 , 1005 , 189 ) + + Lcontrol_div2Gatelabel_beginGate = GraphSyrControlGUI.Link( Ocontrol_div2Gate , Ilabel_beginGate ) + Lcontrol_div2Gatelabel_beginGate.AddCoord( 1 , 2 , 582 ) + Lcontrol_div2Gatelabel_beginGate.AddCoord( 2 , 1012 , 583 ) + Lcontrol_div2Gatelabel_beginGate.AddCoord( 3 , 1012 , 507 ) + + # Input datas + Ilabel_beginNB.Input( 7 ) + Ilabel_beginKB.Input( 0 ) + + # Output Ports of the graph + #Olabel_testFinished = label_test.GetOutPort( 'Finished' ) + #Olabel_testIncr = label_test.GetOutPort( 'Incr' ) + return GraphSyrControlGUI + + +GraphSyrControlGUI = DefGraphSyrControlGUI() diff --git a/examples/GraphSyrControl1.xml b/examples/GraphSyrControl1.xml index aa184bf..0eb99d0 100755 --- a/examples/GraphSyrControl1.xml +++ b/examples/GraphSyrControl1.xml @@ -1,613 +1,580 @@ - + + ? - ? - GraphSyrControlGUI - 1 - ? - + ? + GraphSyrControlGUI + 1 + ? + GraphSyrControlGUI - + long - label_begin\NB - + label_begin__NB + long - label_begin\KB - + label_begin__KB + long - label_test\Finished - - - 11/3/2003 - 18:28:48 - 19/9/2003 - 15:3:50 - 1.04 - JR - ? - Syracuse algorithm - 0 - 0 - + label_test__Finished + +long + label_test__Incr + + + 11/3/2003 - 18:28:48 + 14/2/2005 - 14:39:32 + 1.04 + JR + ? + Syracuse algorithm + 0 + 0 + SyrComponent - SyrComponent - test_ISEVEN - 0 - ? - + SyrComponent + test_ISEVEN + 0 + ? + C_ISEVEN - + long - anInteger - + anInteger + long - BoolEven - - - 19/9/2003 - 15:3:49 - 19/9/2003 - 15:3:49 - 1.04 - ? - localhost/FactoryServer - C_ISEVEN from SyrComponent - 190 - 338 - + BoolEven + + + 14/2/2005 - 14:39:32 + 14/2/2005 - 14:39:32 + 1.04 + ? + localhost/FactoryServer + C_ISEVEN from SyrComponent + 192 + 345 + SyrComponent - SyrComponent - test_ISONE - 0 - ? - + SyrComponent + test_ISONE + 0 + ? + C_ISONE - + long - anInteger - + anInteger + long - BoolOne - - - 19/9/2003 - 15:3:49 - 19/9/2003 - 15:3:49 - 1.04 - ? - localhost/FactoryServer - C_ISONE from SyrComponent - 196 - 131 - + BoolOne + + + 14/2/2005 - 14:39:32 + 14/2/2005 - 14:39:32 + 1.04 + ? + localhost/FactoryServer + C_ISONE from SyrComponent + 197 + 147 + SyrComponent - SyrComponent - m3p1 - 0 - ? - + SyrComponent + m3p1 + 0 + ? + C_M3P1 - + long - anOddInteger - + anOddInteger + long - anEvenInteger - - - 19/9/2003 - 15:3:49 - 19/9/2003 - 15:3:49 - 1.04 - ? - localhost/FactoryServer - C_M3P1 from SyrComponent - 615 - 30 - + anEvenInteger + + + 14/2/2005 - 14:39:32 + 14/2/2005 - 14:39:32 + 1.04 + ? + localhost/FactoryServer + C_M3P1 from SyrComponent + 615 + 30 + SyrComponent - SyrComponent - div2 - 0 - ? - + SyrComponent + div2 + 0 + ? + C_DIV2 - + long - anEvenInteger - + anEvenInteger + long - anInteger - - - 19/9/2003 - 15:3:49 - 19/9/2003 - 15:3:49 - 1.04 - ? - localhost/FactoryServer - C_DIV2 from SyrComponent - 624 - 391 - + anInteger + + + 14/2/2005 - 14:39:32 + 14/2/2005 - 14:39:32 + 1.04 + ? + localhost/FactoryServer + C_DIV2 from SyrComponent + 624 + 391 + SyrComponent - SyrComponent - incr - 0 - ? - + SyrComponent + incr + 0 + ? + C_INCR - + long - aCount - + aCount + long - aNewCount - - - 19/9/2003 - 15:3:49 - 19/9/2003 - 15:3:49 - 1.04 - ? - localhost/FactoryServer - C_INCR from SyrComponent - 623 - 206 - + aNewCount + + + 14/2/2005 - 14:39:32 + 14/2/2005 - 14:39:32 + 1.04 + ? + localhost/FactoryServer + C_INCR from SyrComponent + 624 + 216 + ? - ? - label_begin - 3 - ? - + ? + label_begin + 3 + ? + label_begin - + long - NB - + NB + long - KB - + KB + long - NT - + NT + long - KT - - + KT + + label_begin - - - 19/9/2003 - 15:3:49 - 19/9/2003 - 15:3:49 - 1.04 - ? - ? - Python function - 5 - 190 - + + + 14/2/2005 - 14:39:32 + 14/2/2005 - 14:39:32 + 1.04 + ? + ? + Python function + 5 + 190 + ? - ? - label_test - 6 - EndL_OneEven - + ? + label_test + 6 + EndL_OneEven + label_test - + long - ValOne - + ValOne + long - ValEven - + ValEven + long - NT - + NT + long - KT - + KT + long - Finished - + Finished + long - Incr - + Incr + long - Even - + Even + long - Odd - + Odd + long - N - + N + long - K - - + K + + L_OneEven - - - - - - - - - - - - - - - - 19/9/2003 - 15:3:49 - 19/9/2003 - 15:3:49 - 1.04 - ? - ? - ? - 399 - 177 - + + + + + + + + + + + + + + + + 14/2/2005 - 14:39:32 + 14/2/2005 - 14:39:32 + 1.04 + ? + ? + Compute Node + 398 + 188 + ? - ? - EndL_OneEven - 7 - label_test - + ? + EndL_OneEven + 7 + label_test + EndL_OneEven - - - - - - 19/9/2003 - 15:3:49 - 19/9/2003 - 15:3:49 - 1.04 - ? - ? - ? - 1017 - 247 - + + + + + +? + + 14/2/2005 - 14:39:32 + 14/2/2005 - 14:39:32 + 1.04 + ? + ? + Compute Node + 1033 + 307 + ? - ? - control_m3p1 - 8 - label_test - + ? + control_m3p1 + 8 + label_test + control_m3p1 - + long - N - + N + long - K - + K + long - ValOne - + ValOne + long - ValEven - + ValEven + long - NT - + NT + long - KT - - + KT + + C_NotOneIsEven - - - 19/9/2003 - 15:3:49 - 19/9/2003 - 15:3:49 - 1.04 - ? - ? - ? - 821 - 28 - + + + 14/2/2005 - 14:39:32 + 14/2/2005 - 14:39:32 + 1.04 + ? + ? + Compute Node + 823 + 70 + ? - ? - control_div2 - 8 - label_begin - + ? + control_div2 + 8 + label_begin + control_div2 - + long - N - + N + long - K - + K + long - NB - + NB + long - KB - - + KB + + control_div2 - - - 19/9/2003 - 15:3:49 - 19/9/2003 - 15:3:49 - 1.04 - ? - ? - ? - 818 - 358 - + + + 14/2/2005 - 14:39:32 + 14/2/2005 - 14:39:32 + 1.04 + ? + ? + Compute Node + 829 + 431 + test_ISEVEN - BoolEven - label_test - ValEven - + BoolEven + label_test + ValEven + 383 - 239 - + 239 + 382 - 417 - + 417 + test_ISONE - BoolOne - label_test - ValOne - - + BoolOne + label_test + ValOne + + m3p1 - anEvenInteger - control_m3p1 - N - - -793 - 62 - -792 - 111 - + anEvenInteger + control_m3p1 + N + + div2 - anInteger - control_div2 - N - - -797 - 392 - -798 - 471 - + anInteger + control_div2 + N + + incr - aNewCount - control_div2 - K - + aNewCount + control_div2 + K + -809 - 420 - +810 + 482 + 808 - 288 - + 288 + incr - aNewCount - control_m3p1 - K - + aNewCount + control_m3p1 + K + -807 - 91 - -808 - 286 - +803 + 120 + +809 + 288 + label_begin - NT - test_ISONE - anInteger - + NT + test_ISONE + anInteger + 180 - 211 - -179 - 269 - + 217 + +180 + 258 + label_begin - NT - label_test - NT - - + NT + label_test + NT + + label_begin - NT - test_ISEVEN - anInteger - + NT + test_ISEVEN + anInteger + 179 - 417 - -179 - 271 - + 417 + +180 + 262 + label_begin - KT - label_test - KT - - + KT + label_test + KT + + label_test - Incr - incr - InGate - - -565 - 315 - -564 - 240 - -label_test - Even - div2 - InGate - + Even + div2 + Gate + +584 + 486 + 583 - 500 - -582 - 269 - + 261 + label_test - Odd - m3p1 - InGate - + Odd + m3p1 + Gate + -571 - 138 - -573 - 298 - +572 + 123 + +572 + 279 + label_test - N - m3p1 - anOddInteger - + N + m3p1 + anOddInteger + +602 + 98 + 604 - 110 - -605 - 328 - + 301 + label_test - N - div2 - anEvenInteger - + N + div2 + anEvenInteger + -606 - 471 - 605 - 328 - + 461 + +604 + 300 + label_test - K - incr - aCount - + K + incr + aCount + -594 - 287 - -595 - 356 - +597 + 286 + +596 + 320 + label_test - Default - EndL_OneEven - Default - - -1008 - 281 - -1008 - 560 - -565 - 559 - -564 - 385 - + Default + EndL_OneEven + Default + + control_m3p1 - OutGate - label_test - InGate - + Gate + label_test + Gate + -368 - 327 - 369 - 7 - -1009 - 8 - -1009 - 179 - + 343 + +368 + 22 + +1003 + 24 + +1005 + 189 + control_div2 - OutGate - label_begin - InGate - + Gate + label_begin + Gate + -3 - 327 - 2 - 582 - -991 - 583 - -991 - 451 - + 582 + +1012 + 583 + +1012 + 507 + GraphSyrControlGUI - label_begin\NB - label_begin - NB - + label_begin__NB + label_begin + NB + 3 - 7 - - + 7 + + GraphSyrControlGUI - label_begin\KB - label_begin - KB - + label_begin__KB + label_begin + KB + 3 - 0 - + 0 + diff --git a/examples/GraphSyrControlAve.py b/examples/GraphSyrControlAve.py index b039fbf..2a4c5ee 100644 --- a/examples/GraphSyrControlAve.py +++ b/examples/GraphSyrControlAve.py @@ -2,390 +2,411 @@ # Generated python file of Graph GraphSyrControlAve from SuperV import * -# Graph creation -GraphSyrControlAve = Graph( 'GraphSyrControlAve' ) -GraphSyrControlAve.SetName( 'GraphSyrControlAve' ) -GraphSyrControlAve.SetAuthor( 'JR' ) -GraphSyrControlAve.SetComment( 'Syracuse algorithm' ) -GraphSyrControlAve.Coords( 0 , 0 ) -# Creation of Factory Nodes - -test_ISEVEN = GraphSyrControlAve.FNode( 'SyrComponent' , 'SyrComponent' , 'C_ISEVEN' ) -test_ISEVEN.SetName( 'test_ISEVEN' ) -test_ISEVEN.SetAuthor( '' ) -test_ISEVEN.SetContainer( 'localhost/FactoryServer' ) -test_ISEVEN.SetComment( 'C_ISEVEN from SyrComponent' ) -test_ISEVEN.Coords( 370 , 455 ) - -test_ISONE = GraphSyrControlAve.FNode( 'SyrComponent' , 'SyrComponent' , 'C_ISONE' ) -test_ISONE.SetName( 'test_ISONE' ) -test_ISONE.SetAuthor( '' ) -test_ISONE.SetContainer( 'localhost/FactoryServer' ) -test_ISONE.SetComment( 'C_ISONE from SyrComponent' ) -test_ISONE.Coords( 370 , 127 ) - -m3p1 = GraphSyrControlAve.FNode( 'SyrComponent' , 'SyrComponent' , 'C_M3P1' ) -m3p1.SetName( 'm3p1' ) -m3p1.SetAuthor( '' ) -m3p1.SetContainer( 'localhost/FactoryServer' ) -m3p1.SetComment( 'C_M3P1 from SyrComponent' ) -m3p1.Coords( 789 , 0 ) - -div2 = GraphSyrControlAve.FNode( 'SyrComponent' , 'SyrComponent' , 'C_DIV2' ) -div2.SetName( 'div2' ) -div2.SetAuthor( '' ) -div2.SetContainer( 'localhost/FactoryServer' ) -div2.SetComment( 'C_DIV2 from SyrComponent' ) -div2.Coords( 789 , 276 ) - -incr = GraphSyrControlAve.FNode( 'SyrComponent' , 'SyrComponent' , 'C_INCR' ) -incr.SetName( 'incr' ) -incr.SetAuthor( '' ) -incr.SetContainer( 'localhost/FactoryServer' ) -incr.SetComment( 'C_INCR from SyrComponent' ) -incr.Coords( 790 , 136 ) - -C_MIN = GraphSyrControlAve.FNode( 'SyrComponent' , 'SyrComponent' , 'C_MIN' ) -C_MIN.SetName( 'C_MIN' ) -C_MIN.SetAuthor( '' ) -C_MIN.SetContainer( 'localhost/FactoryServer' ) -C_MIN.SetComment( 'C_MIN from SyrComponent' ) -C_MIN.Coords( 798 , 833 ) - -C_MAX = GraphSyrControlAve.FNode( 'SyrComponent' , 'SyrComponent' , 'C_MAX' ) -C_MAX.SetName( 'C_MAX' ) -C_MAX.SetAuthor( '' ) -C_MAX.SetContainer( 'localhost/FactoryServer' ) -C_MAX.SetComment( 'C_MAX from SyrComponent' ) -C_MAX.Coords( 798 , 668 ) - -C_AVERAGE = GraphSyrControlAve.FNode( 'SyrComponent' , 'SyrComponent' , 'C_AVERAGE' ) -C_AVERAGE.SetName( 'C_AVERAGE' ) -C_AVERAGE.SetAuthor( '' ) -C_AVERAGE.SetContainer( 'localhost/FactoryServer' ) -C_AVERAGE.SetComment( 'C_AVERAGE from SyrComponent' ) -C_AVERAGE.Coords( 784 , 476 ) - -C_LISTOFSYR = GraphSyrControlAve.FNode( 'SyrComponent' , 'SyrComponent' , 'C_LISTOFSYR' ) -C_LISTOFSYR.SetName( 'C_LISTOFSYR' ) -C_LISTOFSYR.SetAuthor( '' ) -C_LISTOFSYR.SetContainer( 'localhost/FactoryServer' ) -C_LISTOFSYR.SetComment( 'C_LISTOFSYR from SyrComponent' ) -C_LISTOFSYR.Coords( 4 , 363 ) - -# Creation of InLine Nodes -Pylabel_begin = [] -Pylabel_begin.append( 'def label_begin( NB , KB , MINB , MAXB , AVERAGEB , SYRLISTB ) :' ) -Pylabel_begin.append( ' return NB,KB,MINB,MAXB,AVERAGEB,SYRLISTB' ) -label_begin = GraphSyrControlAve.INode( 'label_begin' , Pylabel_begin ) -label_begin.SetName( 'label_begin' ) -label_begin.SetAuthor( '' ) -label_begin.SetComment( 'Python function' ) -label_begin.Coords( 183 , 219 ) -label_begin.InPort( 'NB' , 'long' ) -label_begin.InPort( 'KB' , 'long' ) -label_begin.InPort( 'MINB' , 'long' ) -label_begin.InPort( 'MAXB' , 'long' ) -label_begin.InPort( 'AVERAGEB' , 'double' ) -label_begin.InPort( 'SYRLISTB' , 'ListOfSyr' ) -label_begin.OutPort( 'NT' , 'long' ) -label_begin.OutPort( 'KT' , 'long' ) -label_begin.OutPort( 'MIN' , 'long' ) -label_begin.OutPort( 'MAX' , 'long' ) -label_begin.OutPort( 'AVERAGE' , 'double' ) -label_begin.OutPort( 'SYRLIST' , 'ListOfSyr' ) - -# Creation of Switch Nodes -Pylabel_test = [] -Pylabel_test.append( 'def L_OneEven( ValOne , ValEven , NT , KT , MIN , MAX , AVERAGE , SYRLIST ):' ) -Pylabel_test.append( ' Finished = ValOne' ) -Pylabel_test.append( ' if Finished == 0 :' ) -Pylabel_test.append( ' Incr = 1' ) -Pylabel_test.append( ' Even = ValEven' ) -Pylabel_test.append( ' if Even == 0 :' ) -Pylabel_test.append( ' Odd = 1' ) -Pylabel_test.append( ' else :' ) -Pylabel_test.append( ' Odd = 0' ) -Pylabel_test.append( ' else :' ) -Pylabel_test.append( ' Incr = 0' ) -Pylabel_test.append( ' Even = 0' ) -Pylabel_test.append( ' Odd = 0' ) -Pylabel_test.append( ' Even = ValEven' ) -Pylabel_test.append( ' return Finished,Incr,Even,Odd,NT,KT,MIN,MAX,AVERAGE,SYRLIST' ) -label_test,EndL_OneEven = GraphSyrControlAve.SNode( 'L_OneEven' , Pylabel_test ) -EndL_OneEven.SetName( 'EndL_OneEven' ) -EndL_OneEven.SetAuthor( '' ) -EndL_OneEven.SetComment( '' ) -EndL_OneEven.Coords( 1064 , 379 ) -PyEndL_OneEven = [] -EndL_OneEven.SetPyFunction( 'EndL_OneEven' , PyEndL_OneEven ) -EndL_OneEven.InPort( 'MIN' , 'long' ) -EndL_OneEven.InPort( 'MAX' , 'long' ) -EndL_OneEven.InPort( 'AVERAGE' , 'double' ) -EndL_OneEven.OutPort( 'MIN' , 'long' ) -EndL_OneEven.OutPort( 'MAX' , 'long' ) -EndL_OneEven.OutPort( 'AVERAGE' , 'double' ) -label_test.SetName( 'label_test' ) -label_test.SetAuthor( '' ) -label_test.SetComment( '' ) -label_test.Coords( 563 , 206 ) -label_test.InPort( 'ValOne' , 'long' ) -label_test.InPort( 'ValEven' , 'long' ) -label_test.InPort( 'NT' , 'long' ) -label_test.InPort( 'KT' , 'long' ) -label_test.InPort( 'MIN' , 'long' ) -label_test.InPort( 'MAX' , 'long' ) -label_test.InPort( 'AVERAGE' , 'double' ) -label_test.InPort( 'SYRLIST' , 'ListOfSyr' ) -label_test.OutPort( 'Finished' , 'long' ) -label_test.OutPort( 'Incr' , 'long' ) -label_test.OutPort( 'Even' , 'long' ) -label_test.OutPort( 'Odd' , 'long' ) -label_test.OutPort( 'N' , 'long' ) -label_test.OutPort( 'K' , 'long' ) -label_test.OutPort( 'MINT' , 'long' ) -label_test.OutPort( 'MAXT' , 'long' ) -label_test.OutPort( 'AVERAGET' , 'double' ) -label_test.OutPort( 'SYRLISTT' , 'ListOfSyr' ) - -# Creation of GOTO Nodes -Pycontrol_m3p1 = [] -Pycontrol_m3p1.append( 'def C_NotOneIsEven( N , K , MINT , MAXT , AVERAGET , SYRLISTT ):' ) -Pycontrol_m3p1.append( ' return 0,1,N,K,MINT,MAXT,AVERAGET,SYRLISTT' ) -control_m3p1 = GraphSyrControlAve.GNode( 'C_NotOneIsEven' , Pycontrol_m3p1 , 'label_test' ) -control_m3p1.SetName( 'control_m3p1' ) -control_m3p1.SetAuthor( '' ) -control_m3p1.SetComment( '' ) -control_m3p1.Coords( 1058 , 8 ) -control_m3p1.InPort( 'N' , 'long' ) -control_m3p1.InPort( 'K' , 'long' ) -control_m3p1.InPort( 'MINT' , 'long' ) -control_m3p1.InPort( 'MAXT' , 'long' ) -control_m3p1.InPort( 'AVERAGET' , 'double' ) -control_m3p1.InPort( 'SYRLISTT' , 'ListOfSyr' ) -control_m3p1.OutPort( 'ValOne' , 'long' ) -control_m3p1.OutPort( 'ValEven' , 'long' ) -control_m3p1.OutPort( 'NT' , 'long' ) -control_m3p1.OutPort( 'KT' , 'long' ) -control_m3p1.OutPort( 'MIN' , 'long' ) -control_m3p1.OutPort( 'MAX' , 'long' ) -control_m3p1.OutPort( 'AVERAGE' , 'double' ) -control_m3p1.OutPort( 'SYRLIST' , 'ListOfSyr' ) - -Pycontrol_div2 = [] -Pycontrol_div2.append( 'def control_div2( N , K , MINT , MAXT , AVERAGET , SYRLISTT ) :' ) -Pycontrol_div2.append( ' return N,K,MINT,MAXT,AVERAGET,SYRLISTT' ) -control_div2 = GraphSyrControlAve.GNode( 'control_div2' , Pycontrol_div2 , 'label_begin' ) -control_div2.SetName( 'control_div2' ) -control_div2.SetAuthor( '' ) -control_div2.SetComment( '' ) -control_div2.Coords( 1048 , 555 ) -control_div2.InPort( 'N' , 'long' ) -control_div2.InPort( 'K' , 'long' ) -control_div2.InPort( 'MINT' , 'long' ) -control_div2.InPort( 'MAXT' , 'long' ) -control_div2.InPort( 'AVERAGET' , 'double' ) -control_div2.InPort( 'SYRLISTT' , 'ListOfSyr' ) -control_div2.OutPort( 'NB' , 'long' ) -control_div2.OutPort( 'KB' , 'long' ) -control_div2.OutPort( 'MINB' , 'long' ) -control_div2.OutPort( 'MAXB' , 'long' ) -control_div2.OutPort( 'AVERAGEB' , 'double' ) -control_div2.OutPort( 'SYRLISTB' , 'ListOfSyr' ) - -# Creation of Links -test_ISEVENBoolEven = test_ISEVEN.Port( 'BoolEven' ) -label_testValEven = GraphSyrControlAve.Link( test_ISEVENBoolEven , label_test.Port( 'ValEven' ) ) -label_testValEven.AddCoord( 1 , 545 , 269 ) -label_testValEven.AddCoord( 2 , 545 , 535 ) - -test_ISONEBoolOne = test_ISONE.Port( 'BoolOne' ) -label_testValOne = GraphSyrControlAve.Link( test_ISONEBoolOne , label_test.Port( 'ValOne' ) ) -label_testValOne.AddCoord( 1 , 546 , 241 ) -label_testValOne.AddCoord( 2 , 545 , 208 ) - -m3p1anEvenInteger = m3p1.Port( 'anEvenInteger' ) -control_m3p1N = GraphSyrControlAve.Link( m3p1anEvenInteger , control_m3p1.Port( 'N' ) ) -control_m3p1N.AddCoord( 1 , 977 , 43 ) -control_m3p1N.AddCoord( 2 , 976 , 81 ) - -div2anInteger = div2.Port( 'anInteger' ) -control_div2N = GraphSyrControlAve.Link( div2anInteger , control_div2.Port( 'N' ) ) -control_div2N.AddCoord( 1 , 1011 , 590 ) -control_div2N.AddCoord( 2 , 1010 , 357 ) - -incraNewCount = incr.Port( 'aNewCount' ) -control_div2K = GraphSyrControlAve.Link( incraNewCount , control_div2.Port( 'K' ) ) -control_div2K.AddCoord( 1 , 964 , 618 ) -control_div2K.AddCoord( 2 , 966 , 217 ) - -control_m3p1K = GraphSyrControlAve.Link( incraNewCount , control_m3p1.Port( 'K' ) ) -control_m3p1K.AddCoord( 1 , 966 , 70 ) -control_m3p1K.AddCoord( 2 , 966 , 216 ) - -C_AVERAGEaCount = GraphSyrControlAve.Link( incraNewCount , C_AVERAGE.Port( 'aCount' ) ) -C_AVERAGEaCount.AddCoord( 1 , 778 , 615 ) -C_AVERAGEaCount.AddCoord( 2 , 779 , 462 ) -C_AVERAGEaCount.AddCoord( 3 , 965 , 462 ) -C_AVERAGEaCount.AddCoord( 4 , 966 , 216 ) - -C_MINaNewMinVal = C_MIN.Port( 'aNewMinVal' ) -control_m3p1MINT = GraphSyrControlAve.Link( C_MINaNewMinVal , control_m3p1.Port( 'MINT' ) ) -control_m3p1MINT.AddCoord( 1 , 991 , 100 ) -control_m3p1MINT.AddCoord( 2 , 991 , 913 ) - -control_div2MINT = GraphSyrControlAve.Link( C_MINaNewMinVal , control_div2.Port( 'MINT' ) ) -control_div2MINT.AddCoord( 1 , 990 , 646 ) -control_div2MINT.AddCoord( 2 , 991 , 912 ) - -C_MAXaNewMaxVal = C_MAX.Port( 'aNewMaxVal' ) -control_m3p1MAXT = GraphSyrControlAve.Link( C_MAXaNewMaxVal , control_m3p1.Port( 'MAXT' ) ) -control_m3p1MAXT.AddCoord( 1 , 974 , 130 ) -control_m3p1MAXT.AddCoord( 2 , 974 , 747 ) - -control_div2MAXT = GraphSyrControlAve.Link( C_MAXaNewMaxVal , control_div2.Port( 'MAXT' ) ) -control_div2MAXT.AddCoord( 1 , 973 , 676 ) -control_div2MAXT.AddCoord( 2 , 974 , 747 ) - -C_AVERAGEaNewListOfSyr = C_AVERAGE.Port( 'aNewListOfSyr' ) -control_m3p1SYRLISTT = GraphSyrControlAve.Link( C_AVERAGEaNewListOfSyr , control_m3p1.Port( 'SYRLISTT' ) ) -control_m3p1SYRLISTT.AddCoord( 1 , 1037 , 188 ) -control_m3p1SYRLISTT.AddCoord( 2 , 1038 , 556 ) - -control_div2SYRLISTT = GraphSyrControlAve.Link( C_AVERAGEaNewListOfSyr , control_div2.Port( 'SYRLISTT' ) ) -control_div2SYRLISTT.AddCoord( 1 , 1038 , 735 ) -control_div2SYRLISTT.AddCoord( 2 , 1038 , 555 ) - -C_AVERAGEanAverage = C_AVERAGE.Port( 'anAverage' ) -control_m3p1AVERAGET = GraphSyrControlAve.Link( C_AVERAGEanAverage , control_m3p1.Port( 'AVERAGET' ) ) -control_m3p1AVERAGET.AddCoord( 1 , 1027 , 158 ) -control_m3p1AVERAGET.AddCoord( 2 , 1026 , 584 ) - -control_div2AVERAGET = GraphSyrControlAve.Link( C_AVERAGEanAverage , control_div2.Port( 'AVERAGET' ) ) -control_div2AVERAGET.AddCoord( 1 , 1027 , 706 ) -control_div2AVERAGET.AddCoord( 2 , 1027 , 584 ) - -C_LISTOFSYRaListOfSyr = C_LISTOFSYR.Port( 'aListOfSyr' ) -label_beginSYRLISTB = GraphSyrControlAve.Link( C_LISTOFSYRaListOfSyr , label_begin.Port( 'SYRLISTB' ) ) - -label_beginNT = label_begin.Port( 'NT' ) -test_ISONEanInteger = GraphSyrControlAve.Link( label_beginNT , test_ISONE.Port( 'anInteger' ) ) -test_ISONEanInteger.AddCoord( 1 , 362 , 207 ) -test_ISONEanInteger.AddCoord( 2 , 362 , 299 ) - -label_testNT = GraphSyrControlAve.Link( label_beginNT , label_test.Port( 'NT' ) ) - -test_ISEVENanInteger = GraphSyrControlAve.Link( label_beginNT , test_ISEVEN.Port( 'anInteger' ) ) -test_ISEVENanInteger.AddCoord( 1 , 361 , 534 ) -test_ISEVENanInteger.AddCoord( 2 , 362 , 299 ) - -label_beginKT = label_begin.Port( 'KT' ) -label_testKT = GraphSyrControlAve.Link( label_beginKT , label_test.Port( 'KT' ) ) - -label_beginMIN = label_begin.Port( 'MIN' ) -label_testMIN = GraphSyrControlAve.Link( label_beginMIN , label_test.Port( 'MIN' ) ) - -label_beginMAX = label_begin.Port( 'MAX' ) -label_testMAX = GraphSyrControlAve.Link( label_beginMAX , label_test.Port( 'MAX' ) ) - -label_beginAVERAGE = label_begin.Port( 'AVERAGE' ) -label_testAVERAGE = GraphSyrControlAve.Link( label_beginAVERAGE , label_test.Port( 'AVERAGE' ) ) - -label_beginSYRLIST = label_begin.Port( 'SYRLIST' ) -label_testSYRLIST = GraphSyrControlAve.Link( label_beginSYRLIST , label_test.Port( 'SYRLIST' ) ) - -label_testFinished = label_test.Port( 'Finished' ) -EndL_OneEvenDefault = GraphSyrControlAve.Link( label_testFinished , EndL_OneEven.Port( 'Default' ) ) - -label_testIncr = label_test.Port( 'Incr' ) -incrInGate = GraphSyrControlAve.Link( label_testIncr , incr.Port( 'InGate' ) ) -incrInGate.AddCoord( 1 , 779 , 250 ) -incrInGate.AddCoord( 2 , 780 , 269 ) - -label_testEven = label_test.Port( 'Even' ) -div2InGate = GraphSyrControlAve.Link( label_testEven , div2.Port( 'InGate' ) ) -div2InGate.AddCoord( 1 , 780 , 387 ) -div2InGate.AddCoord( 2 , 779 , 299 ) - -label_testOdd = label_test.Port( 'Odd' ) -m3p1InGate = GraphSyrControlAve.Link( label_testOdd , m3p1.Port( 'InGate' ) ) -m3p1InGate.AddCoord( 1 , 756 , 115 ) -m3p1InGate.AddCoord( 2 , 756 , 328 ) - -label_testN = label_test.Port( 'N' ) -m3p1anOddInteger = GraphSyrControlAve.Link( label_testN , m3p1.Port( 'anOddInteger' ) ) -m3p1anOddInteger.AddCoord( 1 , 740 , 80 ) -m3p1anOddInteger.AddCoord( 2 , 741 , 356 ) - -div2anEvenInteger = GraphSyrControlAve.Link( label_testN , div2.Port( 'anEvenInteger' ) ) - -C_MINanInteger = GraphSyrControlAve.Link( label_testN , C_MIN.Port( 'anInteger' ) ) -C_MINanInteger.AddCoord( 1 , 741 , 943 ) -C_MINanInteger.AddCoord( 2 , 740 , 357 ) - -C_MAXanInteger = GraphSyrControlAve.Link( label_testN , C_MAX.Port( 'anInteger' ) ) -C_MAXanInteger.AddCoord( 1 , 742 , 778 ) -C_MAXanInteger.AddCoord( 2 , 741 , 359 ) - -C_AVERAGEanInteger = GraphSyrControlAve.Link( label_testN , C_AVERAGE.Port( 'anInteger' ) ) -C_AVERAGEanInteger.AddCoord( 1 , 742 , 584 ) -C_AVERAGEanInteger.AddCoord( 2 , 741 , 357 ) - -label_testK = label_test.Port( 'K' ) -incraCount = GraphSyrControlAve.Link( label_testK , incr.Port( 'aCount' ) ) -incraCount.AddCoord( 1 , 765 , 217 ) -incraCount.AddCoord( 2 , 764 , 385 ) - -label_testMINT = label_test.Port( 'MINT' ) -C_MINaMinVal = GraphSyrControlAve.Link( label_testMINT , C_MIN.Port( 'aMinVal' ) ) -C_MINaMinVal.AddCoord( 1 , 759 , 914 ) -C_MINaMinVal.AddCoord( 2 , 758 , 414 ) - -EndL_OneEvenMIN = GraphSyrControlAve.Link( label_testMINT , EndL_OneEven.Port( 'MIN' ) ) - -label_testMAXT = label_test.Port( 'MAXT' ) -C_MAXaMaxVal = GraphSyrControlAve.Link( label_testMAXT , C_MAX.Port( 'aMaxVal' ) ) -C_MAXaMaxVal.AddCoord( 1 , 729 , 749 ) -C_MAXaMaxVal.AddCoord( 2 , 728 , 444 ) - -EndL_OneEvenMAX = GraphSyrControlAve.Link( label_testMAXT , EndL_OneEven.Port( 'MAX' ) ) - -label_testAVERAGET = label_test.Port( 'AVERAGET' ) -EndL_OneEvenAVERAGE = GraphSyrControlAve.Link( label_testAVERAGET , EndL_OneEven.Port( 'AVERAGE' ) ) - -label_testSYRLISTT = label_test.Port( 'SYRLISTT' ) -C_AVERAGEaListOfSyr = GraphSyrControlAve.Link( label_testSYRLISTT , C_AVERAGE.Port( 'aListOfSyr' ) ) -C_AVERAGEaListOfSyr.AddCoord( 1 , 771 , 557 ) -C_AVERAGEaListOfSyr.AddCoord( 2 , 770 , 502 ) - -control_m3p1OutGate = control_m3p1.Port( 'OutGate' ) -label_testInGate = GraphSyrControlAve.Link( control_m3p1OutGate , label_test.Port( 'InGate' ) ) -label_testInGate.AddCoord( 1 , 553 , 536 ) -label_testInGate.AddCoord( 2 , 554 , 1025 ) -label_testInGate.AddCoord( 3 , 1242 , 1026 ) -label_testInGate.AddCoord( 4 , 1243 , 279 ) - -control_div2OutGate = control_div2.Port( 'OutGate' ) -label_beginInGate = GraphSyrControlAve.Link( control_div2OutGate , label_begin.Port( 'InGate' ) ) -label_beginInGate.AddCoord( 1 , 176 , 476 ) -label_beginInGate.AddCoord( 2 , 176 , 997 ) -label_beginInGate.AddCoord( 3 , 1217 , 996 ) -label_beginInGate.AddCoord( 4 , 1218 , 768 ) - -# Creation of Input datas -label_beginNB = label_begin.Input( 'NB' , 31) -label_beginKB = label_begin.Input( 'KB' , 0) -label_beginMINB = label_begin.Input( 'MINB' , 0) -label_beginMAXB = label_begin.Input( 'MAXB' , 0) -label_beginAVERAGEB = label_begin.Input( 'AVERAGEB' , 0) - -# Creation of Output variables -EndL_OneEvenMIN = EndL_OneEven.Port( 'MIN' ) -EndL_OneEvenMAX = EndL_OneEven.Port( 'MAX' ) -EndL_OneEvenAVERAGE = EndL_OneEven.Port( 'AVERAGE' ) - -GraphSyrControlAve.Run() -GraphSyrControlAve.DoneW() -print GraphSyrControlAve.State() -GraphSyrControlAve.PrintPorts() +# Graph creation of GraphSyrControlAve +def DefGraphSyrControlAve() : + GraphSyrControlAve = Graph( 'GraphSyrControlAve' ) + GraphSyrControlAve.SetName( 'GraphSyrControlAve' ) + GraphSyrControlAve.SetAuthor( 'JR' ) + GraphSyrControlAve.SetComment( 'Syracuse algorithm' ) + GraphSyrControlAve.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + test_ISEVEN = GraphSyrControlAve.FNode( 'SyrComponent' , 'SyrComponent' , 'C_ISEVEN' ) + test_ISEVEN.SetName( 'test_ISEVEN' ) + test_ISEVEN.SetAuthor( '' ) + test_ISEVEN.SetContainer( 'localhost/FactoryServer' ) + test_ISEVEN.SetComment( 'C_ISEVEN from SyrComponent' ) + test_ISEVEN.Coords( 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 = GraphSyrControlAve.FNode( 'SyrComponent' , 'SyrComponent' , 'C_ISONE' ) + test_ISONE.SetName( 'test_ISONE' ) + test_ISONE.SetAuthor( '' ) + test_ISONE.SetContainer( 'localhost/FactoryServer' ) + test_ISONE.SetComment( 'C_ISONE from SyrComponent' ) + test_ISONE.Coords( 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 = GraphSyrControlAve.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 = GraphSyrControlAve.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 = GraphSyrControlAve.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 = GraphSyrControlAve.FNode( 'SyrComponent' , 'SyrComponent' , 'C_MIN' ) + C_MIN.SetName( 'C_MIN' ) + C_MIN.SetAuthor( '' ) + C_MIN.SetContainer( 'localhost/FactoryServer' ) + C_MIN.SetComment( 'C_MIN from SyrComponent' ) + C_MIN.Coords( 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 = GraphSyrControlAve.FNode( 'SyrComponent' , 'SyrComponent' , 'C_MAX' ) + C_MAX.SetName( 'C_MAX' ) + C_MAX.SetAuthor( '' ) + C_MAX.SetContainer( 'localhost/FactoryServer' ) + C_MAX.SetComment( 'C_MAX from SyrComponent' ) + C_MAX.Coords( 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 = GraphSyrControlAve.FNode( 'SyrComponent' , 'SyrComponent' , 'C_AVERAGE' ) + C_AVERAGE.SetName( 'C_AVERAGE' ) + C_AVERAGE.SetAuthor( '' ) + C_AVERAGE.SetContainer( 'localhost/FactoryServer' ) + C_AVERAGE.SetComment( 'C_AVERAGE from SyrComponent' ) + C_AVERAGE.Coords( 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 = GraphSyrControlAve.FNode( 'SyrComponent' , 'SyrComponent' , 'C_LISTOFSYR' ) + C_LISTOFSYR.SetName( 'C_LISTOFSYR' ) + C_LISTOFSYR.SetAuthor( '' ) + C_LISTOFSYR.SetContainer( 'localhost/FactoryServer' ) + C_LISTOFSYR.SetComment( 'C_LISTOFSYR from SyrComponent' ) + C_LISTOFSYR.Coords( 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 = GraphSyrControlAve.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 = GraphSyrControlAve.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 = GraphSyrControlAve.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 = GraphSyrControlAve.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 = GraphSyrControlAve.Link( Otest_ISEVENBoolEven , Ilabel_testValEven ) + 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 , 237 ) + Ltest_ISONEBoolOnelabel_testValOne.AddCoord( 2 , 546 , 198 ) + + Lm3p1anEvenIntegercontrol_m3p1N = GraphSyrControlAve.Link( Om3p1anEvenInteger , Icontrol_m3p1N ) + Lm3p1anEvenIntegercontrol_m3p1N.AddCoord( 1 , 975 , 38 ) + Lm3p1anEvenIntegercontrol_m3p1N.AddCoord( 2 , 976 , 81 ) + + Ldiv2anIntegercontrol_div2N = GraphSyrControlAve.Link( Odiv2anInteger , Icontrol_div2N ) + Ldiv2anIntegercontrol_div2N.AddCoord( 1 , 1012 , 585 ) + Ldiv2anIntegercontrol_div2N.AddCoord( 2 , 1011 , 346 ) + + LincraNewCountcontrol_div2K = GraphSyrControlAve.Link( OincraNewCount , Icontrol_div2K ) + LincraNewCountcontrol_div2K.AddCoord( 1 , 966 , 606 ) + LincraNewCountcontrol_div2K.AddCoord( 2 , 968 , 207 ) + + LincraNewCountcontrol_m3p1K = GraphSyrControlAve.Link( OincraNewCount , Icontrol_m3p1K ) + LincraNewCountcontrol_m3p1K.AddCoord( 1 , 965 , 59 ) + LincraNewCountcontrol_m3p1K.AddCoord( 2 , 966 , 208 ) + + LincraNewCountC_AVERAGEaCount = GraphSyrControlAve.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 = GraphSyrControlAve.Link( OC_MINaNewMinVal , Icontrol_m3p1MINT ) + 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 , 991 , 626 ) + LC_MINaNewMinValcontrol_div2MINT.AddCoord( 2 , 991 , 905 ) + + LC_MAXaNewMaxValcontrol_m3p1MAXT = GraphSyrControlAve.Link( OC_MAXaNewMaxVal , Icontrol_m3p1MAXT ) + 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 , 972 , 648 ) + LC_MAXaNewMaxValcontrol_div2MAXT.AddCoord( 2 , 974 , 738 ) + + LC_AVERAGEaNewListOfSyrcontrol_m3p1SYRLISTT = GraphSyrControlAve.Link( OC_AVERAGEaNewListOfSyr , Icontrol_m3p1SYRLISTT ) + 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 , 686 ) + LC_AVERAGEaNewListOfSyrcontrol_div2SYRLISTT.AddCoord( 2 , 1038 , 555 ) + + LC_AVERAGEanAveragecontrol_m3p1AVERAGET = GraphSyrControlAve.Link( OC_AVERAGEanAverage , Icontrol_m3p1AVERAGET ) + 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 , 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 , 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 , 359 , 525 ) + Llabel_beginNTtest_ISEVENanInteger.AddCoord( 2 , 361 , 291 ) + + Llabel_beginKTlabel_testKT = GraphSyrControlAve.Link( Olabel_beginKT , Ilabel_testKT ) + + Llabel_beginMINlabel_testMIN = GraphSyrControlAve.Link( Olabel_beginMIN , Ilabel_testMIN ) + + Llabel_beginMAXlabel_testMAX = GraphSyrControlAve.Link( Olabel_beginMAX , Ilabel_testMAX ) + + Llabel_beginAVERAGElabel_testAVERAGE = GraphSyrControlAve.Link( Olabel_beginAVERAGE , Ilabel_testAVERAGE ) + + Llabel_beginSYRLISTlabel_testSYRLIST = GraphSyrControlAve.Link( Olabel_beginSYRLIST , Ilabel_testSYRLIST ) + + Llabel_testEvendiv2Gate = GraphSyrControlAve.Link( Olabel_testEven , Idiv2Gate ) + Llabel_testEvendiv2Gate.AddCoord( 1 , 777 , 351 ) + Llabel_testEvendiv2Gate.AddCoord( 2 , 777 , 286 ) + + Llabel_testOddm3p1Gate = GraphSyrControlAve.Link( Olabel_testOdd , Im3p1Gate ) + Llabel_testOddm3p1Gate.AddCoord( 1 , 757 , 95 ) + Llabel_testOddm3p1Gate.AddCoord( 2 , 757 , 310 ) + + Llabel_testNm3p1anOddInteger = GraphSyrControlAve.Link( Olabel_testN , Im3p1anOddInteger ) + 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 , 744 , 923 ) + Llabel_testNC_MINanInteger.AddCoord( 2 , 742 , 331 ) + + Llabel_testNC_MAXanInteger = GraphSyrControlAve.Link( Olabel_testN , IC_MAXanInteger ) + 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 , 741 , 568 ) + Llabel_testNC_AVERAGEanInteger.AddCoord( 2 , 742 , 330 ) + + Llabel_testKincraCount = GraphSyrControlAve.Link( Olabel_testK , IincraCount ) + 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 , 760 , 904 ) + Llabel_testMINTC_MINaMinVal.AddCoord( 2 , 756 , 372 ) + + Llabel_testMINTEndL_OneEvenMINT = GraphSyrControlAve.Link( Olabel_testMINT , IEndL_OneEvenMINT ) + + Llabel_testMAXTC_MAXaMaxVal = GraphSyrControlAve.Link( Olabel_testMAXT , IC_MAXaMaxVal ) + Llabel_testMAXTC_MAXaMaxVal.AddCoord( 1 , 765 , 742 ) + Llabel_testMAXTC_MAXaMaxVal.AddCoord( 2 , 766 , 384 ) + + Llabel_testMAXTEndL_OneEvenMAXT = GraphSyrControlAve.Link( Olabel_testMAXT , IEndL_OneEvenMAXT ) + + Llabel_testAVERAGETEndL_OneEvenAVERAGET = GraphSyrControlAve.Link( Olabel_testAVERAGET , IEndL_OneEvenAVERAGET ) + + Llabel_testSYRLISTTC_AVERAGEaListOfSyr = GraphSyrControlAve.Link( Olabel_testSYRLISTT , IC_AVERAGEaListOfSyr ) + 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 , 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 = GraphSyrControlAve.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 GraphSyrControlAve + + +GraphSyrControlAve = DefGraphSyrControlAve() diff --git a/examples/GraphSyrControlAve.xml b/examples/GraphSyrControlAve.xml index e94ce93..c03ddc2 100644 --- a/examples/GraphSyrControlAve.xml +++ b/examples/GraphSyrControlAve.xml @@ -1,1107 +1,1104 @@ - + + ? - ? - GraphSyrControlAve - 1 - ? - + ? + GraphSyrControlAve + 1 + ? + GraphSyrControlAve - + long - label_begin\NB - + label_begin__NB + long - label_begin\KB - + label_begin__KB + long - label_begin\MINB - + label_begin__MINB + long - label_begin\MAXB - + label_begin__MAXB + double - label_begin\AVERAGEB - + label_begin__AVERAGEB + long - EndL_OneEven\MIN - + label_test__Finished + long - EndL_OneEven\MAX - + label_test__Incr + +long + EndL_OneEven__MIN + +long + EndL_OneEven__MAX + double - EndL_OneEven\AVERAGE - - - 2/10/2003 - 11:17:14 - 2/10/2003 - 11:36:18 - 1.05 - JR - ? - Syracuse algorithm - 0 - 0 - + EndL_OneEven__AVERAGE + + + 2/10/2003 - 11:17:14 + 15/2/2005 - 11:9:34 + 1.05 + JR + ? + Syracuse algorithm + 0 + 0 + SyrComponent - SyrComponent - test_ISEVEN - 0 - ? - + SyrComponent + test_ISEVEN + 0 + ? + C_ISEVEN - + long - anInteger - + anInteger + long - BoolEven - - - 2/10/2003 - 11:36:18 - 2/10/2003 - 11:36:18 - 1.05 - ? - localhost/FactoryServer - C_ISEVEN from SyrComponent - 370 - 455 - + BoolEven + + + 15/2/2005 - 11:9:13 + 15/2/2005 - 11:9:13 + 1.05 + ? + localhost/FactoryServer + C_ISEVEN from SyrComponent + 370 + 455 + SyrComponent - SyrComponent - test_ISONE - 0 - ? - + SyrComponent + test_ISONE + 0 + ? + C_ISONE - + long - anInteger - + anInteger + long - BoolOne - - - 2/10/2003 - 11:36:18 - 2/10/2003 - 11:36:18 - 1.05 - ? - localhost/FactoryServer - C_ISONE from SyrComponent - 370 - 127 - + BoolOne + + + 15/2/2005 - 11:9:13 + 15/2/2005 - 11:9:13 + 1.05 + ? + localhost/FactoryServer + C_ISONE from SyrComponent + 370 + 127 + SyrComponent - SyrComponent - m3p1 - 0 - ? - + SyrComponent + m3p1 + 0 + ? + C_M3P1 - + long - anOddInteger - + anOddInteger + long - anEvenInteger - - - 2/10/2003 - 11:36:18 - 2/10/2003 - 11:36:18 - 1.05 - ? - localhost/FactoryServer - C_M3P1 from SyrComponent - 789 - 0 - + anEvenInteger + + + 15/2/2005 - 11:9:13 + 15/2/2005 - 11:9:13 + 1.05 + ? + localhost/FactoryServer + C_M3P1 from SyrComponent + 789 + 0 + SyrComponent - SyrComponent - div2 - 0 - ? - + SyrComponent + div2 + 0 + ? + C_DIV2 - + long - anEvenInteger - + anEvenInteger + long - anInteger - - - 2/10/2003 - 11:36:18 - 2/10/2003 - 11:36:18 - 1.05 - ? - localhost/FactoryServer - C_DIV2 from SyrComponent - 789 - 276 - + anInteger + + + 15/2/2005 - 11:9:13 + 15/2/2005 - 11:9:13 + 1.05 + ? + localhost/FactoryServer + C_DIV2 from SyrComponent + 789 + 255 + SyrComponent - SyrComponent - incr - 0 - ? - + SyrComponent + incr + 0 + ? + C_INCR - + long - aCount - + aCount + long - aNewCount - - - 2/10/2003 - 11:36:18 - 2/10/2003 - 11:36:18 - 1.05 - ? - localhost/FactoryServer - C_INCR from SyrComponent - 790 - 136 - + aNewCount + + + 15/2/2005 - 11:9:13 + 15/2/2005 - 11:9:13 + 1.05 + ? + localhost/FactoryServer + C_INCR from SyrComponent + 790 + 136 + SyrComponent - SyrComponent - C_MIN - 0 - ? - + SyrComponent + C_MIN + 0 + ? + C_MIN - + long - aMinVal - + aMinVal + long - anInteger - + anInteger + long - aNewMinVal - - - 2/10/2003 - 11:36:18 - 2/10/2003 - 11:36:18 - 1.05 - ? - localhost/FactoryServer - C_MIN from SyrComponent - 798 - 833 - + aNewMinVal + + + 15/2/2005 - 11:9:13 + 15/2/2005 - 11:9:13 + 1.05 + ? + localhost/FactoryServer + C_MIN from SyrComponent + 798 + 833 + SyrComponent - SyrComponent - C_MAX - 0 - ? - + SyrComponent + C_MAX + 0 + ? + C_MAX - + long - aMaxVal - + aMaxVal + long - anInteger - + anInteger + long - aNewMaxVal - - - 2/10/2003 - 11:36:18 - 2/10/2003 - 11:36:18 - 1.05 - ? - localhost/FactoryServer - C_MAX from SyrComponent - 798 - 668 - + aNewMaxVal + + + 15/2/2005 - 11:9:13 + 15/2/2005 - 11:9:13 + 1.05 + ? + localhost/FactoryServer + C_MAX from SyrComponent + 798 + 668 + SyrComponent - SyrComponent - C_AVERAGE - 0 - ? - + SyrComponent + C_AVERAGE + 0 + ? + C_AVERAGE - + ListOfSyr - aListOfSyr - + aListOfSyr + long - anInteger - + anInteger + long - aCount - + aCount + ListOfSyr - aNewListOfSyr - + aNewListOfSyr + double - anAverage - - - 2/10/2003 - 11:36:18 - 2/10/2003 - 11:36:18 - 1.05 - ? - localhost/FactoryServer - C_AVERAGE from SyrComponent - 784 - 476 - + anAverage + + + 15/2/2005 - 11:9:13 + 15/2/2005 - 11:9:13 + 1.05 + ? + localhost/FactoryServer + C_AVERAGE from SyrComponent + 784 + 476 + SyrComponent - SyrComponent - C_LISTOFSYR - 0 - ? - + SyrComponent + C_LISTOFSYR + 0 + ? + C_LISTOFSYR - - + + ListOfSyr - aListOfSyr - - - 2/10/2003 - 11:36:18 - 2/10/2003 - 11:36:18 - 1.05 - ? - localhost/FactoryServer - C_LISTOFSYR from SyrComponent - 4 - 363 - + aListOfSyr + + + 15/2/2005 - 11:9:13 + 15/2/2005 - 11:9:13 + 1.05 + ? + localhost/FactoryServer + C_LISTOFSYR from SyrComponent + 5 + 321 + ? - ? - label_begin - 3 - ? - + ? + label_begin + 3 + ? + label_begin - + long - NB - + NB + long - KB - + KB + long - MINB - + MINB + long - MAXB - + MAXB + double - AVERAGEB - + AVERAGEB + ListOfSyr - SYRLISTB - + SYRLISTB + long - NT - + NT + long - KT - + KT + long - MIN - + MIN + long - MAX - + MAX + double - AVERAGE - + AVERAGE + ListOfSyr - SYRLIST - - + SYRLIST + + label_begin - - - 2/10/2003 - 11:36:18 - 2/10/2003 - 11:36:18 - 1.05 - ? - ? - Python function - 183 - 219 - + + + 15/2/2005 - 11:9:13 + 15/2/2005 - 11:9:13 + 1.05 + ? + ? + Python function + 183 + 220 + ? - ? - label_test - 6 - EndL_OneEven - + ? + label_test + 6 + EndL_OneEven + label_test - + long - ValOne - + ValOne + long - ValEven - + ValEven + long - NT - + NT + long - KT - + KT + long - MIN - + MIN + long - MAX - + MAX + double - AVERAGE - + AVERAGE + ListOfSyr - SYRLIST - + SYRLIST + long - Finished - + Finished + long - Incr - + Incr + long - Even - + Even + long - Odd - + Odd + long - N - + N + long - K - + K + long - MINT - + MINT + long - MAXT - + MAXT + double - AVERAGET - + AVERAGET + ListOfSyr - SYRLISTT - - + SYRLISTT + + L_OneEven - - - - - - - - - - - - - - - - 2/10/2003 - 11:36:18 - 2/10/2003 - 11:36:18 - 1.05 - ? - ? - ? - 563 - 206 - + + + + + + + + + + + + + + + + 15/2/2005 - 11:9:13 + 15/2/2005 - 11:9:13 + 1.05 + ? + ? + Compute Node + 564 + 219 + ? - ? - EndL_OneEven - 7 - label_test - + ? + EndL_OneEven + 7 + label_test + EndL_OneEven - + long - MIN - + MINT + long - MAX - + MAXT + double - AVERAGE - + AVERAGET + long - MIN - + MIN + long - MAX - + MAX + double - AVERAGE - - - - 2/10/2003 - 11:36:18 - 2/10/2003 - 11:36:18 - 1.05 - ? - ? - ? - 1064 - 379 - + AVERAGE + + + +? + + 15/2/2005 - 11:9:13 + 15/2/2005 - 11:9:13 + 1.05 + ? + ? + Compute Node + 1064 + 339 + ? - ? - control_m3p1 - 8 - label_test - + ? + control_m3p1 + 8 + label_test + control_m3p1 - + long - N - + N + long - K - + K + long - MINT - + MINT + long - MAXT - + MAXT + double - AVERAGET - + AVERAGET + ListOfSyr - SYRLISTT - + SYRLISTT + long - ValOne - + ValOne + long - ValEven - + ValEven + long - NT - + NT + long - KT - + KT + long - MIN - + MIN + long - MAX - + MAX + double - AVERAGE - + AVERAGE + ListOfSyr - SYRLIST - - + SYRLIST + + C_NotOneIsEven - - - 2/10/2003 - 11:36:18 - 2/10/2003 - 11:36:18 - 1.05 - ? - ? - ? - 1058 - 8 - + + + 15/2/2005 - 11:9:13 + 15/2/2005 - 11:9:13 + 1.05 + ? + ? + Compute Node + 1058 + 8 + ? - ? - control_div2 - 8 - label_begin - + ? + control_div2 + 8 + label_begin + control_div2 - + long - N - + N + long - K - + K + long - MINT - + MINT + long - MAXT - + MAXT + double - AVERAGET - + AVERAGET + ListOfSyr - SYRLISTT - + SYRLISTT + long - NB - + NB + long - KB - + KB + long - MINB - + MINB + long - MAXB - + MAXB + double - AVERAGEB - + AVERAGEB + ListOfSyr - SYRLISTB - - + SYRLISTB + + control_div2 - - - 2/10/2003 - 11:36:18 - 2/10/2003 - 11:36:18 - 1.05 - ? - ? - ? - 1048 - 555 - + + + 15/2/2005 - 11:9:13 + 15/2/2005 - 11:9:13 + 1.05 + ? + ? + Compute Node + 1048 + 555 + test_ISEVEN - BoolEven - label_test - ValEven - + BoolEven + label_test + ValEven + -545 - 269 - -545 - 535 - +544 + 256 + +544 + 524 + test_ISONE - BoolOne - label_test - ValOne - + BoolOne + label_test + ValOne + 546 - 241 - -545 - 208 - + 237 + +546 + 198 + m3p1 - anEvenInteger - control_m3p1 - N - + anEvenInteger + control_m3p1 + N + -977 - 43 - +975 + 38 + 976 - 81 - + 81 + div2 - anInteger - control_div2 - N - + anInteger + control_div2 + N + +1012 + 585 + 1011 - 590 - -1010 - 357 - + 346 + incr - aNewCount - control_div2 - K - + aNewCount + control_div2 + K + -964 - 618 - 966 - 217 - + 606 + +968 + 207 + incr - aNewCount - control_m3p1 - K - + aNewCount + control_m3p1 + K + +965 + 59 + 966 - 70 - -966 - 216 - + 208 + incr - aNewCount - C_AVERAGE - aCount - + aNewCount + C_AVERAGE + aCount + -778 - 615 - -779 - 462 - +751 + 588 + +751 + 460 + 965 - 462 - -966 - 216 - + 462 + +968 + 205 + C_MIN - aNewMinVal - control_m3p1 - MINT - + aNewMinVal + control_m3p1 + MINT + 991 - 100 - + 78 + 991 - 913 - + 905 + C_MIN - aNewMinVal - control_div2 - MINT - + aNewMinVal + control_div2 + MINT + -990 - 646 - 991 - 912 - + 626 + +991 + 905 + C_MAX - aNewMaxVal - control_m3p1 - MAXT - + aNewMaxVal + control_m3p1 + MAXT + +976 + 98 + 974 - 130 - -974 - 747 - + 738 + C_MAX - aNewMaxVal - control_div2 - MAXT - + aNewMaxVal + control_div2 + MAXT + -973 - 676 - +972 + 648 + 974 - 747 - + 738 + C_AVERAGE - aNewListOfSyr - control_m3p1 - SYRLISTT - + aNewListOfSyr + control_m3p1 + SYRLISTT + 1037 - 188 - + 137 + 1038 - 556 - + 556 + C_AVERAGE - aNewListOfSyr - control_div2 - SYRLISTT - + aNewListOfSyr + control_div2 + SYRLISTT + 1038 - 735 - + 686 + 1038 - 555 - + 555 + C_AVERAGE - anAverage - control_m3p1 - AVERAGET - + anAverage + control_m3p1 + AVERAGET + -1027 - 158 - 1026 - 584 - + 118 + +1027 + 567 + C_AVERAGE - anAverage - control_div2 - AVERAGET - + anAverage + control_div2 + AVERAGET + 1027 - 706 - -1027 - 584 - + 668 + +1026 + 568 + C_LISTOFSYR - aListOfSyr - label_begin - SYRLISTB - - + aListOfSyr + label_begin + SYRLISTB + + label_begin - NT - test_ISONE - anInteger - + NT + test_ISONE + anInteger + -362 - 207 - -362 - 299 - +361 + 197 + +360 + 290 + label_begin - NT - label_test - NT - - + NT + label_test + NT + + label_begin - NT - test_ISEVEN - anInteger - + NT + test_ISEVEN + anInteger + +359 + 525 + 361 - 534 - -362 - 299 - + 291 + label_begin - KT - label_test - KT - - + KT + label_test + KT + + label_begin - MIN - label_test - MIN - - + MIN + label_test + MIN + + label_begin - MAX - label_test - MAX - - + MAX + label_test + MAX + + label_begin - AVERAGE - label_test - AVERAGE - - + AVERAGE + label_test + AVERAGE + + label_begin - SYRLIST - label_test - SYRLIST - - + SYRLIST + label_test + SYRLIST + + label_test - Finished - EndL_OneEven - Default - - -label_test - Incr - incr - InGate - - -779 - 250 - -780 - 269 - -label_test - Even - div2 - InGate - + Even + div2 + Gate + -780 - 387 - -779 - 299 - +777 + 351 + +777 + 286 + label_test - Odd - m3p1 - InGate - + Odd + m3p1 + Gate + -756 - 115 - -756 - 328 - +757 + 95 + +757 + 310 + label_test - N - m3p1 - anOddInteger - + N + m3p1 + anOddInteger + -740 - 80 - 741 - 356 - + 72 + +741 + 331 + label_test - N - div2 - anEvenInteger - - + N + div2 + anEvenInteger + + label_test - N - C_MIN - anInteger - + N + C_MIN + anInteger + -741 - 943 - -740 - 357 - +744 + 923 + +742 + 331 + label_test - N - C_MAX - anInteger - + N + C_MAX + anInteger + 742 - 778 - -741 - 359 - + 759 + +743 + 332 + label_test - N - C_AVERAGE - anInteger - + N + C_AVERAGE + anInteger + -742 - 584 - 741 - 357 - + 568 + +742 + 330 + label_test - K - incr - aCount - + K + incr + aCount + -765 - 217 - -764 - 385 - +766 + 207 + +766 + 343 + label_test - MINT - C_MIN - aMinVal - + MINT + C_MIN + aMinVal + -759 - 914 - -758 - 414 - +760 + 904 + +756 + 372 + label_test - MINT - EndL_OneEven - MIN - - + MINT + EndL_OneEven + MINT + + label_test - MAXT - C_MAX - aMaxVal - + MAXT + C_MAX + aMaxVal + -729 - 749 - -728 - 444 - +765 + 742 + +766 + 384 + label_test - MAXT - EndL_OneEven - MAX - - + MAXT + EndL_OneEven + MAXT + + label_test - AVERAGET - EndL_OneEven - AVERAGE - - + AVERAGET + EndL_OneEven + AVERAGET + + label_test - SYRLISTT - C_AVERAGE - aListOfSyr - + SYRLISTT + C_AVERAGE + aListOfSyr + -771 - 557 - -770 - 502 - +773 + 546 + +772 + 424 + +label_test + Default + EndL_OneEven + Default + + control_m3p1 - OutGate - label_test - InGate - + Gate + label_test + Gate + 553 - 536 - + 453 + 554 - 1025 - + 1025 + 1242 - 1026 - -1243 - 279 - + 1026 + +1234 + 204 + control_div2 - OutGate - label_begin - InGate - + Gate + label_begin + Gate + 176 - 476 - + 419 + 176 - 997 - + 997 + 1217 - 996 - -1218 - 768 - + 996 + +1223 + 711 + GraphSyrControlAve - label_begin\NB - label_begin - NB - + label_begin__NB + label_begin + NB + 3 - 31 - - + 31 + + GraphSyrControlAve - label_begin\KB - label_begin - KB - + label_begin__KB + label_begin + KB + 3 - 0 - - + 0 + + GraphSyrControlAve - label_begin\MINB - label_begin - MINB - + label_begin__MINB + label_begin + MINB + 3 - 0 - - + 0 + + GraphSyrControlAve - label_begin\MAXB - label_begin - MAXB - + label_begin__MAXB + label_begin + MAXB + 3 - 0 - - + 0 + + GraphSyrControlAve - label_begin\AVERAGEB - label_begin - AVERAGEB - + label_begin__AVERAGEB + label_begin + AVERAGEB + 7 - 0 - + 0 + diff --git a/examples/GraphSyrControlDefault.py b/examples/GraphSyrControlDefault.py index dfafc54..c99ba99 100644 --- a/examples/GraphSyrControlDefault.py +++ b/examples/GraphSyrControlDefault.py @@ -2,241 +2,271 @@ # Generated python file of Graph GraphSyrControlDefault from SuperV import * -# Graph creation -GraphSyrControlDefault = Graph( 'GraphSyrControlDefault' ) -GraphSyrControlDefault.SetName( 'GraphSyrControlDefault' ) -GraphSyrControlDefault.SetAuthor( 'JR' ) -GraphSyrControlDefault.SetComment( 'Syracuse algorithm' ) -GraphSyrControlDefault.Coords( 0 , 0 ) -# Creation of Factory Nodes - -test_ISEVEN = GraphSyrControlDefault.FNode( 'SyrComponent' , 'SyrComponent' , 'C_ISEVEN' ) -test_ISEVEN.SetName( 'test_ISEVEN' ) -test_ISEVEN.SetAuthor( '' ) -test_ISEVEN.SetContainer( 'localhost/FactoryServer' ) -test_ISEVEN.SetComment( 'C_ISEVEN from SyrComponent' ) -test_ISEVEN.Coords( 204 , 444 ) - -test_ISONE = GraphSyrControlDefault.FNode( 'SyrComponent' , 'SyrComponent' , 'C_ISONE' ) -test_ISONE.SetName( 'test_ISONE' ) -test_ISONE.SetAuthor( '' ) -test_ISONE.SetContainer( 'localhost/FactoryServer' ) -test_ISONE.SetComment( 'C_ISONE from SyrComponent' ) -test_ISONE.Coords( 201 , 52 ) - -m3p1 = GraphSyrControlDefault.FNode( 'SyrComponent' , 'SyrComponent' , 'C_M3P1' ) -m3p1.SetName( 'm3p1' ) -m3p1.SetAuthor( '' ) -m3p1.SetContainer( 'localhost/FactoryServer' ) -m3p1.SetComment( 'C_M3P1 from SyrComponent' ) -m3p1.Coords( 806 , 19 ) - -div2 = GraphSyrControlDefault.FNode( 'SyrComponent' , 'SyrComponent' , 'C_DIV2' ) -div2.SetName( 'div2' ) -div2.SetAuthor( '' ) -div2.SetContainer( 'localhost/FactoryServer' ) -div2.SetComment( 'C_DIV2 from SyrComponent' ) -div2.Coords( 803 , 451 ) - -incr = GraphSyrControlDefault.FNode( 'SyrComponent' , 'SyrComponent' , 'C_INCR' ) -incr.SetName( 'incr' ) -incr.SetAuthor( '' ) -incr.SetContainer( 'localhost/FactoryServer' ) -incr.SetComment( 'C_INCR from SyrComponent' ) -incr.Coords( 802 , 170 ) - -# Creation of InLine Nodes -Pylabel_begin = [] -Pylabel_begin.append( 'def label_begin( NB , KB ):' ) -Pylabel_begin.append( ' print "label_begin",NB,KB' ) -Pylabel_begin.append( ' return NB,KB' ) -label_begin = GraphSyrControlDefault.INode( 'label_begin' , Pylabel_begin ) -label_begin.SetName( 'label_begin' ) -label_begin.SetAuthor( '' ) -label_begin.SetComment( 'Python function' ) -label_begin.Coords( 12 , 264 ) -label_begin.InPort( 'NB' , 'long' ) -label_begin.InPort( 'KB' , 'long' ) - -Pylabel_test = [] -Pylabel_test.append( 'def label_test( ValEven , ValOne , NB , KB ):' ) -Pylabel_test.append( ' print "label_begin",ValEven,ValOne,NB,KB' ) -Pylabel_test.append( ' return ValEven,ValOne,NB,KB' ) -label_test = GraphSyrControlDefault.INode( 'label_test' , Pylabel_test ) -label_test.SetName( 'label_test' ) -label_test.SetAuthor( '' ) -label_test.SetComment( 'Python function' ) -label_test.Coords( 415 , 206 ) -label_test.InPort( 'ValEven' , 'long' ) -label_test.InPort( 'ValOne' , 'long' ) -label_test.InPort( 'NT' , 'long' ) -label_test.InPort( 'KT' , 'long' ) - -# Creation of Switch Nodes -Pytest = [] -Pytest.append( 'def Switch_OneEven( ValOne , ValEven , NT , KT ) :' ) -Pytest.append( ' Finished = ValOne' ) -Pytest.append( ' if Finished == 0 :' ) -Pytest.append( ' Incr = 1' ) -Pytest.append( ' Even = ValEven' ) -Pytest.append( ' if Even == 0 :' ) -Pytest.append( ' Odd = 1' ) -Pytest.append( ' else :' ) -Pytest.append( ' Odd = 0' ) -Pytest.append( ' else :' ) -Pytest.append( ' Incr = 0' ) -Pytest.append( ' Even = 0' ) -Pytest.append( ' Odd = 0' ) -Pytest.append( ' Even = ValEven' ) -Pytest.append( ' return Incr,Even,Odd,NT,KT' ) -test,EndSwitch_OneEven = GraphSyrControlDefault.SNode( 'Switch_OneEven' , Pytest ) -EndSwitch_OneEven.SetName( 'EndSwitch_OneEven' ) -EndSwitch_OneEven.SetAuthor( '' ) -EndSwitch_OneEven.SetComment( '' ) -EndSwitch_OneEven.Coords( 1074 , 367 ) -PyEndSwitch_OneEven = [] -EndSwitch_OneEven.SetPyFunction( 'EndSwitch_OneEven' , PyEndSwitch_OneEven ) -EndSwitch_OneEven.InPort( 'K' , 'long' ) -EndSwitch_OneEven.OutPort( 'K' , 'long' ) -test.SetName( 'test' ) -test.SetAuthor( '' ) -test.SetComment( '' ) -test.Coords( 597 , 251 ) -test.InPort( 'ValOne' , 'long' ) -test.InPort( 'ValEven' , 'long' ) -test.InPort( 'NT' , 'long' ) -test.InPort( 'KT' , 'long' ) - -# Creation of GOTO Nodes -Pycontrol_m3p1 = [] -Pycontrol_m3p1.append( 'def control_m3p1( N , K ):' ) -Pycontrol_m3p1.append( ' return 0,1,N,K' ) -control_m3p1 = GraphSyrControlDefault.GNode( 'control_m3p1' , Pycontrol_m3p1 , 'label_test' ) -control_m3p1.SetName( 'control_m3p1' ) -control_m3p1.SetAuthor( '' ) -control_m3p1.SetComment( '' ) -control_m3p1.Coords( 1002 , 64 ) -control_m3p1.InPort( 'N' , 'long' ) -control_m3p1.InPort( 'K' , 'long' ) - -Pycontrol_div2 = [] -Pycontrol_div2.append( 'def control_div2( N , NB ) :' ) -Pycontrol_div2.append( ' return N,NB' ) -control_div2 = GraphSyrControlDefault.GNode( 'control_div2' , Pycontrol_div2 , 'label_begin' ) -control_div2.SetName( 'control_div2' ) -control_div2.SetAuthor( '' ) -control_div2.SetComment( '' ) -control_div2.Coords( 1013 , 496 ) -control_div2.InPort( 'N' , 'long' ) -control_div2.InPort( 'K' , 'long' ) - -# Creation of Links -test_ISEVENBoolEven = test_ISEVEN.Port( 'BoolEven' ) -label_testValEven = GraphSyrControlDefault.Link( test_ISEVENBoolEven , label_test.Port( 'ValEven' ) ) -label_testValEven.AddCoord( 1 , 381 , 286 ) -label_testValEven.AddCoord( 2 , 382 , 524 ) - -test_ISONEBoolOne = test_ISONE.Port( 'BoolOne' ) -label_testValOne = GraphSyrControlDefault.Link( test_ISONEBoolOne , label_test.Port( 'ValOne' ) ) -label_testValOne.AddCoord( 1 , 393 , 314 ) -label_testValOne.AddCoord( 2 , 393 , 133 ) - -m3p1anEvenInteger = m3p1.Port( 'anEvenInteger' ) -control_m3p1N = GraphSyrControlDefault.Link( m3p1anEvenInteger , control_m3p1.Port( 'N' ) ) - -div2anInteger = div2.Port( 'anInteger' ) -control_div2N = GraphSyrControlDefault.Link( div2anInteger , control_div2.Port( 'N' ) ) - -incraNewCount = incr.Port( 'aNewCount' ) -control_m3p1K = GraphSyrControlDefault.Link( incraNewCount , control_m3p1.Port( 'K' ) ) -control_m3p1K.AddCoord( 1 , 985 , 128 ) -control_m3p1K.AddCoord( 2 , 985 , 250 ) - -control_div2K = GraphSyrControlDefault.Link( incraNewCount , control_div2.Port( 'K' ) ) -control_div2K.AddCoord( 1 , 987 , 559 ) -control_div2K.AddCoord( 2 , 985 , 250 ) - -label_beginNT = label_begin.Port( 'NT' ) -label_testNT = GraphSyrControlDefault.Link( label_beginNT , label_test.Port( 'NT' ) ) - -test_ISEVENanInteger = GraphSyrControlDefault.Link( label_beginNT , test_ISEVEN.Port( 'anInteger' ) ) -test_ISEVENanInteger.AddCoord( 1 , 191 , 524 ) -test_ISEVENanInteger.AddCoord( 2 , 192 , 345 ) - -test_ISONEanInteger = GraphSyrControlDefault.Link( label_beginNT , test_ISONE.Port( 'anInteger' ) ) -test_ISONEanInteger.AddCoord( 1 , 192 , 131 ) -test_ISONEanInteger.AddCoord( 2 , 193 , 345 ) - -label_beginKT = label_begin.Port( 'KT' ) -label_testKT = GraphSyrControlDefault.Link( label_beginKT , label_test.Port( 'KT' ) ) - -label_testValEven = label_test.Port( 'ValEven' ) -testValEven = GraphSyrControlDefault.Link( label_testValEven , test.Port( 'ValEven' ) ) - -label_testValOne = label_test.Port( 'ValOne' ) -testValOne = GraphSyrControlDefault.Link( label_testValOne , test.Port( 'ValOne' ) ) - -label_testNT = label_test.Port( 'NT' ) -testNT = GraphSyrControlDefault.Link( label_testNT , test.Port( 'NT' ) ) - -label_testKT = label_test.Port( 'KT' ) -testKT = GraphSyrControlDefault.Link( label_testKT , test.Port( 'KT' ) ) - -testIncr = test.Port( 'Incr' ) -incrInGate = GraphSyrControlDefault.Link( testIncr , incr.Port( 'InGate' ) ) - -testEven = test.Port( 'Even' ) -div2InGate = GraphSyrControlDefault.Link( testEven , div2.Port( 'InGate' ) ) -div2InGate.AddCoord( 1 , 793 , 567 ) -div2InGate.AddCoord( 2 , 792 , 314 ) - -testOdd = test.Port( 'Odd' ) -m3p1InGate = GraphSyrControlDefault.Link( testOdd , m3p1.Port( 'InGate' ) ) -m3p1InGate.AddCoord( 1 , 786 , 132 ) -m3p1InGate.AddCoord( 2 , 785 , 343 ) - -testN = test.Port( 'N' ) -m3p1anOddInteger = GraphSyrControlDefault.Link( testN , m3p1.Port( 'anOddInteger' ) ) -m3p1anOddInteger.AddCoord( 1 , 767 , 100 ) -m3p1anOddInteger.AddCoord( 2 , 767 , 371 ) - -div2anEvenInteger = GraphSyrControlDefault.Link( testN , div2.Port( 'anEvenInteger' ) ) -div2anEvenInteger.AddCoord( 1 , 768 , 531 ) -div2anEvenInteger.AddCoord( 2 , 767 , 371 ) - -testK = test.Port( 'K' ) -EndSwitch_OneEvenK = GraphSyrControlDefault.Link( testK , EndSwitch_OneEven.Port( 'K' ) ) - -incraCount = GraphSyrControlDefault.Link( testK , incr.Port( 'aCount' ) ) -incraCount.AddCoord( 1 , 773 , 251 ) -incraCount.AddCoord( 2 , 774 , 400 ) - -testDefault = test.Port( 'Default' ) -EndSwitch_OneEvenDefault = GraphSyrControlDefault.Link( testDefault , EndSwitch_OneEven.Port( 'Default' ) ) - -control_m3p1OutGate = control_m3p1.Port( 'OutGate' ) -label_testInGate = GraphSyrControlDefault.Link( control_m3p1OutGate , label_test.Port( 'InGate' ) ) -label_testInGate.AddCoord( 1 , 402 , 406 ) -label_testInGate.AddCoord( 2 , 403 , 4 ) -label_testInGate.AddCoord( 3 , 1174 , 5 ) -label_testInGate.AddCoord( 4 , 1175 , 219 ) - -control_div2OutGate = control_div2.Port( 'OutGate' ) -label_beginInGate = GraphSyrControlDefault.Link( control_div2OutGate , label_begin.Port( 'InGate' ) ) -label_beginInGate.AddCoord( 1 , 3 , 409 ) -label_beginInGate.AddCoord( 2 , 2 , 671 ) -label_beginInGate.AddCoord( 3 , 1199 , 670 ) -label_beginInGate.AddCoord( 4 , 1198 , 592 ) - -# Creation of Input datas -label_beginNB = label_begin.Input( 'NB' , 7) -label_beginKB = label_begin.Input( 'KB' , 0) - -# Creation of Output variables -EndSwitch_OneEvenK = EndSwitch_OneEven.Port( 'K' ) - -GraphSyrControlDefault.Run() -GraphSyrControlDefault.DoneW() -print GraphSyrControlDefault.State() -GraphSyrControlDefault.PrintPorts() +# Graph creation of GraphSyrControlDefault +def DefGraphSyrControlDefault() : + GraphSyrControlDefault = Graph( 'GraphSyrControlDefault' ) + GraphSyrControlDefault.SetName( 'GraphSyrControlDefault' ) + GraphSyrControlDefault.SetAuthor( 'JR' ) + GraphSyrControlDefault.SetComment( 'Syracuse algorithm' ) + GraphSyrControlDefault.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + test_ISEVEN = GraphSyrControlDefault.FNode( 'SyrComponent' , 'SyrComponent' , 'C_ISEVEN' ) + test_ISEVEN.SetName( 'test_ISEVEN' ) + test_ISEVEN.SetAuthor( '' ) + test_ISEVEN.SetContainer( 'localhost/FactoryServer' ) + test_ISEVEN.SetComment( 'C_ISEVEN from SyrComponent' ) + test_ISEVEN.Coords( 205 , 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 = GraphSyrControlDefault.FNode( 'SyrComponent' , 'SyrComponent' , 'C_ISONE' ) + test_ISONE.SetName( 'test_ISONE' ) + test_ISONE.SetAuthor( '' ) + test_ISONE.SetContainer( 'localhost/FactoryServer' ) + test_ISONE.SetComment( 'C_ISONE from SyrComponent' ) + test_ISONE.Coords( 211 , 61 ) + 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 = GraphSyrControlDefault.FNode( 'SyrComponent' , 'SyrComponent' , 'C_M3P1' ) + m3p1.SetName( 'm3p1' ) + m3p1.SetAuthor( '' ) + m3p1.SetContainer( 'localhost/FactoryServer' ) + m3p1.SetComment( 'C_M3P1 from SyrComponent' ) + m3p1.Coords( 806 , 19 ) + Im3p1anOddInteger = m3p1.GetInPort( 'anOddInteger' ) + Im3p1Gate = m3p1.GetInPort( 'Gate' ) + Om3p1anEvenInteger = m3p1.GetOutPort( 'anEvenInteger' ) + Om3p1Gate = m3p1.GetOutPort( 'Gate' ) + + div2 = GraphSyrControlDefault.FNode( 'SyrComponent' , 'SyrComponent' , 'C_DIV2' ) + div2.SetName( 'div2' ) + div2.SetAuthor( '' ) + div2.SetContainer( 'localhost/FactoryServer' ) + div2.SetComment( 'C_DIV2 from SyrComponent' ) + div2.Coords( 807 , 456 ) + Idiv2anEvenInteger = div2.GetInPort( 'anEvenInteger' ) + Idiv2Gate = div2.GetInPort( 'Gate' ) + Odiv2anInteger = div2.GetOutPort( 'anInteger' ) + Odiv2Gate = div2.GetOutPort( 'Gate' ) + + incr = GraphSyrControlDefault.FNode( 'SyrComponent' , 'SyrComponent' , 'C_INCR' ) + incr.SetName( 'incr' ) + incr.SetAuthor( '' ) + incr.SetContainer( 'localhost/FactoryServer' ) + incr.SetComment( 'C_INCR from SyrComponent' ) + incr.Coords( 802 , 170 ) + 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 = GraphSyrControlDefault.INode( 'label_begin' , Pylabel_begin ) + label_begin.SetName( 'label_begin' ) + label_begin.SetAuthor( '' ) + label_begin.SetComment( 'Python function' ) + label_begin.Coords( 15 , 246 ) + 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 = GraphSyrControlDefault.INode( 'label_test' , Pylabel_test ) + label_test.SetName( 'label_test' ) + label_test.SetAuthor( '' ) + label_test.SetComment( 'Python function' ) + label_test.Coords( 419 , 206 ) + 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 Incr,Even,Odd,NT,KT' ) + test,EndSwitch_OneEven = GraphSyrControlDefault.SNode( 'Switch_OneEven' , Pytest ) + EndSwitch_OneEven.SetName( 'EndSwitch_OneEven' ) + EndSwitch_OneEven.SetAuthor( '' ) + EndSwitch_OneEven.SetComment( 'Compute Node' ) + EndSwitch_OneEven.Coords( 1073 , 328 ) + PyEndSwitch_OneEven = [] + EndSwitch_OneEven.SetPyFunction( '' , PyEndSwitch_OneEven ) + IEndSwitch_OneEvenK = EndSwitch_OneEven.InPort( 'K' , 'long' ) + IEndSwitch_OneEvenDefault = EndSwitch_OneEven.GetInPort( 'Default' ) + OEndSwitch_OneEvenK = EndSwitch_OneEven.OutPort( 'K' , 'long' ) + OEndSwitch_OneEvenGate = EndSwitch_OneEven.GetOutPort( 'Gate' ) + test.SetName( 'test' ) + test.SetAuthor( '' ) + test.SetComment( 'Compute Node' ) + test.Coords( 600 , 247 ) + ItestValOne = test.InPort( 'ValOne' , 'long' ) + ItestValEven = test.InPort( 'ValEven' , 'long' ) + ItestNT = test.InPort( 'NT' , 'long' ) + ItestKT = test.InPort( 'KT' , 'long' ) + ItestGate = test.GetInPort( 'Gate' ) + 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 = GraphSyrControlDefault.GNode( 'control_m3p1' , Pycontrol_m3p1 , 'label_test' ) + control_m3p1.SetName( 'control_m3p1' ) + control_m3p1.SetAuthor( '' ) + control_m3p1.SetComment( 'Compute Node' ) + control_m3p1.Coords( 1002 , 59 ) + 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 = GraphSyrControlDefault.GNode( 'control_div2' , Pycontrol_div2 , 'label_begin' ) + control_div2.SetName( 'control_div2' ) + control_div2.SetAuthor( '' ) + control_div2.SetComment( 'Compute Node' ) + control_div2.Coords( 1013 , 496 ) + 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 = GraphSyrControlDefault.Link( Otest_ISEVENBoolEven , Ilabel_testValEven ) + Ltest_ISEVENBoolEvenlabel_testValEven.AddCoord( 1 , 382 , 277 ) + Ltest_ISEVENBoolEvenlabel_testValEven.AddCoord( 2 , 382 , 524 ) + + Ltest_ISONEBoolOnelabel_testValOne = GraphSyrControlDefault.Link( Otest_ISONEBoolOne , Ilabel_testValOne ) + Ltest_ISONEBoolOnelabel_testValOne.AddCoord( 1 , 394 , 299 ) + Ltest_ISONEBoolOnelabel_testValOne.AddCoord( 2 , 393 , 133 ) + + Lm3p1anEvenIntegercontrol_m3p1N = GraphSyrControlDefault.Link( Om3p1anEvenInteger , Icontrol_m3p1N ) + + Ldiv2anIntegercontrol_div2N = GraphSyrControlDefault.Link( Odiv2anInteger , Icontrol_div2N ) + + LincraNewCountcontrol_m3p1K = GraphSyrControlDefault.Link( OincraNewCount , Icontrol_m3p1K ) + LincraNewCountcontrol_m3p1K.AddCoord( 1 , 984 , 111 ) + LincraNewCountcontrol_m3p1K.AddCoord( 2 , 986 , 241 ) + + LincraNewCountcontrol_div2K = GraphSyrControlDefault.Link( OincraNewCount , Icontrol_div2K ) + LincraNewCountcontrol_div2K.AddCoord( 1 , 987 , 547 ) + LincraNewCountcontrol_div2K.AddCoord( 2 , 985 , 242 ) + + Llabel_beginNTlabel_testNT = GraphSyrControlDefault.Link( Olabel_beginNT , Ilabel_testNT ) + + Llabel_beginNTtest_ISEVENanInteger = GraphSyrControlDefault.Link( Olabel_beginNT , Itest_ISEVENanInteger ) + Llabel_beginNTtest_ISEVENanInteger.AddCoord( 1 , 191 , 524 ) + Llabel_beginNTtest_ISEVENanInteger.AddCoord( 2 , 193 , 317 ) + + Llabel_beginNTtest_ISONEanInteger = GraphSyrControlDefault.Link( Olabel_beginNT , Itest_ISONEanInteger ) + Llabel_beginNTtest_ISONEanInteger.AddCoord( 1 , 192 , 131 ) + Llabel_beginNTtest_ISONEanInteger.AddCoord( 2 , 194 , 317 ) + + Llabel_beginKTlabel_testKT = GraphSyrControlDefault.Link( Olabel_beginKT , Ilabel_testKT ) + + Llabel_testValEventestValEven = GraphSyrControlDefault.Link( Olabel_testValEven , ItestValEven ) + + Llabel_testValOnetestValOne = GraphSyrControlDefault.Link( Olabel_testValOne , ItestValOne ) + + Llabel_testNTtestNT = GraphSyrControlDefault.Link( Olabel_testNT , ItestNT ) + + Llabel_testKTtestKT = GraphSyrControlDefault.Link( Olabel_testKT , ItestKT ) + + LtestEvendiv2Gate = GraphSyrControlDefault.Link( OtestEven , Idiv2Gate ) + LtestEvendiv2Gate.AddCoord( 1 , 798 , 551 ) + LtestEvendiv2Gate.AddCoord( 2 , 797 , 299 ) + + LtestOddm3p1Gate = GraphSyrControlDefault.Link( OtestOdd , Im3p1Gate ) + LtestOddm3p1Gate.AddCoord( 1 , 788 , 115 ) + LtestOddm3p1Gate.AddCoord( 2 , 789 , 318 ) + + LtestNm3p1anOddInteger = GraphSyrControlDefault.Link( OtestN , Im3p1anOddInteger ) + LtestNm3p1anOddInteger.AddCoord( 1 , 780 , 90 ) + LtestNm3p1anOddInteger.AddCoord( 2 , 781 , 339 ) + + LtestNdiv2anEvenInteger = GraphSyrControlDefault.Link( OtestN , Idiv2anEvenInteger ) + LtestNdiv2anEvenInteger.AddCoord( 1 , 783 , 528 ) + LtestNdiv2anEvenInteger.AddCoord( 2 , 781 , 339 ) + + LtestKEndSwitch_OneEvenK = GraphSyrControlDefault.Link( OtestK , IEndSwitch_OneEvenK ) + + LtestKincraCount = GraphSyrControlDefault.Link( OtestK , IincraCount ) + LtestKincraCount.AddCoord( 1 , 771 , 239 ) + LtestKincraCount.AddCoord( 2 , 771 , 358 ) + + LtestDefaultEndSwitch_OneEvenDefault = GraphSyrControlDefault.Link( OtestDefault , IEndSwitch_OneEvenDefault ) + + Lcontrol_m3p1Gatelabel_testGate = GraphSyrControlDefault.Link( Ocontrol_m3p1Gate , Ilabel_testGate ) + Lcontrol_m3p1Gatelabel_testGate.AddCoord( 1 , 402 , 361 ) + Lcontrol_m3p1Gatelabel_testGate.AddCoord( 2 , 403 , 4 ) + Lcontrol_m3p1Gatelabel_testGate.AddCoord( 3 , 1174 , 5 ) + Lcontrol_m3p1Gatelabel_testGate.AddCoord( 4 , 1179 , 172 ) + + Lcontrol_div2Gatelabel_beginGate = GraphSyrControlDefault.Link( Ocontrol_div2Gate , Ilabel_beginGate ) + Lcontrol_div2Gatelabel_beginGate.AddCoord( 1 , 2 , 361 ) + Lcontrol_div2Gatelabel_beginGate.AddCoord( 2 , 2 , 671 ) + Lcontrol_div2Gatelabel_beginGate.AddCoord( 3 , 1199 , 670 ) + Lcontrol_div2Gatelabel_beginGate.AddCoord( 4 , 1198 , 571 ) + + # Input datas + Ilabel_beginNB.Input( 7 ) + Ilabel_beginKB.Input( 0 ) + + # Output Ports of the graph + #OtestIncr = test.GetOutPort( 'Incr' ) + #OEndSwitch_OneEvenK = EndSwitch_OneEven.GetOutPort( 'K' ) + return GraphSyrControlDefault + + +GraphSyrControlDefault = DefGraphSyrControlDefault() diff --git a/examples/GraphSyrControlDefault.xml b/examples/GraphSyrControlDefault.xml index 8cf9d4d..678abcb 100644 --- a/examples/GraphSyrControlDefault.xml +++ b/examples/GraphSyrControlDefault.xml @@ -1,674 +1,672 @@ - + + ? - ? - GraphSyrControlDefault - 1 - ? - + ? + GraphSyrControlDefault + 1 + ? + GraphSyrControlDefault - + long - label_begin\NB - + label_begin__NB + long - label_begin\KB - + label_begin__KB + long - EndSwitch_OneEven\K - - - 19/3/2003 - 16:49:51 - 18/3/2004 - 13:59:54 - 1.04 - JR - ? - Syracuse algorithm - 0 - 0 - + test__Incr + +long + EndSwitch_OneEven__K + + + 19/3/2003 - 16:49:51 + 14/2/2005 - 14:45:10 + 1.04 + JR + ? + Syracuse algorithm + 0 + 0 + SyrComponent - SyrComponent - test_ISEVEN - 0 - ? - + SyrComponent + test_ISEVEN + 0 + ? + C_ISEVEN - + long - anInteger - + anInteger + long - BoolEven - - - 18/3/2004 - 13:59:54 - 18/3/2004 - 13:59:54 - 1.04 - ? - localhost/FactoryServer - C_ISEVEN from SyrComponent - 204 - 444 - + BoolEven + + + 14/2/2005 - 14:45:10 + 14/2/2005 - 14:45:10 + 1.04 + ? + localhost/FactoryServer + C_ISEVEN from SyrComponent + 205 + 455 + SyrComponent - SyrComponent - test_ISONE - 0 - ? - + SyrComponent + test_ISONE + 0 + ? + C_ISONE - + long - anInteger - + anInteger + long - BoolOne - - - 18/3/2004 - 13:59:54 - 18/3/2004 - 13:59:54 - 1.04 - ? - localhost/FactoryServer - C_ISONE from SyrComponent - 201 - 52 - + BoolOne + + + 14/2/2005 - 14:45:10 + 14/2/2005 - 14:45:10 + 1.04 + ? + localhost/FactoryServer + C_ISONE from SyrComponent + 211 + 61 + SyrComponent - SyrComponent - m3p1 - 0 - ? - + SyrComponent + m3p1 + 0 + ? + C_M3P1 - + long - anOddInteger - + anOddInteger + long - anEvenInteger - - - 18/3/2004 - 13:59:54 - 18/3/2004 - 13:59:54 - 1.04 - ? - localhost/FactoryServer - C_M3P1 from SyrComponent - 806 - 19 - + anEvenInteger + + + 14/2/2005 - 14:45:10 + 14/2/2005 - 14:45:10 + 1.04 + ? + localhost/FactoryServer + C_M3P1 from SyrComponent + 806 + 19 + SyrComponent - SyrComponent - div2 - 0 - ? - + SyrComponent + div2 + 0 + ? + C_DIV2 - + long - anEvenInteger - + anEvenInteger + long - anInteger - - - 18/3/2004 - 13:59:54 - 18/3/2004 - 13:59:54 - 1.04 - ? - localhost/FactoryServer - C_DIV2 from SyrComponent - 803 - 451 - + anInteger + + + 14/2/2005 - 14:45:10 + 14/2/2005 - 14:45:10 + 1.04 + ? + localhost/FactoryServer + C_DIV2 from SyrComponent + 807 + 456 + SyrComponent - SyrComponent - incr - 0 - ? - + SyrComponent + incr + 0 + ? + C_INCR - + long - aCount - + aCount + long - aNewCount - - - 18/3/2004 - 13:59:54 - 18/3/2004 - 13:59:54 - 1.04 - ? - localhost/FactoryServer - C_INCR from SyrComponent - 802 - 170 - + aNewCount + + + 14/2/2005 - 14:45:10 + 14/2/2005 - 14:45:10 + 1.04 + ? + localhost/FactoryServer + C_INCR from SyrComponent + 802 + 170 + ? - ? - label_begin - 3 - ? - + ? + label_begin + 3 + ? + label_begin - + long - NB - + NB + long - KB - + KB + long - NT - + NT + long - KT - - + KT + + label_begin - - - - 18/3/2004 - 13:59:54 - 18/3/2004 - 13:59:54 - 1.04 - ? - ? - Python function - 12 - 264 - + + + + 14/2/2005 - 14:45:10 + 14/2/2005 - 14:45:10 + 1.04 + ? + ? + Python function + 15 + 246 + ? - ? - label_test - 3 - ? - + ? + label_test + 3 + ? + label_test - + long - ValEven - + ValEven + long - ValOne - + ValOne + long - NT - + NT + long - KT - + KT + long - ValEven - + ValEven + long - ValOne - + ValOne + long - NT - + NT + long - KT - - + KT + + label_test - - - - 18/3/2004 - 13:59:54 - 18/3/2004 - 13:59:54 - 1.04 - ? - ? - Python function - 415 - 206 - + + + + 14/2/2005 - 14:45:10 + 14/2/2005 - 14:45:10 + 1.04 + ? + ? + Python function + 419 + 206 + ? - ? - test - 6 - EndSwitch_OneEven - + ? + test + 6 + EndSwitch_OneEven + test - + long - ValOne - + ValOne + long - ValEven - + ValEven + long - NT - + NT + long - KT - + KT + long - Incr - + Incr + long - Even - + Even + long - Odd - + Odd + long - N - + N + long - K - - + K + + Switch_OneEven - - - - - - - - - - - - - - - - 18/3/2004 - 13:59:54 - 18/3/2004 - 13:59:54 - 1.04 - ? - ? - ? - 597 - 251 - + + + + + + + + + + + + + + + + 14/2/2005 - 14:45:10 + 14/2/2005 - 14:45:10 + 1.04 + ? + ? + Compute Node + 600 + 247 + ? - ? - EndSwitch_OneEven - 7 - test - + ? + EndSwitch_OneEven + 7 + test + EndSwitch_OneEven - + long - K - + K + long - K - - + K + + ? - - 18/3/2004 - 13:59:54 - 18/3/2004 - 13:59:54 - 1.04 - ? - ? - ? - 1074 - 367 - + + 14/2/2005 - 14:45:10 + 14/2/2005 - 14:45:10 + 1.04 + ? + ? + Compute Node + 1073 + 328 + ? - ? - control_m3p1 - 8 - label_test - + ? + control_m3p1 + 8 + label_test + control_m3p1 - + long - N - + N + long - K - + K + long - ValOne - + ValOne + long - ValEven - + ValEven + long - NT - + NT + long - KT - - + KT + + control_m3p1 - - - 18/3/2004 - 13:59:54 - 18/3/2004 - 13:59:54 - 1.04 - ? - ? - ? - 1002 - 64 - + + + 14/2/2005 - 14:45:10 + 14/2/2005 - 14:45:10 + 1.04 + ? + ? + Compute Node + 1002 + 59 + ? - ? - control_div2 - 8 - label_begin - + ? + control_div2 + 8 + label_begin + control_div2 - + long - N - + N + long - K - + K + long - NB - + NB + long - KB - - + KB + + control_div2 - - - 18/3/2004 - 13:59:54 - 18/3/2004 - 13:59:54 - 1.04 - ? - ? - ? - 1013 - 496 - + + + 14/2/2005 - 14:45:10 + 14/2/2005 - 14:45:10 + 1.04 + ? + ? + Compute Node + 1013 + 496 + test_ISEVEN - BoolEven - label_test - ValEven - + BoolEven + label_test + ValEven + -381 - 286 - 382 - 524 - + 277 + +382 + 524 + test_ISONE - BoolOne - label_test - ValOne - + BoolOne + label_test + ValOne + +394 + 299 + 393 - 314 - -393 - 133 - + 133 + m3p1 - anEvenInteger - control_m3p1 - N - - + anEvenInteger + control_m3p1 + N + + div2 - anInteger - control_div2 - N - - + anInteger + control_div2 + N + + incr - aNewCount - control_m3p1 - K - + aNewCount + control_m3p1 + K + -985 - 128 - -985 - 250 - +984 + 111 + +986 + 241 + incr - aNewCount - control_div2 - K - + aNewCount + control_div2 + K + 987 - 559 - + 547 + 985 - 250 - + 242 + label_begin - NT - label_test - NT - - + NT + label_test + NT + + label_begin - NT - test_ISEVEN - anInteger - + NT + test_ISEVEN + anInteger + 191 - 524 - -192 - 345 - + 524 + +193 + 317 + label_begin - NT - test_ISONE - anInteger - + NT + test_ISONE + anInteger + 192 - 131 - -193 - 345 - + 131 + +194 + 317 + label_begin - KT - label_test - KT - - + KT + label_test + KT + + label_test - ValEven - test - ValEven - - + ValEven + test + ValEven + + label_test - ValOne - test - ValOne - - + ValOne + test + ValOne + + label_test - NT - test - NT - - + NT + test + NT + + label_test - KT - test - KT - - + KT + test + KT + + test - Incr - incr - InGate - - -test - Even - div2 - InGate - + Even + div2 + Gate + -793 - 567 - -792 - 314 - +798 + 551 + +797 + 299 + test - Odd - m3p1 - InGate - + Odd + m3p1 + Gate + -786 - 132 - -785 - 343 - +788 + 115 + +789 + 318 + test - N - m3p1 - anOddInteger - + N + m3p1 + anOddInteger + -767 - 100 - -767 - 371 - +780 + 90 + +781 + 339 + test - N - div2 - anEvenInteger - + N + div2 + anEvenInteger + -768 - 531 - -767 - 371 - +783 + 528 + +781 + 339 + test - K - EndSwitch_OneEven - K - - + K + EndSwitch_OneEven + K + + test - K - incr - aCount - + K + incr + aCount + -773 - 251 - -774 - 400 - +771 + 239 + +771 + 358 + test - Default - EndSwitch_OneEven - Default - - + Default + EndSwitch_OneEven + Default + + control_m3p1 - OutGate - label_test - InGate - + Gate + label_test + Gate + 402 - 406 - + 361 + 403 - 4 - + 4 + 1174 - 5 - -1175 - 219 - + 5 + +1179 + 172 + control_div2 - OutGate - label_begin - InGate - + Gate + label_begin + Gate + -3 - 409 - 2 - 671 - + 361 + +2 + 671 + 1199 - 670 - + 670 + 1198 - 592 - + 571 + GraphSyrControlDefault - label_begin\NB - label_begin - NB - + label_begin__NB + label_begin + NB + 3 - 7 - - + 7 + + GraphSyrControlDefault - label_begin\KB - label_begin - KB - + label_begin__KB + label_begin + KB + 3 - 0 - + 0 + diff --git a/examples/GraphSyrControlGUI.py b/examples/GraphSyrControlGUI.py index c8ce801..fd493c0 100644 --- a/examples/GraphSyrControlGUI.py +++ b/examples/GraphSyrControlGUI.py @@ -1,215 +1,242 @@ -# Generated python file of Graph GraphSyrControlGUI +# Generated python file of Graph GraphSyrControlGUI_2 from SuperV import * -# Graph creation -GraphSyrControlGUI = Graph( 'GraphSyrControlGUI' ) -GraphSyrControlGUI.SetName( 'GraphSyrControlGUI' ) -GraphSyrControlGUI.SetAuthor( 'JR' ) -GraphSyrControlGUI.SetComment( 'Syracuse algorithm' ) -GraphSyrControlGUI.Coords( 0 , 0 ) -# Creation of Factory Nodes - -test_ISEVEN = GraphSyrControlGUI.FNode( 'SyrComponent' , 'SyrComponent' , 'C_ISEVEN' ) -test_ISEVEN.SetName( 'test_ISEVEN' ) -test_ISEVEN.SetAuthor( '' ) -test_ISEVEN.SetContainer( 'localhost/FactoryServer' ) -test_ISEVEN.SetComment( 'C_ISEVEN from SyrComponent' ) -test_ISEVEN.Coords( 288 , 337 ) - -test_ISONE = GraphSyrControlGUI.FNode( 'SyrComponent' , 'SyrComponent' , 'C_ISONE' ) -test_ISONE.SetName( 'test_ISONE' ) -test_ISONE.SetAuthor( '' ) -test_ISONE.SetContainer( 'localhost/FactoryServer' ) -test_ISONE.SetComment( 'C_ISONE from SyrComponent' ) -test_ISONE.Coords( 293 , 130 ) - -m3p1 = GraphSyrControlGUI.FNode( 'SyrComponent' , 'SyrComponent' , 'C_M3P1' ) -m3p1.SetName( 'm3p1' ) -m3p1.SetAuthor( '' ) -m3p1.SetContainer( 'localhost/FactoryServer' ) -m3p1.SetComment( 'C_M3P1 from SyrComponent' ) -m3p1.Coords( 761 , 19 ) - -div2 = GraphSyrControlGUI.FNode( 'SyrComponent' , 'SyrComponent' , 'C_DIV2' ) -div2.SetName( 'div2' ) -div2.SetAuthor( '' ) -div2.SetContainer( 'localhost/FactoryServer' ) -div2.SetComment( 'C_DIV2 from SyrComponent' ) -div2.Coords( 770 , 384 ) - -incr = GraphSyrControlGUI.FNode( 'SyrComponent' , 'SyrComponent' , 'C_INCR' ) -incr.SetName( 'incr' ) -incr.SetAuthor( '' ) -incr.SetContainer( 'localhost/FactoryServer' ) -incr.SetComment( 'C_INCR from SyrComponent' ) -incr.Coords( 764 , 179 ) - -# Creation of InLine Nodes -Pylabel_begin = [] -Pylabel_begin.append( 'def label_begin( NB , KB ) :' ) -Pylabel_begin.append( ' return NB,KB' ) -label_begin = GraphSyrControlGUI.INode( 'label_begin' , Pylabel_begin ) -label_begin.SetName( 'label_begin' ) -label_begin.SetAuthor( '' ) -label_begin.SetComment( 'Python function' ) -label_begin.Coords( 58 , 189 ) -label_begin.InPort( 'NB' , 'long' ) -label_begin.InPort( 'KB' , 'long' ) - -# Creation of Switch Nodes -Pylabel_test = [] -Pylabel_test.append( 'def L_OneEven( ValOne , ValEven , NT , KT ):' ) -Pylabel_test.append( ' Finished = ValOne' ) -Pylabel_test.append( ' if Finished == 0 :' ) -Pylabel_test.append( ' Incr = 1' ) -Pylabel_test.append( ' Even = ValEven' ) -Pylabel_test.append( ' if Even == 0 :' ) -Pylabel_test.append( ' Odd = 1' ) -Pylabel_test.append( ' else :' ) -Pylabel_test.append( ' Odd = 0' ) -Pylabel_test.append( ' else :' ) -Pylabel_test.append( ' Incr = 0' ) -Pylabel_test.append( ' Even = 0' ) -Pylabel_test.append( ' Odd = 0' ) -Pylabel_test.append( ' Even = ValEven' ) -Pylabel_test.append( ' return Finished,Incr,Even,Odd,NT,KT' ) -label_test,EndL_OneEven = GraphSyrControlGUI.SNode( 'L_OneEven' , Pylabel_test ) -EndL_OneEven.SetName( 'EndL_OneEven' ) -EndL_OneEven.SetAuthor( '' ) -EndL_OneEven.SetComment( '' ) -EndL_OneEven.Coords( 1068 , 258 ) -PyEndL_OneEven = [] -EndL_OneEven.SetPyFunction( 'EndL_OneEven' , PyEndL_OneEven ) -label_test.SetName( 'label_test' ) -label_test.SetAuthor( '' ) -label_test.SetComment( '' ) -label_test.Coords( 516 , 175 ) -label_test.InPort( 'ValOne' , 'long' ) -label_test.InPort( 'ValEven' , 'long' ) -label_test.InPort( 'NT' , 'long' ) -label_test.InPort( 'KT' , 'long' ) - -# Creation of GOTO Nodes -Pycontrol_m3p1 = [] -Pycontrol_m3p1.append( 'def C_NotOneIsEven( N , K ):' ) -Pycontrol_m3p1.append( ' return 0,1,N,K' ) -control_m3p1 = GraphSyrControlGUI.GNode( 'C_NotOneIsEven' , Pycontrol_m3p1 , 'label_test' ) -control_m3p1.SetName( 'control_m3p1' ) -control_m3p1.SetAuthor( '' ) -control_m3p1.SetComment( '' ) -control_m3p1.Coords( 972 , 64 ) -control_m3p1.InPort( 'N' , 'long' ) -control_m3p1.InPort( 'K' , 'long' ) - -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.SetName( 'control_div2' ) -control_div2.SetAuthor( '' ) -control_div2.SetComment( '' ) -control_div2.Coords( 972 , 430 ) -control_div2.InPort( 'N' , 'long' ) -control_div2.InPort( 'K' , 'long' ) - -# Creation of Links -test_ISEVENBoolEven = test_ISEVEN.Port( 'BoolEven' ) -label_testValEven = GraphSyrControlGUI.Link( test_ISEVENBoolEven , label_test.Port( 'ValEven' ) ) -label_testValEven.AddCoord( 1 , 493 , 238 ) -label_testValEven.AddCoord( 2 , 493 , 418 ) - -test_ISONEBoolOne = test_ISONE.Port( 'BoolOne' ) -label_testValOne = GraphSyrControlGUI.Link( test_ISONEBoolOne , label_test.Port( 'ValOne' ) ) - -m3p1anEvenInteger = m3p1.Port( 'anEvenInteger' ) -control_m3p1N = GraphSyrControlGUI.Link( m3p1anEvenInteger , control_m3p1.Port( 'N' ) ) - -div2anInteger = div2.Port( 'anInteger' ) -control_div2N = GraphSyrControlGUI.Link( div2anInteger , control_div2.Port( 'N' ) ) - -incraNewCount = incr.Port( 'aNewCount' ) -control_div2K = GraphSyrControlGUI.Link( incraNewCount , control_div2.Port( 'K' ) ) -control_div2K.AddCoord( 1 , 954 , 494 ) -control_div2K.AddCoord( 2 , 954 , 259 ) - -control_m3p1K = GraphSyrControlGUI.Link( incraNewCount , control_m3p1.Port( 'K' ) ) -control_m3p1K.AddCoord( 1 , 955 , 128 ) -control_m3p1K.AddCoord( 2 , 954 , 258 ) - -label_beginNT = label_begin.Port( 'NT' ) -test_ISONEanInteger = GraphSyrControlGUI.Link( label_beginNT , test_ISONE.Port( 'anInteger' ) ) -test_ISONEanInteger.AddCoord( 1 , 275 , 211 ) -test_ISONEanInteger.AddCoord( 2 , 275 , 270 ) - -label_testNT = GraphSyrControlGUI.Link( label_beginNT , label_test.Port( 'NT' ) ) - -test_ISEVENanInteger = GraphSyrControlGUI.Link( label_beginNT , test_ISEVEN.Port( 'anInteger' ) ) -test_ISEVENanInteger.AddCoord( 1 , 274 , 417 ) -test_ISEVENanInteger.AddCoord( 2 , 275 , 270 ) - -label_beginKT = label_begin.Port( 'KT' ) -label_testKT = GraphSyrControlGUI.Link( label_beginKT , label_test.Port( 'KT' ) ) -label_testKT.AddCoord( 1 , 476 , 294 ) -label_testKT.AddCoord( 2 , 475 , 515 ) -label_testKT.AddCoord( 3 , 260 , 515 ) -label_testKT.AddCoord( 4 , 260 , 298 ) - -label_testIncr = label_test.Port( 'Incr' ) -incrInGate = GraphSyrControlGUI.Link( label_testIncr , incr.Port( 'InGate' ) ) -incrInGate.AddCoord( 1 , 712 , 292 ) -incrInGate.AddCoord( 2 , 711 , 238 ) - -label_testEven = label_test.Port( 'Even' ) -div2InGate = GraphSyrControlGUI.Link( label_testEven , div2.Port( 'InGate' ) ) -div2InGate.AddCoord( 1 , 724 , 498 ) -div2InGate.AddCoord( 2 , 723 , 268 ) - -label_testOdd = label_test.Port( 'Odd' ) -m3p1InGate = GraphSyrControlGUI.Link( label_testOdd , m3p1.Port( 'InGate' ) ) -m3p1InGate.AddCoord( 1 , 698 , 132 ) -m3p1InGate.AddCoord( 2 , 697 , 297 ) - -label_testN = label_test.Port( 'N' ) -m3p1anOddInteger = GraphSyrControlGUI.Link( label_testN , m3p1.Port( 'anOddInteger' ) ) -m3p1anOddInteger.AddCoord( 1 , 748 , 100 ) -m3p1anOddInteger.AddCoord( 2 , 747 , 325 ) - -div2anEvenInteger = GraphSyrControlGUI.Link( label_testN , div2.Port( 'anEvenInteger' ) ) -div2anEvenInteger.AddCoord( 1 , 746 , 463 ) -div2anEvenInteger.AddCoord( 2 , 747 , 327 ) - -label_testK = label_test.Port( 'K' ) -incraCount = GraphSyrControlGUI.Link( label_testK , incr.Port( 'aCount' ) ) -incraCount.AddCoord( 1 , 732 , 260 ) -incraCount.AddCoord( 2 , 732 , 354 ) - -label_testDefault = label_test.Port( 'Default' ) -EndL_OneEvenDefault = GraphSyrControlGUI.Link( label_testDefault , EndL_OneEven.Port( 'Default' ) ) - -control_m3p1OutGate = control_m3p1.Port( 'OutGate' ) -label_testInGate = GraphSyrControlGUI.Link( control_m3p1OutGate , label_test.Port( 'InGate' ) ) -label_testInGate.AddCoord( 1 , 503 , 388 ) -label_testInGate.AddCoord( 2 , 505 , 5 ) -label_testInGate.AddCoord( 3 , 1149 , 5 ) -label_testInGate.AddCoord( 4 , 1150 , 219 ) - -control_div2OutGate = control_div2.Port( 'OutGate' ) -label_beginInGate = GraphSyrControlGUI.Link( control_div2OutGate , label_begin.Port( 'InGate' ) ) -label_beginInGate.AddCoord( 1 , 34 , 332 ) -label_beginInGate.AddCoord( 2 , 34 , 592 ) -label_beginInGate.AddCoord( 3 , 1145 , 586 ) -label_beginInGate.AddCoord( 4 , 1144 , 527 ) - -# Creation of Input datas -label_beginNB = label_begin.Input( 'NB' , 7) -label_beginKB = label_begin.Input( 'KB' , 0) - -# Creation of Output variables -label_testFinished = label_test.Port( 'Finished' ) - -GraphSyrControlGUI.Run() -GraphSyrControlGUI.DoneW() -print GraphSyrControlGUI.State() -GraphSyrControlGUI.PrintPorts() +# Graph creation of GraphSyrControlGUI_2 +def DefGraphSyrControlGUI_2() : + GraphSyrControlGUI_2 = Graph( 'GraphSyrControlGUI_2' ) + GraphSyrControlGUI_2.SetName( 'GraphSyrControlGUI_2' ) + GraphSyrControlGUI_2.SetAuthor( 'JR' ) + GraphSyrControlGUI_2.SetComment( 'Syracuse algorithm' ) + GraphSyrControlGUI_2.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + test_ISEVEN = GraphSyrControlGUI_2.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( 288 , 337 ) + 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 = GraphSyrControlGUI_2.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( 293 , 130 ) + 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 = GraphSyrControlGUI_2.FNode( 'SyrComponent' , 'SyrComponent' , 'C_M3P1' ) + m3p1.SetName( 'm3p1' ) + m3p1.SetAuthor( '' ) + m3p1.SetContainer( 'localhost/FactoryServer' ) + m3p1.SetComment( 'C_M3P1 from SyrComponent' ) + m3p1.Coords( 761 , 19 ) + Im3p1anOddInteger = m3p1.GetInPort( 'anOddInteger' ) + Im3p1Gate = m3p1.GetInPort( 'Gate' ) + Om3p1anEvenInteger = m3p1.GetOutPort( 'anEvenInteger' ) + Om3p1Gate = m3p1.GetOutPort( 'Gate' ) + + div2 = GraphSyrControlGUI_2.FNode( 'SyrComponent' , 'SyrComponent' , 'C_DIV2' ) + div2.SetName( 'div2' ) + div2.SetAuthor( '' ) + div2.SetContainer( 'localhost/FactoryServer' ) + div2.SetComment( 'C_DIV2 from SyrComponent' ) + div2.Coords( 770 , 384 ) + Idiv2anEvenInteger = div2.GetInPort( 'anEvenInteger' ) + Idiv2Gate = div2.GetInPort( 'Gate' ) + Odiv2anInteger = div2.GetOutPort( 'anInteger' ) + Odiv2Gate = div2.GetOutPort( 'Gate' ) + + incr = GraphSyrControlGUI_2.FNode( 'SyrComponent' , 'SyrComponent' , 'C_INCR' ) + incr.SetName( 'incr' ) + incr.SetAuthor( '' ) + incr.SetContainer( 'localhost/FactoryServer' ) + incr.SetComment( 'C_INCR from SyrComponent' ) + incr.Coords( 764 , 179 ) + 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( ' return NB,KB' ) + label_begin = GraphSyrControlGUI_2.INode( 'label_begin' , Pylabel_begin ) + label_begin.SetName( 'label_begin' ) + label_begin.SetAuthor( '' ) + label_begin.SetComment( 'Python function' ) + label_begin.Coords( 58 , 189 ) + 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' ) + + # Creation of Switch Nodes + Pylabel_test = [] + Pylabel_test.append( 'def L_OneEven( ValOne , ValEven , NT , KT ):' ) + Pylabel_test.append( ' Finished = ValOne' ) + Pylabel_test.append( ' if Finished == 0 :' ) + Pylabel_test.append( ' Incr = 1' ) + Pylabel_test.append( ' Even = ValEven' ) + Pylabel_test.append( ' if Even == 0 :' ) + Pylabel_test.append( ' Odd = 1' ) + Pylabel_test.append( ' else :' ) + Pylabel_test.append( ' Odd = 0' ) + Pylabel_test.append( ' else :' ) + Pylabel_test.append( ' Incr = 0' ) + Pylabel_test.append( ' Even = 0' ) + Pylabel_test.append( ' Odd = 0' ) + Pylabel_test.append( ' Even = ValEven' ) + Pylabel_test.append( ' return Finished,Incr,Even,Odd,NT,KT' ) + label_test,EndL_OneEven = GraphSyrControlGUI_2.SNode( 'L_OneEven' , Pylabel_test ) + EndL_OneEven.SetName( 'EndL_OneEven' ) + EndL_OneEven.SetAuthor( '' ) + EndL_OneEven.SetComment( 'Compute Node' ) + EndL_OneEven.Coords( 1068 , 258 ) + PyEndL_OneEven = [] + EndL_OneEven.SetPyFunction( '' , PyEndL_OneEven ) + IEndL_OneEvenDefault = EndL_OneEven.GetInPort( 'Default' ) + OEndL_OneEvenGate = EndL_OneEven.GetOutPort( 'Gate' ) + label_test.SetName( 'label_test' ) + label_test.SetAuthor( '' ) + label_test.SetComment( 'Compute Node' ) + label_test.Coords( 516 , 175 ) + 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_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_testDefault = label_test.GetOutPort( 'Default' ) + + # Creation of GOTO Nodes + Pycontrol_m3p1 = [] + Pycontrol_m3p1.append( 'def C_NotOneIsEven( N , K ):' ) + Pycontrol_m3p1.append( ' return 0,1,N,K' ) + control_m3p1 = GraphSyrControlGUI_2.GNode( 'C_NotOneIsEven' , Pycontrol_m3p1 , 'label_test' ) + control_m3p1.SetName( 'control_m3p1' ) + control_m3p1.SetAuthor( '' ) + control_m3p1.SetComment( 'Compute Node' ) + control_m3p1.Coords( 972 , 64 ) + 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 , K ) :' ) + Pycontrol_div2.append( ' return N,K' ) + control_div2 = GraphSyrControlGUI_2.GNode( 'control_div2' , Pycontrol_div2 , 'label_begin' ) + control_div2.SetName( 'control_div2' ) + control_div2.SetAuthor( '' ) + control_div2.SetComment( 'Compute Node' ) + control_div2.Coords( 972 , 430 ) + 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 = GraphSyrControlGUI_2.Link( Otest_ISEVENBoolEven , Ilabel_testValEven ) + Ltest_ISEVENBoolEvenlabel_testValEven.AddCoord( 1 , 493 , 238 ) + Ltest_ISEVENBoolEvenlabel_testValEven.AddCoord( 2 , 493 , 418 ) + + Ltest_ISONEBoolOnelabel_testValOne = GraphSyrControlGUI_2.Link( Otest_ISONEBoolOne , Ilabel_testValOne ) + + Lm3p1anEvenIntegercontrol_m3p1N = GraphSyrControlGUI_2.Link( Om3p1anEvenInteger , Icontrol_m3p1N ) + + Ldiv2anIntegercontrol_div2N = GraphSyrControlGUI_2.Link( Odiv2anInteger , Icontrol_div2N ) + + LincraNewCountcontrol_div2K = GraphSyrControlGUI_2.Link( OincraNewCount , Icontrol_div2K ) + LincraNewCountcontrol_div2K.AddCoord( 1 , 954 , 494 ) + LincraNewCountcontrol_div2K.AddCoord( 2 , 954 , 259 ) + + LincraNewCountcontrol_m3p1K = GraphSyrControlGUI_2.Link( OincraNewCount , Icontrol_m3p1K ) + LincraNewCountcontrol_m3p1K.AddCoord( 1 , 955 , 128 ) + LincraNewCountcontrol_m3p1K.AddCoord( 2 , 954 , 258 ) + + Llabel_beginNTtest_ISONEanInteger = GraphSyrControlGUI_2.Link( Olabel_beginNT , Itest_ISONEanInteger ) + Llabel_beginNTtest_ISONEanInteger.AddCoord( 1 , 275 , 211 ) + Llabel_beginNTtest_ISONEanInteger.AddCoord( 2 , 275 , 270 ) + + Llabel_beginNTlabel_testNT = GraphSyrControlGUI_2.Link( Olabel_beginNT , Ilabel_testNT ) + + Llabel_beginNTtest_ISEVENanInteger = GraphSyrControlGUI_2.Link( Olabel_beginNT , Itest_ISEVENanInteger ) + Llabel_beginNTtest_ISEVENanInteger.AddCoord( 1 , 274 , 417 ) + Llabel_beginNTtest_ISEVENanInteger.AddCoord( 2 , 275 , 270 ) + + Llabel_beginKTlabel_testKT = GraphSyrControlGUI_2.Link( Olabel_beginKT , Ilabel_testKT ) + Llabel_beginKTlabel_testKT.AddCoord( 1 , 476 , 294 ) + Llabel_beginKTlabel_testKT.AddCoord( 2 , 475 , 515 ) + Llabel_beginKTlabel_testKT.AddCoord( 3 , 260 , 515 ) + Llabel_beginKTlabel_testKT.AddCoord( 4 , 260 , 298 ) + + Llabel_testEvendiv2Gate = GraphSyrControlGUI_2.Link( Olabel_testEven , Idiv2Gate ) + Llabel_testEvendiv2Gate.AddCoord( 1 , 724 , 498 ) + Llabel_testEvendiv2Gate.AddCoord( 2 , 723 , 268 ) + + Llabel_testOddm3p1Gate = GraphSyrControlGUI_2.Link( Olabel_testOdd , Im3p1Gate ) + Llabel_testOddm3p1Gate.AddCoord( 1 , 698 , 132 ) + Llabel_testOddm3p1Gate.AddCoord( 2 , 697 , 297 ) + + Llabel_testNm3p1anOddInteger = GraphSyrControlGUI_2.Link( Olabel_testN , Im3p1anOddInteger ) + Llabel_testNm3p1anOddInteger.AddCoord( 1 , 748 , 100 ) + Llabel_testNm3p1anOddInteger.AddCoord( 2 , 747 , 325 ) + + Llabel_testNdiv2anEvenInteger = GraphSyrControlGUI_2.Link( Olabel_testN , Idiv2anEvenInteger ) + Llabel_testNdiv2anEvenInteger.AddCoord( 1 , 746 , 463 ) + Llabel_testNdiv2anEvenInteger.AddCoord( 2 , 747 , 327 ) + + Llabel_testKincraCount = GraphSyrControlGUI_2.Link( Olabel_testK , IincraCount ) + Llabel_testKincraCount.AddCoord( 1 , 732 , 260 ) + Llabel_testKincraCount.AddCoord( 2 , 732 , 354 ) + + Llabel_testDefaultEndL_OneEvenDefault = GraphSyrControlGUI_2.Link( Olabel_testDefault , IEndL_OneEvenDefault ) + + Lcontrol_m3p1Gatelabel_testGate = GraphSyrControlGUI_2.Link( Ocontrol_m3p1Gate , Ilabel_testGate ) + Lcontrol_m3p1Gatelabel_testGate.AddCoord( 1 , 503 , 388 ) + Lcontrol_m3p1Gatelabel_testGate.AddCoord( 2 , 505 , 5 ) + Lcontrol_m3p1Gatelabel_testGate.AddCoord( 3 , 1149 , 5 ) + Lcontrol_m3p1Gatelabel_testGate.AddCoord( 4 , 1150 , 219 ) + + Lcontrol_div2Gatelabel_beginGate = GraphSyrControlGUI_2.Link( Ocontrol_div2Gate , Ilabel_beginGate ) + Lcontrol_div2Gatelabel_beginGate.AddCoord( 1 , 34 , 332 ) + Lcontrol_div2Gatelabel_beginGate.AddCoord( 2 , 34 , 592 ) + Lcontrol_div2Gatelabel_beginGate.AddCoord( 3 , 1145 , 586 ) + Lcontrol_div2Gatelabel_beginGate.AddCoord( 4 , 1144 , 527 ) + + # Input datas + Ilabel_beginNB.Input( 7 ) + Ilabel_beginKB.Input( 0 ) + + # Output Ports of the graph + #Olabel_testFinished = label_test.GetOutPort( 'Finished' ) + #Olabel_testIncr = label_test.GetOutPort( 'Incr' ) + return GraphSyrControlGUI_2 + + +GraphSyrControlGUI_2 = DefGraphSyrControlGUI_2() diff --git a/examples/GraphSyrControlGUI.xml b/examples/GraphSyrControlGUI.xml index 14986c9..f855cc7 100644 --- a/examples/GraphSyrControlGUI.xml +++ b/examples/GraphSyrControlGUI.xml @@ -1,603 +1,595 @@ - + + ? - ? - GraphSyrControlGUI - 1 - ? - -GraphSyrControlGUI - + ? + GraphSyrControlGUI_2 + 1 + ? + +GraphSyrControlGUI_2 + long - label_begin\NB - + label_begin__NB + long - label_begin\KB - + label_begin__KB + long - label_test\Finished - - - 11/3/2003 - 18:28:48 - 18/3/2004 - 14:22:38 - 1.04 - JR - ? - Syracuse algorithm - 0 - 0 - + label_test__Finished + +long + label_test__Incr + + + 11/3/2003 - 18:28:48 + 20/1/2005 - 13:18:12 + 1.04 + JR + ? + Syracuse algorithm + 0 + 0 + SyrComponent - SyrComponent - test_ISEVEN - 0 - ? - + SyrComponent + test_ISEVEN + 0 + ? + C_ISEVEN - + long - anInteger - + anInteger + long - BoolEven - - - 18/3/2004 - 14:22:38 - 18/3/2004 - 14:22:38 - 1.04 - ? - localhost/FactoryServer - C_ISEVEN from SyrComponent - 288 - 337 - + BoolEven + + + 20/1/2005 - 13:17:57 + 20/1/2005 - 13:17:57 + 1.04 + ? + localhost/FactoryServer + C_ISEVEN from SyrComponent + 288 + 337 + SyrComponent - SyrComponent - test_ISONE - 0 - ? - + SyrComponent + test_ISONE + 0 + ? + C_ISONE - + long - anInteger - + anInteger + long - BoolOne - - - 18/3/2004 - 14:22:38 - 18/3/2004 - 14:22:38 - 1.04 - ? - localhost/FactoryServer - C_ISONE from SyrComponent - 293 - 130 - + BoolOne + + + 20/1/2005 - 13:17:57 + 20/1/2005 - 13:17:57 + 1.04 + ? + localhost/FactoryServer + C_ISONE from SyrComponent + 293 + 130 + SyrComponent - SyrComponent - m3p1 - 0 - ? - + SyrComponent + m3p1 + 0 + ? + C_M3P1 - + long - anOddInteger - + anOddInteger + long - anEvenInteger - - - 18/3/2004 - 14:22:38 - 18/3/2004 - 14:22:38 - 1.04 - ? - localhost/FactoryServer - C_M3P1 from SyrComponent - 761 - 19 - + anEvenInteger + + + 20/1/2005 - 13:17:57 + 20/1/2005 - 13:17:57 + 1.04 + ? + localhost/FactoryServer + C_M3P1 from SyrComponent + 761 + 19 + SyrComponent - SyrComponent - div2 - 0 - ? - + SyrComponent + div2 + 0 + ? + C_DIV2 - + long - anEvenInteger - + anEvenInteger + long - anInteger - - - 18/3/2004 - 14:22:38 - 18/3/2004 - 14:22:38 - 1.04 - ? - localhost/FactoryServer - C_DIV2 from SyrComponent - 770 - 384 - + anInteger + + + 20/1/2005 - 13:17:57 + 20/1/2005 - 13:17:57 + 1.04 + ? + localhost/FactoryServer + C_DIV2 from SyrComponent + 770 + 384 + SyrComponent - SyrComponent - incr - 0 - ? - + SyrComponent + incr + 0 + ? + C_INCR - + long - aCount - + aCount + long - aNewCount - - - 18/3/2004 - 14:22:38 - 18/3/2004 - 14:22:38 - 1.04 - ? - localhost/FactoryServer - C_INCR from SyrComponent - 764 - 179 - + aNewCount + + + 20/1/2005 - 13:17:57 + 20/1/2005 - 13:17:57 + 1.04 + ? + localhost/FactoryServer + C_INCR from SyrComponent + 764 + 179 + ? - ? - label_begin - 3 - ? - + ? + label_begin + 3 + ? + label_begin - + long - NB - + NB + long - KB - + KB + long - NT - + NT + long - KT - - + KT + + label_begin - - - 18/3/2004 - 14:22:38 - 18/3/2004 - 14:22:38 - 1.04 - ? - ? - Python function - 58 - 189 - + + + 20/1/2005 - 13:17:57 + 20/1/2005 - 13:17:57 + 1.04 + ? + ? + Python function + 58 + 189 + ? - ? - label_test - 6 - EndL_OneEven - + ? + label_test + 6 + EndL_OneEven + label_test - + long - ValOne - + ValOne + long - ValEven - + ValEven + long - NT - + NT + long - KT - + KT + long - Finished - + Finished + long - Incr - + Incr + long - Even - + Even + long - Odd - + Odd + long - N - + N + long - K - - + K + + L_OneEven - - - - - - - - - - - - - - - - 18/3/2004 - 14:22:38 - 18/3/2004 - 14:22:38 - 1.04 - ? - ? - ? - 516 - 175 - + + + + + + + + + + + + + + + + 20/1/2005 - 13:17:57 + 20/1/2005 - 13:17:57 + 1.04 + ? + ? + Compute Node + 516 + 175 + ? - ? - EndL_OneEven - 7 - label_test - + ? + EndL_OneEven + 7 + label_test + EndL_OneEven - - - - + + + + ? - - 18/3/2004 - 14:22:38 - 18/3/2004 - 14:22:38 - 1.04 - ? - ? - ? - 1068 - 258 - + + 20/1/2005 - 13:17:57 + 20/1/2005 - 13:17:57 + 1.04 + ? + ? + Compute Node + 1068 + 258 + ? - ? - control_m3p1 - 8 - label_test - + ? + control_m3p1 + 8 + label_test + control_m3p1 - + long - N - + N + long - K - + K + long - ValOne - + ValOne + long - ValEven - + ValEven + long - NT - + NT + long - KT - - + KT + + C_NotOneIsEven - - - 18/3/2004 - 14:22:38 - 18/3/2004 - 14:22:38 - 1.04 - ? - ? - ? - 972 - 64 - + + + 20/1/2005 - 13:17:57 + 20/1/2005 - 13:17:57 + 1.04 + ? + ? + Compute Node + 972 + 64 + ? - ? - control_div2 - 8 - label_begin - + ? + control_div2 + 8 + label_begin + control_div2 - + long - N - + N + long - K - + K + long - NB - + NB + long - KB - - + KB + + control_div2 - - - 18/3/2004 - 14:22:38 - 18/3/2004 - 14:22:38 - 1.04 - ? - ? - ? - 972 - 430 - + + + 20/1/2005 - 13:17:57 + 20/1/2005 - 13:17:57 + 1.04 + ? + ? + Compute Node + 972 + 430 + test_ISEVEN - BoolEven - label_test - ValEven - + BoolEven + label_test + ValEven + 493 - 238 - + 238 + 493 - 418 - + 418 + test_ISONE - BoolOne - label_test - ValOne - - + BoolOne + label_test + ValOne + + m3p1 - anEvenInteger - control_m3p1 - N - - + anEvenInteger + control_m3p1 + N + + div2 - anInteger - control_div2 - N - - + anInteger + control_div2 + N + + incr - aNewCount - control_div2 - K - + aNewCount + control_div2 + K + 954 - 494 - + 494 + 954 - 259 - + 259 + incr - aNewCount - control_m3p1 - K - + aNewCount + control_m3p1 + K + 955 - 128 - + 128 + 954 - 258 - + 258 + label_begin - NT - test_ISONE - anInteger - + NT + test_ISONE + anInteger + 275 - 211 - + 211 + 275 - 270 - + 270 + label_begin - NT - label_test - NT - - + NT + label_test + NT + + label_begin - NT - test_ISEVEN - anInteger - + NT + test_ISEVEN + anInteger + 274 - 417 - + 417 + 275 - 270 - + 270 + label_begin - KT - label_test - KT - + KT + label_test + KT + 476 - 294 - + 294 + 475 - 515 - + 515 + 260 - 515 - + 515 + 260 - 298 - -label_test - Incr - incr - InGate - - -712 - 292 - -711 - 238 - + 298 + label_test - Even - div2 - InGate - + Even + div2 + Gate + 724 - 498 - + 498 + 723 - 268 - + 268 + label_test - Odd - m3p1 - InGate - + Odd + m3p1 + Gate + 698 - 132 - + 132 + 697 - 297 - + 297 + label_test - N - m3p1 - anOddInteger - + N + m3p1 + anOddInteger + 748 - 100 - + 100 + 747 - 325 - + 325 + label_test - N - div2 - anEvenInteger - + N + div2 + anEvenInteger + 746 - 463 - + 463 + 747 - 327 - + 327 + label_test - K - incr - aCount - + K + incr + aCount + 732 - 260 - + 260 + 732 - 354 - + 354 + label_test - Default - EndL_OneEven - Default - - + Default + EndL_OneEven + Default + + control_m3p1 - OutGate - label_test - InGate - + Gate + label_test + Gate + 503 - 388 - + 388 + 505 - 5 - + 5 + 1149 - 5 - + 5 + 1150 - 219 - + 219 + control_div2 - OutGate - label_begin - InGate - + Gate + label_begin + Gate + 34 - 332 - + 332 + 34 - 592 - + 592 + 1145 - 586 - + 586 + 1144 - 527 - + 527 + -GraphSyrControlGUI - label_begin\NB - label_begin - NB - +GraphSyrControlGUI_2 + label_begin__NB + label_begin + NB + 3 - 7 - - -GraphSyrControlGUI - label_begin\KB - label_begin - KB - + 7 + + +GraphSyrControlGUI_2 + label_begin__KB + label_begin + KB + 3 - 0 - + 0 + -- 2.39.2