From 27cf87f4e4d521ed501c8e3989d2ffeabb956653 Mon Sep 17 00:00:00 2001 From: rahuel Date: Fri, 17 Dec 2004 15:34:44 +0000 Subject: [PATCH] Execution Control and Loops --- examples/GraphBadInputInLoop.py | 162 +++++ examples/GraphBadInputInLoop.xml | 400 +++++++++++ examples/GraphBadInputInLoop1.py | 162 +++++ examples/GraphBadInputInLoop1.xml | 400 +++++++++++ examples/GraphBadInputInLoop2.py | 163 +++++ examples/GraphBadInputInLoop2.xml | 403 +++++++++++ examples/GraphBadInputInLoop3.py | 167 +++++ examples/GraphBadInputInLoop3.xml | 409 +++++++++++ examples/GraphBadOutputOfLoop.py | 164 +++++ examples/GraphBadOutputOfLoop.xml | 415 +++++++++++ examples/GraphBadOutputOfLoop1.py | 163 +++++ examples/GraphBadOutputOfLoop1.xml | 412 +++++++++++ examples/GraphBadOutputOfLoop2.py | 164 +++++ examples/GraphBadOutputOfLoop2.xml | 415 +++++++++++ examples/GraphGOTO.py | 558 ++++++++------- examples/GraphGOTO.xml | 1053 ++++++++++++++-------------- examples/GraphLoop.py | 161 +++-- examples/GraphLoop.xml | 349 ++++----- examples/GraphLoopDoWhile.py | 76 ++ examples/GraphLoopDoWhile.xml | 169 +++++ examples/GraphLoopSwitch.py | 280 ++++---- examples/GraphLoopSwitch.xml | 540 +++++++------- examples/GraphLoopWhile.py | 74 ++ examples/GraphLoopWhile.xml | 168 +++++ examples/GraphLoopsCoupled.py | 215 ++++++ examples/GraphLoopsCoupled.xml | 553 +++++++++++++++ examples/GraphNonVoidEndLoop.py | 101 +++ examples/GraphNonVoidEndLoop.xml | 243 +++++++ examples/GraphTwoLoops.py | 132 ++++ examples/GraphTwoLoops.xml | 321 +++++++++ examples/GraphVoidMoreLoop.py | 97 +++ examples/GraphVoidMoreLoop.xml | 239 +++++++ src/Supervision/Graph_Impl.cxx | 3 +- 33 files changed, 7887 insertions(+), 1444 deletions(-) create mode 100755 examples/GraphBadInputInLoop.py create mode 100755 examples/GraphBadInputInLoop.xml create mode 100755 examples/GraphBadInputInLoop1.py create mode 100755 examples/GraphBadInputInLoop1.xml create mode 100755 examples/GraphBadInputInLoop2.py create mode 100755 examples/GraphBadInputInLoop2.xml create mode 100755 examples/GraphBadInputInLoop3.py create mode 100755 examples/GraphBadInputInLoop3.xml create mode 100755 examples/GraphBadOutputOfLoop.py create mode 100755 examples/GraphBadOutputOfLoop.xml create mode 100755 examples/GraphBadOutputOfLoop1.py create mode 100755 examples/GraphBadOutputOfLoop1.xml create mode 100755 examples/GraphBadOutputOfLoop2.py create mode 100755 examples/GraphBadOutputOfLoop2.xml create mode 100644 examples/GraphLoopDoWhile.py create mode 100644 examples/GraphLoopDoWhile.xml create mode 100644 examples/GraphLoopWhile.py create mode 100644 examples/GraphLoopWhile.xml create mode 100644 examples/GraphLoopsCoupled.py create mode 100644 examples/GraphLoopsCoupled.xml create mode 100644 examples/GraphNonVoidEndLoop.py create mode 100644 examples/GraphNonVoidEndLoop.xml create mode 100644 examples/GraphTwoLoops.py create mode 100644 examples/GraphTwoLoops.xml create mode 100644 examples/GraphVoidMoreLoop.py create mode 100644 examples/GraphVoidMoreLoop.xml diff --git a/examples/GraphBadInputInLoop.py b/examples/GraphBadInputInLoop.py new file mode 100755 index 0000000..f8c17e3 --- /dev/null +++ b/examples/GraphBadInputInLoop.py @@ -0,0 +1,162 @@ + +# Generated python file of Graph GraphBadInputInLoop + +from SuperV import * + +# Graph creation of GraphBadInputInLoop +def DefGraphBadInputInLoop() : + GraphBadInputInLoop = Graph( 'GraphBadInputInLoop' ) + GraphBadInputInLoop.SetName( 'GraphBadInputInLoop' ) + GraphBadInputInLoop.SetAuthor( '' ) + GraphBadInputInLoop.SetComment( '' ) + GraphBadInputInLoop.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsOdd = [] + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd(a,Even) : ' ) + PyIsOdd.append( ' print a,"IsOdd (GraphLoopSwitch1)" ' ) + PyIsOdd.append( ' sleep( 1 ) ' ) + PyIsOdd.append( ' return a ' ) + IsOdd = GraphBadInputInLoop.INode( 'IsOdd' , PyIsOdd ) + 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' ) + + PyBadInputOfLoop = [] + PyBadInputOfLoop.append( 'def BadInputOfLoop() : ' ) + PyBadInputOfLoop.append( ' return 1 ' ) + PyBadInputOfLoop.append( '' ) + BadInputOfLoop = GraphBadInputInLoop.INode( 'BadInputOfLoop' , PyBadInputOfLoop ) + BadInputOfLoop.SetName( 'BadInputOfLoop' ) + BadInputOfLoop.SetAuthor( '' ) + BadInputOfLoop.SetComment( 'Compute Node' ) + BadInputOfLoop.Coords( 15 , 307 ) + IBadInputOfLoopGate = BadInputOfLoop.GetInPort( 'Gate' ) + OBadInputOfLoopInputInLoop = BadInputOfLoop.OutPort( 'InputInLoop' , 'boolean' ) + OBadInputOfLoopGate = BadInputOfLoop.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyInitLoop = [] + PyMoreInitLoop = [] + PyMoreInitLoop.append( '' ) + PyNextInitLoop = [] + PyNextInitLoop.append( '' ) + InitLoop,EndOfInitLoop = GraphBadInputInLoop.LNode( '' , 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 ) + IInitLoopInitLoop = InitLoop.GetInPort( 'InitLoop' ) + 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' ) + 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 = GraphBadInputInLoop.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 = GraphBadInputInLoop.Link( OIsOdda , IEndSwitcha ) + LIsOddaEndSwitcha.AddCoord( 1 , 576 , 136 ) + LIsOddaEndSwitcha.AddCoord( 2 , 575 , 81 ) + + LInitLoopIndexSwitcha = GraphBadInputInLoop.Link( OInitLoopIndex , ISwitcha ) + + LInitLoopMinEndOfInitLoopMin = GraphBadInputInLoop.Link( OInitLoopMin , IEndOfInitLoopMin ) + + LSwitchOddIsOddGate = GraphBadInputInLoop.Link( OSwitchOdd , IIsOddGate ) + + LSwitchEvenEndSwitchDefault = GraphBadInputInLoop.Link( OSwitchEven , IEndSwitchDefault ) + + LSwitchEvenIsOddEven = GraphBadInputInLoop.Link( OSwitchEven , IIsOddEven ) + LSwitchEvenIsOddEven.AddCoord( 1 , 375 , 111 ) + LSwitchEvenIsOddEven.AddCoord( 2 , 375 , 172 ) + + LSwitchaIsOdda = GraphBadInputInLoop.Link( OSwitcha , IIsOdda ) + LSwitchaIsOdda.AddCoord( 1 , 362 , 82 ) + LSwitchaIsOdda.AddCoord( 2 , 360 , 201 ) + + LEndSwitchaEndOfInitLoopIndex = GraphBadInputInLoop.Link( OEndSwitcha , IEndOfInitLoopIndex ) + + LBadInputOfLoopInputInLoopSwitchGate = GraphBadInputInLoop.Link( OBadInputOfLoopInputInLoop , ISwitchGate ) + + # Input datas + IInitLoopIndex.Input( 0 ) + IInitLoopMin.Input( 0 ) + IInitLoopMax.Input( 100 ) + IEndOfInitLoopMax.Input( 136221856 ) + + # Output Ports of the graph + #OInitLoopMax = InitLoop.GetOutPort( 'Max' ) + #OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) + #OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) + #OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) + return GraphBadInputInLoop + + +GraphBadInputInLoop = DefGraphBadInputInLoop() diff --git a/examples/GraphBadInputInLoop.xml b/examples/GraphBadInputInLoop.xml new file mode 100755 index 0000000..ccec624 --- /dev/null +++ b/examples/GraphBadInputInLoop.xml @@ -0,0 +1,400 @@ + + + + + +? + ? + GraphBadInputInLoop + 1 + ? + +GraphBadInputInLoop + + +long + InitLoop__Index + +long + InitLoop__Min + +long + InitLoop__Max + +long + EndOfInitLoop__Max + + +long + InitLoop__Max + +long + EndOfInitLoop__Index + +long + EndOfInitLoop__Min + +long + EndOfInitLoop__Max + + + 22/10/2003 - 10:36:39 + 14/12/2004 - 15:56:35 + 1.05 + ? + ? + ? + 0 + 0 + + +? + ? + IsOdd + 3 + ? + +IsOdd + + +long + a + +boolean + Even + + +long + a + + + +IsOdd + + + + + + 14/12/2004 - 15:56:35 + 14/12/2004 - 15:56:35 + 1.05 + ? + ? + Python function + 397 + 1 + +? + ? + InitLoop + 4 + EndOfInitLoop + +InitLoop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +? + + +? + + +? + + 14/12/2004 - 15:56:35 + 14/12/2004 - 15:56:35 + 1.05 + ? + ? + Compute Node + 10 + 108 + +? + ? + EndOfInitLoop + 5 + InitLoop + +EndOfInitLoop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +EndOfInitLoop + + + + + + + + 14/12/2004 - 15:56:35 + 14/12/2004 - 15:56:35 + 1.05 + ? + ? + Compute Node + 767 + 102 + +? + ? + Switch + 6 + EndSwitch + +Switch + + +long + a + + +long + Odd + +int + Even + +int + a + + + +Switch + + + + + + 14/12/2004 - 15:56:35 + 14/12/2004 - 15:56:35 + 1.05 + ? + ? + Compute Node + 194 + 109 + +? + ? + EndSwitch + 7 + Switch + +EndSwitch + + +long + a + + +long + a + + + +EndSwitch + + + + + 14/12/2004 - 15:56:35 + 14/12/2004 - 15:56:35 + 1.05 + ? + ? + Compute Node + 587 + 103 + +? + ? + BadInputOfLoop + 3 + ? + +BadInputOfLoop + + + +boolean + InputInLoop + + + +BadInputOfLoop + + + + 14/12/2004 - 15:56:35 + 14/12/2004 - 15:56:35 + 2.0 + ? + ? + Compute Node + 15 + 307 + + +IsOdd + a + EndSwitch + a + + +576 + 136 + +575 + 81 + +InitLoop + DoLoop + EndOfInitLoop + DoLoop + + +InitLoop + Index + Switch + a + + +InitLoop + Min + EndOfInitLoop + Min + + +EndOfInitLoop + DoLoop + InitLoop + InitLoop + + +Switch + Odd + IsOdd + Gate + + +Switch + Even + EndSwitch + Default + + +Switch + Even + IsOdd + Even + + +375 + 111 + +375 + 172 + +Switch + a + IsOdd + a + + +362 + 82 + +360 + 201 + +EndSwitch + a + EndOfInitLoop + Index + + +BadInputOfLoop + InputInLoop + Switch + Gate + + + +GraphBadInputInLoop + InitLoop__Index + InitLoop + Index + +3 + 0 + + +GraphBadInputInLoop + InitLoop__Min + InitLoop + Min + +3 + 0 + + +GraphBadInputInLoop + InitLoop__Max + InitLoop + Max + +3 + 100 + + +GraphBadInputInLoop + EndOfInitLoop__Max + EndOfInitLoop + Max + +3 + 136221856 + diff --git a/examples/GraphBadInputInLoop1.py b/examples/GraphBadInputInLoop1.py new file mode 100755 index 0000000..d5d1da8 --- /dev/null +++ b/examples/GraphBadInputInLoop1.py @@ -0,0 +1,162 @@ + +# Generated python file of Graph GraphBadInputInLoop1 + +from SuperV import * + +# Graph creation of GraphBadInputInLoop1 +def DefGraphBadInputInLoop1() : + GraphBadInputInLoop1 = Graph( 'GraphBadInputInLoop1' ) + GraphBadInputInLoop1.SetName( 'GraphBadInputInLoop1' ) + GraphBadInputInLoop1.SetAuthor( '' ) + GraphBadInputInLoop1.SetComment( '' ) + GraphBadInputInLoop1.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsOdd = [] + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd(a,Even) : ' ) + PyIsOdd.append( ' print a,"IsOdd (GraphLoopSwitch1)" ' ) + PyIsOdd.append( ' sleep( 1 ) ' ) + PyIsOdd.append( ' return a ' ) + IsOdd = GraphBadInputInLoop1.INode( 'IsOdd' , PyIsOdd ) + 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' ) + + PyBadInputOfLoop = [] + PyBadInputOfLoop.append( 'def BadInputOfLoop() : ' ) + PyBadInputOfLoop.append( ' return 1 ' ) + PyBadInputOfLoop.append( '' ) + BadInputOfLoop = GraphBadInputInLoop1.INode( 'BadInputOfLoop' , PyBadInputOfLoop ) + BadInputOfLoop.SetName( 'BadInputOfLoop' ) + BadInputOfLoop.SetAuthor( '' ) + BadInputOfLoop.SetComment( 'Compute Node' ) + BadInputOfLoop.Coords( 15 , 307 ) + IBadInputOfLoopGate = BadInputOfLoop.GetInPort( 'Gate' ) + OBadInputOfLoopInputInLoop = BadInputOfLoop.OutPort( 'InputInLoop' , 'boolean' ) + OBadInputOfLoopGate = BadInputOfLoop.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyInitLoop = [] + PyMoreInitLoop = [] + PyMoreInitLoop.append( '' ) + PyNextInitLoop = [] + PyNextInitLoop.append( '' ) + InitLoop,EndOfInitLoop = GraphBadInputInLoop1.LNode( '' , 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 ) + IInitLoopInitLoop = InitLoop.GetInPort( 'InitLoop' ) + 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' ) + 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 = GraphBadInputInLoop1.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 = GraphBadInputInLoop1.Link( OIsOdda , IEndSwitcha ) + LIsOddaEndSwitcha.AddCoord( 1 , 576 , 136 ) + LIsOddaEndSwitcha.AddCoord( 2 , 575 , 81 ) + + LInitLoopIndexSwitcha = GraphBadInputInLoop1.Link( OInitLoopIndex , ISwitcha ) + + LInitLoopMinEndOfInitLoopMin = GraphBadInputInLoop1.Link( OInitLoopMin , IEndOfInitLoopMin ) + + LSwitchOddIsOddGate = GraphBadInputInLoop1.Link( OSwitchOdd , IIsOddGate ) + + LSwitchEvenEndSwitchDefault = GraphBadInputInLoop1.Link( OSwitchEven , IEndSwitchDefault ) + + LSwitchEvenIsOddEven = GraphBadInputInLoop1.Link( OSwitchEven , IIsOddEven ) + LSwitchEvenIsOddEven.AddCoord( 1 , 375 , 111 ) + LSwitchEvenIsOddEven.AddCoord( 2 , 375 , 172 ) + + LSwitchaIsOdda = GraphBadInputInLoop1.Link( OSwitcha , IIsOdda ) + LSwitchaIsOdda.AddCoord( 1 , 362 , 82 ) + LSwitchaIsOdda.AddCoord( 2 , 360 , 201 ) + + LEndSwitchaEndOfInitLoopIndex = GraphBadInputInLoop1.Link( OEndSwitcha , IEndOfInitLoopIndex ) + + LBadInputOfLoopInputInLoopEndOfInitLoopGate = GraphBadInputInLoop1.Link( OBadInputOfLoopInputInLoop , IEndOfInitLoopGate ) + + # Input datas + IInitLoopIndex.Input( 0 ) + IInitLoopMin.Input( 0 ) + IInitLoopMax.Input( 100 ) + IEndOfInitLoopMax.Input( 136221856 ) + + # Output Ports of the graph + #OInitLoopMax = InitLoop.GetOutPort( 'Max' ) + #OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) + #OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) + #OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) + return GraphBadInputInLoop1 + + +GraphBadInputInLoop1 = DefGraphBadInputInLoop1() diff --git a/examples/GraphBadInputInLoop1.xml b/examples/GraphBadInputInLoop1.xml new file mode 100755 index 0000000..5efd5ef --- /dev/null +++ b/examples/GraphBadInputInLoop1.xml @@ -0,0 +1,400 @@ + + + + + +? + ? + GraphBadInputInLoop1 + 1 + ? + +GraphBadInputInLoop1 + + +long + InitLoop__Index + +long + InitLoop__Min + +long + InitLoop__Max + +long + EndOfInitLoop__Max + + +long + InitLoop__Max + +long + EndOfInitLoop__Index + +long + EndOfInitLoop__Min + +long + EndOfInitLoop__Max + + + 22/10/2003 - 10:36:39 + 14/12/2004 - 15:57:27 + 1.05 + ? + ? + ? + 0 + 0 + + +? + ? + IsOdd + 3 + ? + +IsOdd + + +long + a + +boolean + Even + + +long + a + + + +IsOdd + + + + + + 14/12/2004 - 15:57:27 + 14/12/2004 - 15:57:27 + 1.05 + ? + ? + Python function + 397 + 1 + +? + ? + InitLoop + 4 + EndOfInitLoop + +InitLoop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +? + + +? + + +? + + 14/12/2004 - 15:57:27 + 14/12/2004 - 15:57:27 + 1.05 + ? + ? + Compute Node + 10 + 108 + +? + ? + EndOfInitLoop + 5 + InitLoop + +EndOfInitLoop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +EndOfInitLoop + + + + + + + + 14/12/2004 - 15:57:27 + 14/12/2004 - 15:57:27 + 1.05 + ? + ? + Compute Node + 767 + 102 + +? + ? + Switch + 6 + EndSwitch + +Switch + + +long + a + + +long + Odd + +int + Even + +int + a + + + +Switch + + + + + + 14/12/2004 - 15:57:27 + 14/12/2004 - 15:57:27 + 1.05 + ? + ? + Compute Node + 194 + 109 + +? + ? + EndSwitch + 7 + Switch + +EndSwitch + + +long + a + + +long + a + + + +EndSwitch + + + + + 14/12/2004 - 15:57:27 + 14/12/2004 - 15:57:27 + 1.05 + ? + ? + Compute Node + 587 + 103 + +? + ? + BadInputOfLoop + 3 + ? + +BadInputOfLoop + + + +boolean + InputInLoop + + + +BadInputOfLoop + + + + 14/12/2004 - 15:57:27 + 14/12/2004 - 15:57:27 + 2.0 + ? + ? + Compute Node + 15 + 307 + + +IsOdd + a + EndSwitch + a + + +576 + 136 + +575 + 81 + +InitLoop + DoLoop + EndOfInitLoop + DoLoop + + +InitLoop + Index + Switch + a + + +InitLoop + Min + EndOfInitLoop + Min + + +EndOfInitLoop + DoLoop + InitLoop + InitLoop + + +Switch + Odd + IsOdd + Gate + + +Switch + Even + EndSwitch + Default + + +Switch + Even + IsOdd + Even + + +375 + 111 + +375 + 172 + +Switch + a + IsOdd + a + + +362 + 82 + +360 + 201 + +EndSwitch + a + EndOfInitLoop + Index + + +BadInputOfLoop + InputInLoop + EndOfInitLoop + Gate + + + +GraphBadInputInLoop1 + InitLoop__Index + InitLoop + Index + +3 + 0 + + +GraphBadInputInLoop1 + InitLoop__Min + InitLoop + Min + +3 + 0 + + +GraphBadInputInLoop1 + InitLoop__Max + InitLoop + Max + +3 + 100 + + +GraphBadInputInLoop1 + EndOfInitLoop__Max + EndOfInitLoop + Max + +3 + 136221856 + diff --git a/examples/GraphBadInputInLoop2.py b/examples/GraphBadInputInLoop2.py new file mode 100755 index 0000000..eea51de --- /dev/null +++ b/examples/GraphBadInputInLoop2.py @@ -0,0 +1,163 @@ + +# Generated python file of Graph GraphBadInputInLoop2 + +from SuperV import * + +# Graph creation of GraphBadInputInLoop2 +def DefGraphBadInputInLoop2() : + GraphBadInputInLoop2 = Graph( 'GraphBadInputInLoop2' ) + GraphBadInputInLoop2.SetName( 'GraphBadInputInLoop2' ) + GraphBadInputInLoop2.SetAuthor( '' ) + GraphBadInputInLoop2.SetComment( '' ) + GraphBadInputInLoop2.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsOdd = [] + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd(a,Even,InputInLoop) : ' ) + PyIsOdd.append( ' print a,"IsOdd (GraphLoopSwitch1)" ' ) + PyIsOdd.append( ' sleep( 1 ) ' ) + PyIsOdd.append( ' return a ' ) + IsOdd = GraphBadInputInLoop2.INode( 'IsOdd' , PyIsOdd ) + IsOdd.SetName( 'IsOdd' ) + IsOdd.SetAuthor( '' ) + IsOdd.SetComment( 'Python function' ) + IsOdd.Coords( 397 , 1 ) + IIsOdda = IsOdd.InPort( 'a' , 'long' ) + IIsOddEven = IsOdd.InPort( 'Even' , 'boolean' ) + IIsOddInputInLoop = IsOdd.InPort( 'InputInLoop' , 'boolean' ) + IIsOddGate = IsOdd.GetInPort( 'Gate' ) + OIsOdda = IsOdd.OutPort( 'a' , 'long' ) + OIsOddGate = IsOdd.GetOutPort( 'Gate' ) + + PyBadInputOfLoop = [] + PyBadInputOfLoop.append( 'def BadInputOfLoop() : ' ) + PyBadInputOfLoop.append( ' return 1 ' ) + PyBadInputOfLoop.append( '' ) + BadInputOfLoop = GraphBadInputInLoop2.INode( 'BadInputOfLoop' , PyBadInputOfLoop ) + BadInputOfLoop.SetName( 'BadInputOfLoop' ) + BadInputOfLoop.SetAuthor( '' ) + BadInputOfLoop.SetComment( 'Compute Node' ) + BadInputOfLoop.Coords( 15 , 307 ) + IBadInputOfLoopGate = BadInputOfLoop.GetInPort( 'Gate' ) + OBadInputOfLoopInputInLoop = BadInputOfLoop.OutPort( 'InputInLoop' , 'boolean' ) + OBadInputOfLoopGate = BadInputOfLoop.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyInitLoop = [] + PyMoreInitLoop = [] + PyMoreInitLoop.append( '' ) + PyNextInitLoop = [] + PyNextInitLoop.append( '' ) + InitLoop,EndOfInitLoop = GraphBadInputInLoop2.LNode( '' , 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 ) + IInitLoopInitLoop = InitLoop.GetInPort( 'InitLoop' ) + 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' ) + 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 = GraphBadInputInLoop2.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 = GraphBadInputInLoop2.Link( OIsOdda , IEndSwitcha ) + LIsOddaEndSwitcha.AddCoord( 1 , 576 , 136 ) + LIsOddaEndSwitcha.AddCoord( 2 , 575 , 81 ) + + LInitLoopIndexSwitcha = GraphBadInputInLoop2.Link( OInitLoopIndex , ISwitcha ) + + LInitLoopMinEndOfInitLoopMin = GraphBadInputInLoop2.Link( OInitLoopMin , IEndOfInitLoopMin ) + + LSwitchOddIsOddGate = GraphBadInputInLoop2.Link( OSwitchOdd , IIsOddGate ) + + LSwitchEvenEndSwitchDefault = GraphBadInputInLoop2.Link( OSwitchEven , IEndSwitchDefault ) + + LSwitchEvenIsOddEven = GraphBadInputInLoop2.Link( OSwitchEven , IIsOddEven ) + LSwitchEvenIsOddEven.AddCoord( 1 , 375 , 111 ) + LSwitchEvenIsOddEven.AddCoord( 2 , 375 , 172 ) + + LSwitchaIsOdda = GraphBadInputInLoop2.Link( OSwitcha , IIsOdda ) + LSwitchaIsOdda.AddCoord( 1 , 362 , 82 ) + LSwitchaIsOdda.AddCoord( 2 , 360 , 201 ) + + LEndSwitchaEndOfInitLoopIndex = GraphBadInputInLoop2.Link( OEndSwitcha , IEndOfInitLoopIndex ) + + LBadInputOfLoopInputInLoopIsOddInputInLoop = GraphBadInputInLoop2.Link( OBadInputOfLoopInputInLoop , IIsOddInputInLoop ) + + # Input datas + IInitLoopIndex.Input( 0 ) + IInitLoopMin.Input( 0 ) + IInitLoopMax.Input( 100 ) + IEndOfInitLoopMax.Input( 136221856 ) + + # Output Ports of the graph + #OInitLoopMax = InitLoop.GetOutPort( 'Max' ) + #OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) + #OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) + #OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) + return GraphBadInputInLoop2 + + +GraphBadInputInLoop2 = DefGraphBadInputInLoop2() diff --git a/examples/GraphBadInputInLoop2.xml b/examples/GraphBadInputInLoop2.xml new file mode 100755 index 0000000..3e5ec3c --- /dev/null +++ b/examples/GraphBadInputInLoop2.xml @@ -0,0 +1,403 @@ + + + + + +? + ? + GraphBadInputInLoop2 + 1 + ? + +GraphBadInputInLoop2 + + +long + InitLoop__Index + +long + InitLoop__Min + +long + InitLoop__Max + +long + EndOfInitLoop__Max + + +long + InitLoop__Max + +long + EndOfInitLoop__Index + +long + EndOfInitLoop__Min + +long + EndOfInitLoop__Max + + + 22/10/2003 - 10:36:39 + 14/12/2004 - 15:57:56 + 1.05 + ? + ? + ? + 0 + 0 + + +? + ? + IsOdd + 3 + ? + +IsOdd + + +long + a + +boolean + Even + +boolean + InputInLoop + + +long + a + + + +IsOdd + + + + + + 14/12/2004 - 15:57:56 + 14/12/2004 - 15:57:56 + 1.05 + ? + ? + Python function + 397 + 1 + +? + ? + InitLoop + 4 + EndOfInitLoop + +InitLoop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +? + + +? + + +? + + 14/12/2004 - 15:57:56 + 14/12/2004 - 15:57:56 + 1.05 + ? + ? + Compute Node + 10 + 108 + +? + ? + EndOfInitLoop + 5 + InitLoop + +EndOfInitLoop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +EndOfInitLoop + + + + + + + + 14/12/2004 - 15:57:56 + 14/12/2004 - 15:57:56 + 1.05 + ? + ? + Compute Node + 767 + 102 + +? + ? + Switch + 6 + EndSwitch + +Switch + + +long + a + + +long + Odd + +int + Even + +int + a + + + +Switch + + + + + + 14/12/2004 - 15:57:56 + 14/12/2004 - 15:57:56 + 1.05 + ? + ? + Compute Node + 194 + 109 + +? + ? + EndSwitch + 7 + Switch + +EndSwitch + + +long + a + + +long + a + + + +EndSwitch + + + + + 14/12/2004 - 15:57:56 + 14/12/2004 - 15:57:56 + 1.05 + ? + ? + Compute Node + 587 + 103 + +? + ? + BadInputOfLoop + 3 + ? + +BadInputOfLoop + + + +boolean + InputInLoop + + + +BadInputOfLoop + + + + 14/12/2004 - 15:57:56 + 14/12/2004 - 15:57:56 + 2.0 + ? + ? + Compute Node + 15 + 307 + + +IsOdd + a + EndSwitch + a + + +576 + 136 + +575 + 81 + +InitLoop + DoLoop + EndOfInitLoop + DoLoop + + +InitLoop + Index + Switch + a + + +InitLoop + Min + EndOfInitLoop + Min + + +EndOfInitLoop + DoLoop + InitLoop + InitLoop + + +Switch + Odd + IsOdd + Gate + + +Switch + Even + EndSwitch + Default + + +Switch + Even + IsOdd + Even + + +375 + 111 + +375 + 172 + +Switch + a + IsOdd + a + + +362 + 82 + +360 + 201 + +EndSwitch + a + EndOfInitLoop + Index + + +BadInputOfLoop + InputInLoop + IsOdd + InputInLoop + + + +GraphBadInputInLoop2 + InitLoop__Index + InitLoop + Index + +3 + 0 + + +GraphBadInputInLoop2 + InitLoop__Min + InitLoop + Min + +3 + 0 + + +GraphBadInputInLoop2 + InitLoop__Max + InitLoop + Max + +3 + 100 + + +GraphBadInputInLoop2 + EndOfInitLoop__Max + EndOfInitLoop + Max + +3 + 136221856 + diff --git a/examples/GraphBadInputInLoop3.py b/examples/GraphBadInputInLoop3.py new file mode 100755 index 0000000..71c7c77 --- /dev/null +++ b/examples/GraphBadInputInLoop3.py @@ -0,0 +1,167 @@ + +# Generated python file of Graph GraphBadInputInLoop3 + +from SuperV import * + +# Graph creation of GraphBadInputInLoop3 +def DefGraphBadInputInLoop3() : + GraphBadInputInLoop3 = Graph( 'GraphBadInputInLoop3' ) + GraphBadInputInLoop3.SetName( 'GraphBadInputInLoop3' ) + GraphBadInputInLoop3.SetAuthor( '' ) + GraphBadInputInLoop3.SetComment( '' ) + GraphBadInputInLoop3.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsOdd = [] + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd(a,Even,InputInLoop) : ' ) + PyIsOdd.append( ' print a,"IsOdd (GraphLoopSwitch1)" ' ) + PyIsOdd.append( ' sleep( 1 ) ' ) + PyIsOdd.append( ' return a ' ) + IsOdd = GraphBadInputInLoop3.INode( 'IsOdd' , PyIsOdd ) + IsOdd.SetName( 'IsOdd' ) + IsOdd.SetAuthor( '' ) + IsOdd.SetComment( 'Python function' ) + IsOdd.Coords( 397 , 1 ) + IIsOdda = IsOdd.InPort( 'a' , 'long' ) + IIsOddEven = IsOdd.InPort( 'Even' , 'boolean' ) + IIsOddInputInLoop = IsOdd.InPort( 'InputInLoop' , 'boolean' ) + IIsOddGate = IsOdd.GetInPort( 'Gate' ) + OIsOdda = IsOdd.OutPort( 'a' , 'long' ) + OIsOddGate = IsOdd.GetOutPort( 'Gate' ) + + PyBadInputOfLoop = [] + PyBadInputOfLoop.append( 'def BadInputOfLoop() : ' ) + PyBadInputOfLoop.append( ' return 1 ' ) + PyBadInputOfLoop.append( '' ) + BadInputOfLoop = GraphBadInputInLoop3.INode( 'BadInputOfLoop' , PyBadInputOfLoop ) + BadInputOfLoop.SetName( 'BadInputOfLoop' ) + BadInputOfLoop.SetAuthor( '' ) + BadInputOfLoop.SetComment( 'Compute Node' ) + BadInputOfLoop.Coords( 359 , 318 ) + IBadInputOfLoopGate = BadInputOfLoop.GetInPort( 'Gate' ) + OBadInputOfLoopInputInLoop = BadInputOfLoop.OutPort( 'InputInLoop' , 'boolean' ) + OBadInputOfLoopGate = BadInputOfLoop.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyInitLoop = [] + PyMoreInitLoop = [] + PyMoreInitLoop.append( '' ) + PyNextInitLoop = [] + PyNextInitLoop.append( '' ) + InitLoop,EndOfInitLoop = GraphBadInputInLoop3.LNode( '' , 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 ) + IInitLoopInitLoop = InitLoop.GetInPort( 'InitLoop' ) + 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' ) + 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 = GraphBadInputInLoop3.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 = GraphBadInputInLoop3.Link( OIsOdda , IEndSwitcha ) + LIsOddaEndSwitcha.AddCoord( 1 , 576 , 136 ) + LIsOddaEndSwitcha.AddCoord( 2 , 575 , 81 ) + + LInitLoopIndexSwitcha = GraphBadInputInLoop3.Link( OInitLoopIndex , ISwitcha ) + + LInitLoopMinEndOfInitLoopMin = GraphBadInputInLoop3.Link( OInitLoopMin , IEndOfInitLoopMin ) + + LSwitchOddIsOddGate = GraphBadInputInLoop3.Link( OSwitchOdd , IIsOddGate ) + + LSwitchEvenEndSwitchDefault = GraphBadInputInLoop3.Link( OSwitchEven , IEndSwitchDefault ) + + LSwitchEvenIsOddEven = GraphBadInputInLoop3.Link( OSwitchEven , IIsOddEven ) + LSwitchEvenIsOddEven.AddCoord( 1 , 375 , 111 ) + LSwitchEvenIsOddEven.AddCoord( 2 , 375 , 172 ) + + LSwitchaIsOdda = GraphBadInputInLoop3.Link( OSwitcha , IIsOdda ) + LSwitchaIsOdda.AddCoord( 1 , 362 , 82 ) + LSwitchaIsOdda.AddCoord( 2 , 360 , 201 ) + + LEndSwitchaEndOfInitLoopIndex = GraphBadInputInLoop3.Link( OEndSwitcha , IEndOfInitLoopIndex ) + + LBadInputOfLoopGateEndOfInitLoopGate = GraphBadInputInLoop3.Link( OBadInputOfLoopGate , IEndOfInitLoopGate ) + + # Input datas + IInitLoopIndex.Input( 0 ) + IInitLoopMin.Input( 0 ) + IInitLoopMax.Input( 100 ) + IEndOfInitLoopMax.Input( 136221856 ) + + # Input Ports of the graph + #IIsOddInputInLoop = IsOdd.GetInPort( 'InputInLoop' ) + + # Output Ports of the graph + #OInitLoopMax = InitLoop.GetOutPort( 'Max' ) + #OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) + #OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) + #OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) + #OBadInputOfLoopInputInLoop = BadInputOfLoop.GetOutPort( 'InputInLoop' ) + return GraphBadInputInLoop3 + + +GraphBadInputInLoop3 = DefGraphBadInputInLoop3() diff --git a/examples/GraphBadInputInLoop3.xml b/examples/GraphBadInputInLoop3.xml new file mode 100755 index 0000000..46199ef --- /dev/null +++ b/examples/GraphBadInputInLoop3.xml @@ -0,0 +1,409 @@ + + + + + +? + ? + GraphBadInputInLoop3 + 1 + ? + +GraphBadInputInLoop3 + + +boolean + IsOdd__InputInLoop + +long + InitLoop__Index + +long + InitLoop__Min + +long + InitLoop__Max + +long + EndOfInitLoop__Max + + +long + InitLoop__Max + +long + EndOfInitLoop__Index + +long + EndOfInitLoop__Min + +long + EndOfInitLoop__Max + +boolean + BadInputOfLoop__InputInLoop + + + 22/10/2003 - 10:36:39 + 14/12/2004 - 15:58:23 + 1.05 + ? + ? + ? + 0 + 0 + + +? + ? + IsOdd + 3 + ? + +IsOdd + + +long + a + +boolean + Even + +boolean + InputInLoop + + +long + a + + + +IsOdd + + + + + + 14/12/2004 - 15:58:23 + 14/12/2004 - 15:58:23 + 1.05 + ? + ? + Python function + 397 + 1 + +? + ? + InitLoop + 4 + EndOfInitLoop + +InitLoop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +? + + +? + + +? + + 14/12/2004 - 15:58:23 + 14/12/2004 - 15:58:23 + 1.05 + ? + ? + Compute Node + 10 + 108 + +? + ? + EndOfInitLoop + 5 + InitLoop + +EndOfInitLoop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +EndOfInitLoop + + + + + + + + 14/12/2004 - 15:58:23 + 14/12/2004 - 15:58:23 + 1.05 + ? + ? + Compute Node + 767 + 102 + +? + ? + Switch + 6 + EndSwitch + +Switch + + +long + a + + +long + Odd + +int + Even + +int + a + + + +Switch + + + + + + 14/12/2004 - 15:58:23 + 14/12/2004 - 15:58:23 + 1.05 + ? + ? + Compute Node + 194 + 109 + +? + ? + EndSwitch + 7 + Switch + +EndSwitch + + +long + a + + +long + a + + + +EndSwitch + + + + + 14/12/2004 - 15:58:23 + 14/12/2004 - 15:58:23 + 1.05 + ? + ? + Compute Node + 587 + 103 + +? + ? + BadInputOfLoop + 3 + ? + +BadInputOfLoop + + + +boolean + InputInLoop + + + +BadInputOfLoop + + + + 14/12/2004 - 15:58:23 + 14/12/2004 - 15:58:23 + 2.0 + ? + ? + Compute Node + 359 + 318 + + +IsOdd + a + EndSwitch + a + + +576 + 136 + +575 + 81 + +InitLoop + DoLoop + EndOfInitLoop + DoLoop + + +InitLoop + Index + Switch + a + + +InitLoop + Min + EndOfInitLoop + Min + + +EndOfInitLoop + DoLoop + InitLoop + InitLoop + + +Switch + Odd + IsOdd + Gate + + +Switch + Even + EndSwitch + Default + + +Switch + Even + IsOdd + Even + + +375 + 111 + +375 + 172 + +Switch + a + IsOdd + a + + +362 + 82 + +360 + 201 + +EndSwitch + a + EndOfInitLoop + Index + + +BadInputOfLoop + Gate + EndOfInitLoop + Gate + + + +GraphBadInputInLoop3 + InitLoop__Index + InitLoop + Index + +3 + 0 + + +GraphBadInputInLoop3 + InitLoop__Min + InitLoop + Min + +3 + 0 + + +GraphBadInputInLoop3 + InitLoop__Max + InitLoop + Max + +3 + 100 + + +GraphBadInputInLoop3 + EndOfInitLoop__Max + EndOfInitLoop + Max + +3 + 136221856 + diff --git a/examples/GraphBadOutputOfLoop.py b/examples/GraphBadOutputOfLoop.py new file mode 100755 index 0000000..28c91d9 --- /dev/null +++ b/examples/GraphBadOutputOfLoop.py @@ -0,0 +1,164 @@ + +# Generated python file of Graph GraphBadOutputOfLoop + +from SuperV import * + +# Graph creation of GraphBadOutputOfLoop +def DefGraphBadOutputOfLoop() : + GraphBadOutputOfLoop = Graph( 'GraphBadOutputOfLoop' ) + GraphBadOutputOfLoop.SetName( 'GraphBadOutputOfLoop' ) + GraphBadOutputOfLoop.SetAuthor( '' ) + GraphBadOutputOfLoop.SetComment( '' ) + GraphBadOutputOfLoop.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsOdd = [] + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd(a,Even,InputInLoop) : ' ) + PyIsOdd.append( ' print a,"IsOdd (GraphLoopSwitch1)" ' ) + PyIsOdd.append( ' sleep( 1 ) ' ) + PyIsOdd.append( ' return a ' ) + IsOdd = GraphBadOutputOfLoop.INode( 'IsOdd' , PyIsOdd ) + IsOdd.SetName( 'IsOdd' ) + IsOdd.SetAuthor( '' ) + IsOdd.SetComment( 'Python function' ) + IsOdd.Coords( 397 , 1 ) + IIsOdda = IsOdd.InPort( 'a' , 'long' ) + IIsOddEven = IsOdd.InPort( 'Even' , 'boolean' ) + IIsOddInputInLoop = IsOdd.InPort( 'InputInLoop' , 'boolean' ) + IIsOddGate = IsOdd.GetInPort( 'Gate' ) + OIsOdda = IsOdd.OutPort( 'a' , 'long' ) + OIsOddGate = IsOdd.GetOutPort( 'Gate' ) + + PyBadOutputOfLoop = [] + PyBadOutputOfLoop.append( 'def BadOutputOfLoop() : ' ) + PyBadOutputOfLoop.append( ' return 1 ' ) + PyBadOutputOfLoop.append( '' ) + BadOutputOfLoop = GraphBadOutputOfLoop.INode( 'BadOutputOfLoop' , PyBadOutputOfLoop ) + BadOutputOfLoop.SetName( 'BadOutputOfLoop' ) + BadOutputOfLoop.SetAuthor( '' ) + BadOutputOfLoop.SetComment( 'Compute Node' ) + BadOutputOfLoop.Coords( 768 , 323 ) + IBadOutputOfLoopOutputOfLoop = BadOutputOfLoop.InPort( 'OutputOfLoop' , 'long' ) + IBadOutputOfLoopGate = BadOutputOfLoop.GetInPort( 'Gate' ) + OBadOutputOfLoopGate = BadOutputOfLoop.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyInitLoop = [] + PyMoreInitLoop = [] + PyMoreInitLoop.append( '' ) + PyNextInitLoop = [] + PyNextInitLoop.append( '' ) + InitLoop,EndOfInitLoop = GraphBadOutputOfLoop.LNode( '' , 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 ) + IInitLoopInitLoop = InitLoop.GetInPort( 'InitLoop' ) + 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' ) + 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 = GraphBadOutputOfLoop.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 = GraphBadOutputOfLoop.Link( OIsOdda , IEndSwitcha ) + LIsOddaEndSwitcha.AddCoord( 1 , 576 , 136 ) + LIsOddaEndSwitcha.AddCoord( 2 , 575 , 81 ) + + LInitLoopIndexSwitcha = GraphBadOutputOfLoop.Link( OInitLoopIndex , ISwitcha ) + + LInitLoopMinEndOfInitLoopMin = GraphBadOutputOfLoop.Link( OInitLoopMin , IEndOfInitLoopMin ) + + LSwitchOddIsOddGate = GraphBadOutputOfLoop.Link( OSwitchOdd , IIsOddGate ) + + LSwitchEvenEndSwitchDefault = GraphBadOutputOfLoop.Link( OSwitchEven , IEndSwitchDefault ) + + LSwitchEvenIsOddEven = GraphBadOutputOfLoop.Link( OSwitchEven , IIsOddEven ) + LSwitchEvenIsOddEven.AddCoord( 1 , 375 , 111 ) + LSwitchEvenIsOddEven.AddCoord( 2 , 375 , 172 ) + + LSwitchaIsOdda = GraphBadOutputOfLoop.Link( OSwitcha , IIsOdda ) + LSwitchaIsOdda.AddCoord( 1 , 362 , 82 ) + LSwitchaIsOdda.AddCoord( 2 , 360 , 201 ) + + LEndSwitchaEndOfInitLoopIndex = GraphBadOutputOfLoop.Link( OEndSwitcha , IEndOfInitLoopIndex ) + + LEndSwitchaBadOutputOfLoopOutputOfLoop = GraphBadOutputOfLoop.Link( OEndSwitcha , IBadOutputOfLoopOutputOfLoop ) + + # Input datas + IIsOddInputInLoop.Input( 136306160 ) + IInitLoopIndex.Input( 0 ) + IInitLoopMin.Input( 0 ) + IInitLoopMax.Input( 100 ) + IEndOfInitLoopMax.Input( 136221856 ) + + # Output Ports of the graph + #OInitLoopMax = InitLoop.GetOutPort( 'Max' ) + #OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) + #OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) + #OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) + return GraphBadOutputOfLoop + + +GraphBadOutputOfLoop = DefGraphBadOutputOfLoop() diff --git a/examples/GraphBadOutputOfLoop.xml b/examples/GraphBadOutputOfLoop.xml new file mode 100755 index 0000000..1965e84 --- /dev/null +++ b/examples/GraphBadOutputOfLoop.xml @@ -0,0 +1,415 @@ + + + + + +? + ? + GraphBadOutputOfLoop + 1 + ? + +GraphBadOutputOfLoop + + +boolean + IsOdd__InputInLoop + +long + InitLoop__Index + +long + InitLoop__Min + +long + InitLoop__Max + +long + EndOfInitLoop__Max + + +long + InitLoop__Max + +long + EndOfInitLoop__Index + +long + EndOfInitLoop__Min + +long + EndOfInitLoop__Max + + + 22/10/2003 - 10:36:39 + 14/12/2004 - 15:58:56 + 1.05 + ? + ? + ? + 0 + 0 + + +? + ? + IsOdd + 3 + ? + +IsOdd + + +long + a + +boolean + Even + +boolean + InputInLoop + + +long + a + + + +IsOdd + + + + + + 14/12/2004 - 15:58:56 + 14/12/2004 - 15:58:56 + 1.05 + ? + ? + Python function + 397 + 1 + +? + ? + InitLoop + 4 + EndOfInitLoop + +InitLoop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +? + + +? + + +? + + 14/12/2004 - 15:58:56 + 14/12/2004 - 15:58:56 + 1.05 + ? + ? + Compute Node + 10 + 108 + +? + ? + EndOfInitLoop + 5 + InitLoop + +EndOfInitLoop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +EndOfInitLoop + + + + + + + + 14/12/2004 - 15:58:56 + 14/12/2004 - 15:58:56 + 1.05 + ? + ? + Compute Node + 767 + 102 + +? + ? + Switch + 6 + EndSwitch + +Switch + + +long + a + + +long + Odd + +int + Even + +int + a + + + +Switch + + + + + + 14/12/2004 - 15:58:56 + 14/12/2004 - 15:58:56 + 1.05 + ? + ? + Compute Node + 194 + 109 + +? + ? + EndSwitch + 7 + Switch + +EndSwitch + + +long + a + + +long + a + + + +EndSwitch + + + + + 14/12/2004 - 15:58:56 + 14/12/2004 - 15:58:56 + 1.05 + ? + ? + Compute Node + 587 + 103 + +? + ? + BadOutputOfLoop + 3 + ? + +BadOutputOfLoop + + +long + OutputOfLoop + + + + +BadOutputOfLoop + + + + 14/12/2004 - 15:58:56 + 14/12/2004 - 15:58:56 + 2.0 + ? + ? + Compute Node + 768 + 323 + + +IsOdd + a + EndSwitch + a + + +576 + 136 + +575 + 81 + +InitLoop + DoLoop + EndOfInitLoop + DoLoop + + +InitLoop + Index + Switch + a + + +InitLoop + Min + EndOfInitLoop + Min + + +EndOfInitLoop + DoLoop + InitLoop + InitLoop + + +Switch + Odd + IsOdd + Gate + + +Switch + Even + EndSwitch + Default + + +Switch + Even + IsOdd + Even + + +375 + 111 + +375 + 172 + +Switch + a + IsOdd + a + + +362 + 82 + +360 + 201 + +EndSwitch + a + EndOfInitLoop + Index + + +EndSwitch + a + BadOutputOfLoop + OutputOfLoop + + + +GraphBadOutputOfLoop + IsOdd__InputInLoop + IsOdd + InputInLoop + +3 + 136306160 + + +GraphBadOutputOfLoop + InitLoop__Index + InitLoop + Index + +3 + 0 + + +GraphBadOutputOfLoop + InitLoop__Min + InitLoop + Min + +3 + 0 + + +GraphBadOutputOfLoop + InitLoop__Max + InitLoop + Max + +3 + 100 + + +GraphBadOutputOfLoop + EndOfInitLoop__Max + EndOfInitLoop + Max + +3 + 136221856 + diff --git a/examples/GraphBadOutputOfLoop1.py b/examples/GraphBadOutputOfLoop1.py new file mode 100755 index 0000000..3405c93 --- /dev/null +++ b/examples/GraphBadOutputOfLoop1.py @@ -0,0 +1,163 @@ + +# Generated python file of Graph GraphBadOutputOfLoop1 + +from SuperV import * + +# Graph creation of GraphBadOutputOfLoop1 +def DefGraphBadOutputOfLoop1() : + GraphBadOutputOfLoop1 = Graph( 'GraphBadOutputOfLoop1' ) + GraphBadOutputOfLoop1.SetName( 'GraphBadOutputOfLoop1' ) + GraphBadOutputOfLoop1.SetAuthor( '' ) + GraphBadOutputOfLoop1.SetComment( '' ) + GraphBadOutputOfLoop1.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsOdd = [] + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd(a,Even,InputInLoop) : ' ) + PyIsOdd.append( ' print a,"IsOdd (GraphLoopSwitch1)" ' ) + PyIsOdd.append( ' sleep( 1 ) ' ) + PyIsOdd.append( ' return a ' ) + IsOdd = GraphBadOutputOfLoop1.INode( 'IsOdd' , PyIsOdd ) + IsOdd.SetName( 'IsOdd' ) + IsOdd.SetAuthor( '' ) + IsOdd.SetComment( 'Python function' ) + IsOdd.Coords( 397 , 1 ) + IIsOdda = IsOdd.InPort( 'a' , 'long' ) + IIsOddEven = IsOdd.InPort( 'Even' , 'boolean' ) + IIsOddInputInLoop = IsOdd.InPort( 'InputInLoop' , 'boolean' ) + IIsOddGate = IsOdd.GetInPort( 'Gate' ) + OIsOdda = IsOdd.OutPort( 'a' , 'long' ) + OIsOddGate = IsOdd.GetOutPort( 'Gate' ) + + PyBadOutputOfLoop = [] + PyBadOutputOfLoop.append( 'def BadOutputOfLoop() : ' ) + PyBadOutputOfLoop.append( ' return 1 ' ) + PyBadOutputOfLoop.append( '' ) + BadOutputOfLoop = GraphBadOutputOfLoop1.INode( 'BadOutputOfLoop' , PyBadOutputOfLoop ) + BadOutputOfLoop.SetName( 'BadOutputOfLoop' ) + BadOutputOfLoop.SetAuthor( '' ) + BadOutputOfLoop.SetComment( 'Compute Node' ) + BadOutputOfLoop.Coords( 287 , 349 ) + IBadOutputOfLoopOutputOfLoop = BadOutputOfLoop.InPort( 'OutputOfLoop' , 'long' ) + IBadOutputOfLoopGate = BadOutputOfLoop.GetInPort( 'Gate' ) + OBadOutputOfLoopGate = BadOutputOfLoop.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyInitLoop = [] + PyMoreInitLoop = [] + PyMoreInitLoop.append( '' ) + PyNextInitLoop = [] + PyNextInitLoop.append( '' ) + InitLoop,EndOfInitLoop = GraphBadOutputOfLoop1.LNode( '' , 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 ) + IInitLoopInitLoop = InitLoop.GetInPort( 'InitLoop' ) + 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' ) + 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 = GraphBadOutputOfLoop1.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 = GraphBadOutputOfLoop1.Link( OIsOdda , IEndSwitcha ) + LIsOddaEndSwitcha.AddCoord( 1 , 576 , 136 ) + LIsOddaEndSwitcha.AddCoord( 2 , 575 , 81 ) + + LInitLoopIndexSwitcha = GraphBadOutputOfLoop1.Link( OInitLoopIndex , ISwitcha ) + + LInitLoopMinEndOfInitLoopMin = GraphBadOutputOfLoop1.Link( OInitLoopMin , IEndOfInitLoopMin ) + + LInitLoopMaxBadOutputOfLoopOutputOfLoop = GraphBadOutputOfLoop1.Link( OInitLoopMax , IBadOutputOfLoopOutputOfLoop ) + + LSwitchOddIsOddGate = GraphBadOutputOfLoop1.Link( OSwitchOdd , IIsOddGate ) + + LSwitchEvenEndSwitchDefault = GraphBadOutputOfLoop1.Link( OSwitchEven , IEndSwitchDefault ) + + LSwitchEvenIsOddEven = GraphBadOutputOfLoop1.Link( OSwitchEven , IIsOddEven ) + LSwitchEvenIsOddEven.AddCoord( 1 , 375 , 111 ) + LSwitchEvenIsOddEven.AddCoord( 2 , 375 , 172 ) + + LSwitchaIsOdda = GraphBadOutputOfLoop1.Link( OSwitcha , IIsOdda ) + LSwitchaIsOdda.AddCoord( 1 , 362 , 82 ) + LSwitchaIsOdda.AddCoord( 2 , 360 , 201 ) + + LEndSwitchaEndOfInitLoopIndex = GraphBadOutputOfLoop1.Link( OEndSwitcha , IEndOfInitLoopIndex ) + + # Input datas + IIsOddInputInLoop.Input( 136306160 ) + IInitLoopIndex.Input( 0 ) + IInitLoopMin.Input( 0 ) + IInitLoopMax.Input( 100 ) + IEndOfInitLoopMax.Input( 136221856 ) + + # Output Ports of the graph + #OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) + #OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) + #OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) + return GraphBadOutputOfLoop1 + + +GraphBadOutputOfLoop1 = DefGraphBadOutputOfLoop1() diff --git a/examples/GraphBadOutputOfLoop1.xml b/examples/GraphBadOutputOfLoop1.xml new file mode 100755 index 0000000..6f0ed94 --- /dev/null +++ b/examples/GraphBadOutputOfLoop1.xml @@ -0,0 +1,412 @@ + + + + + +? + ? + GraphBadOutputOfLoop1 + 1 + ? + +GraphBadOutputOfLoop1 + + +boolean + IsOdd__InputInLoop + +long + InitLoop__Index + +long + InitLoop__Min + +long + InitLoop__Max + +long + EndOfInitLoop__Max + + +long + EndOfInitLoop__Index + +long + EndOfInitLoop__Min + +long + EndOfInitLoop__Max + + + 22/10/2003 - 10:36:39 + 14/12/2004 - 15:59:22 + 1.05 + ? + ? + ? + 0 + 0 + + +? + ? + IsOdd + 3 + ? + +IsOdd + + +long + a + +boolean + Even + +boolean + InputInLoop + + +long + a + + + +IsOdd + + + + + + 14/12/2004 - 15:59:22 + 14/12/2004 - 15:59:22 + 1.05 + ? + ? + Python function + 397 + 1 + +? + ? + InitLoop + 4 + EndOfInitLoop + +InitLoop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +? + + +? + + +? + + 14/12/2004 - 15:59:22 + 14/12/2004 - 15:59:22 + 1.05 + ? + ? + Compute Node + 10 + 108 + +? + ? + EndOfInitLoop + 5 + InitLoop + +EndOfInitLoop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +EndOfInitLoop + + + + + + + + 14/12/2004 - 15:59:22 + 14/12/2004 - 15:59:22 + 1.05 + ? + ? + Compute Node + 767 + 102 + +? + ? + Switch + 6 + EndSwitch + +Switch + + +long + a + + +long + Odd + +int + Even + +int + a + + + +Switch + + + + + + 14/12/2004 - 15:59:22 + 14/12/2004 - 15:59:22 + 1.05 + ? + ? + Compute Node + 194 + 109 + +? + ? + EndSwitch + 7 + Switch + +EndSwitch + + +long + a + + +long + a + + + +EndSwitch + + + + + 14/12/2004 - 15:59:22 + 14/12/2004 - 15:59:22 + 1.05 + ? + ? + Compute Node + 587 + 103 + +? + ? + BadOutputOfLoop + 3 + ? + +BadOutputOfLoop + + +long + OutputOfLoop + + + + +BadOutputOfLoop + + + + 14/12/2004 - 15:59:22 + 14/12/2004 - 15:59:22 + 2.0 + ? + ? + Compute Node + 287 + 349 + + +IsOdd + a + EndSwitch + a + + +576 + 136 + +575 + 81 + +InitLoop + DoLoop + EndOfInitLoop + DoLoop + + +InitLoop + Index + Switch + a + + +InitLoop + Min + EndOfInitLoop + Min + + +InitLoop + Max + BadOutputOfLoop + OutputOfLoop + + +EndOfInitLoop + DoLoop + InitLoop + InitLoop + + +Switch + Odd + IsOdd + Gate + + +Switch + Even + EndSwitch + Default + + +Switch + Even + IsOdd + Even + + +375 + 111 + +375 + 172 + +Switch + a + IsOdd + a + + +362 + 82 + +360 + 201 + +EndSwitch + a + EndOfInitLoop + Index + + + +GraphBadOutputOfLoop1 + IsOdd__InputInLoop + IsOdd + InputInLoop + +3 + 136306160 + + +GraphBadOutputOfLoop1 + InitLoop__Index + InitLoop + Index + +3 + 0 + + +GraphBadOutputOfLoop1 + InitLoop__Min + InitLoop + Min + +3 + 0 + + +GraphBadOutputOfLoop1 + InitLoop__Max + InitLoop + Max + +3 + 100 + + +GraphBadOutputOfLoop1 + EndOfInitLoop__Max + EndOfInitLoop + Max + +3 + 136221856 + diff --git a/examples/GraphBadOutputOfLoop2.py b/examples/GraphBadOutputOfLoop2.py new file mode 100755 index 0000000..a0a71f1 --- /dev/null +++ b/examples/GraphBadOutputOfLoop2.py @@ -0,0 +1,164 @@ + +# Generated python file of Graph GraphBadOutputOfLoop2 + +from SuperV import * + +# Graph creation of GraphBadOutputOfLoop2 +def DefGraphBadOutputOfLoop2() : + GraphBadOutputOfLoop2 = Graph( 'GraphBadOutputOfLoop2' ) + GraphBadOutputOfLoop2.SetName( 'GraphBadOutputOfLoop2' ) + GraphBadOutputOfLoop2.SetAuthor( '' ) + GraphBadOutputOfLoop2.SetComment( '' ) + GraphBadOutputOfLoop2.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsOdd = [] + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd(a,Even,InputInLoop) : ' ) + PyIsOdd.append( ' print a,"IsOdd (GraphLoopSwitch1)" ' ) + PyIsOdd.append( ' sleep( 1 ) ' ) + PyIsOdd.append( ' return a ' ) + IsOdd = GraphBadOutputOfLoop2.INode( 'IsOdd' , PyIsOdd ) + IsOdd.SetName( 'IsOdd' ) + IsOdd.SetAuthor( '' ) + IsOdd.SetComment( 'Python function' ) + IsOdd.Coords( 397 , 1 ) + IIsOdda = IsOdd.InPort( 'a' , 'long' ) + IIsOddEven = IsOdd.InPort( 'Even' , 'boolean' ) + IIsOddInputInLoop = IsOdd.InPort( 'InputInLoop' , 'boolean' ) + IIsOddGate = IsOdd.GetInPort( 'Gate' ) + OIsOdda = IsOdd.OutPort( 'a' , 'long' ) + OIsOddGate = IsOdd.GetOutPort( 'Gate' ) + + PyBadOutputOfLoop = [] + PyBadOutputOfLoop.append( 'def BadOutputOfLoop() : ' ) + PyBadOutputOfLoop.append( ' return 1 ' ) + PyBadOutputOfLoop.append( '' ) + BadOutputOfLoop = GraphBadOutputOfLoop2.INode( 'BadOutputOfLoop' , PyBadOutputOfLoop ) + BadOutputOfLoop.SetName( 'BadOutputOfLoop' ) + BadOutputOfLoop.SetAuthor( '' ) + BadOutputOfLoop.SetComment( 'Compute Node' ) + BadOutputOfLoop.Coords( 503 , 338 ) + IBadOutputOfLoopOutputOfLoop = BadOutputOfLoop.InPort( 'OutputOfLoop' , 'long' ) + IBadOutputOfLoopGate = BadOutputOfLoop.GetInPort( 'Gate' ) + OBadOutputOfLoopGate = BadOutputOfLoop.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyInitLoop = [] + PyMoreInitLoop = [] + PyMoreInitLoop.append( '' ) + PyNextInitLoop = [] + PyNextInitLoop.append( '' ) + InitLoop,EndOfInitLoop = GraphBadOutputOfLoop2.LNode( '' , 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 ) + IInitLoopInitLoop = InitLoop.GetInPort( 'InitLoop' ) + 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' ) + 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 = GraphBadOutputOfLoop2.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 = GraphBadOutputOfLoop2.Link( OIsOdda , IEndSwitcha ) + LIsOddaEndSwitcha.AddCoord( 1 , 576 , 136 ) + LIsOddaEndSwitcha.AddCoord( 2 , 575 , 81 ) + + LInitLoopIndexSwitcha = GraphBadOutputOfLoop2.Link( OInitLoopIndex , ISwitcha ) + + LInitLoopMinEndOfInitLoopMin = GraphBadOutputOfLoop2.Link( OInitLoopMin , IEndOfInitLoopMin ) + + LSwitchOddIsOddGate = GraphBadOutputOfLoop2.Link( OSwitchOdd , IIsOddGate ) + + LSwitchEvenEndSwitchDefault = GraphBadOutputOfLoop2.Link( OSwitchEven , IEndSwitchDefault ) + + LSwitchEvenIsOddEven = GraphBadOutputOfLoop2.Link( OSwitchEven , IIsOddEven ) + LSwitchEvenIsOddEven.AddCoord( 1 , 375 , 111 ) + LSwitchEvenIsOddEven.AddCoord( 2 , 375 , 172 ) + + LSwitchaIsOdda = GraphBadOutputOfLoop2.Link( OSwitcha , IIsOdda ) + LSwitchaIsOdda.AddCoord( 1 , 362 , 82 ) + LSwitchaIsOdda.AddCoord( 2 , 360 , 201 ) + + LSwitchaBadOutputOfLoopOutputOfLoop = GraphBadOutputOfLoop2.Link( OSwitcha , IBadOutputOfLoopOutputOfLoop ) + + LEndSwitchaEndOfInitLoopIndex = GraphBadOutputOfLoop2.Link( OEndSwitcha , IEndOfInitLoopIndex ) + + # Input datas + IIsOddInputInLoop.Input( 136306160 ) + IInitLoopIndex.Input( 0 ) + IInitLoopMin.Input( 0 ) + IInitLoopMax.Input( 100 ) + IEndOfInitLoopMax.Input( 136221856 ) + + # Output Ports of the graph + #OInitLoopMax = InitLoop.GetOutPort( 'Max' ) + #OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) + #OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) + #OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) + return GraphBadOutputOfLoop2 + + +GraphBadOutputOfLoop2 = DefGraphBadOutputOfLoop2() diff --git a/examples/GraphBadOutputOfLoop2.xml b/examples/GraphBadOutputOfLoop2.xml new file mode 100755 index 0000000..83617b0 --- /dev/null +++ b/examples/GraphBadOutputOfLoop2.xml @@ -0,0 +1,415 @@ + + + + + +? + ? + GraphBadOutputOfLoop2 + 1 + ? + +GraphBadOutputOfLoop2 + + +boolean + IsOdd__InputInLoop + +long + InitLoop__Index + +long + InitLoop__Min + +long + InitLoop__Max + +long + EndOfInitLoop__Max + + +long + InitLoop__Max + +long + EndOfInitLoop__Index + +long + EndOfInitLoop__Min + +long + EndOfInitLoop__Max + + + 22/10/2003 - 10:36:39 + 14/12/2004 - 15:59:49 + 1.05 + ? + ? + ? + 0 + 0 + + +? + ? + IsOdd + 3 + ? + +IsOdd + + +long + a + +boolean + Even + +boolean + InputInLoop + + +long + a + + + +IsOdd + + + + + + 14/12/2004 - 15:59:49 + 14/12/2004 - 15:59:49 + 1.05 + ? + ? + Python function + 397 + 1 + +? + ? + InitLoop + 4 + EndOfInitLoop + +InitLoop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +? + + +? + + +? + + 14/12/2004 - 15:59:49 + 14/12/2004 - 15:59:49 + 1.05 + ? + ? + Compute Node + 10 + 108 + +? + ? + EndOfInitLoop + 5 + InitLoop + +EndOfInitLoop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +EndOfInitLoop + + + + + + + + 14/12/2004 - 15:59:49 + 14/12/2004 - 15:59:49 + 1.05 + ? + ? + Compute Node + 767 + 102 + +? + ? + Switch + 6 + EndSwitch + +Switch + + +long + a + + +long + Odd + +int + Even + +int + a + + + +Switch + + + + + + 14/12/2004 - 15:59:49 + 14/12/2004 - 15:59:49 + 1.05 + ? + ? + Compute Node + 194 + 109 + +? + ? + EndSwitch + 7 + Switch + +EndSwitch + + +long + a + + +long + a + + + +EndSwitch + + + + + 14/12/2004 - 15:59:49 + 14/12/2004 - 15:59:49 + 1.05 + ? + ? + Compute Node + 587 + 103 + +? + ? + BadOutputOfLoop + 3 + ? + +BadOutputOfLoop + + +long + OutputOfLoop + + + + +BadOutputOfLoop + + + + 14/12/2004 - 15:59:49 + 14/12/2004 - 15:59:49 + 2.0 + ? + ? + Compute Node + 503 + 338 + + +IsOdd + a + EndSwitch + a + + +576 + 136 + +575 + 81 + +InitLoop + DoLoop + EndOfInitLoop + DoLoop + + +InitLoop + Index + Switch + a + + +InitLoop + Min + EndOfInitLoop + Min + + +EndOfInitLoop + DoLoop + InitLoop + InitLoop + + +Switch + Odd + IsOdd + Gate + + +Switch + Even + EndSwitch + Default + + +Switch + Even + IsOdd + Even + + +375 + 111 + +375 + 172 + +Switch + a + IsOdd + a + + +362 + 82 + +360 + 201 + +Switch + a + BadOutputOfLoop + OutputOfLoop + + +EndSwitch + a + EndOfInitLoop + Index + + + +GraphBadOutputOfLoop2 + IsOdd__InputInLoop + IsOdd + InputInLoop + +3 + 136306160 + + +GraphBadOutputOfLoop2 + InitLoop__Index + InitLoop + Index + +3 + 0 + + +GraphBadOutputOfLoop2 + InitLoop__Min + InitLoop + Min + +3 + 0 + + +GraphBadOutputOfLoop2 + InitLoop__Max + InitLoop + Max + +3 + 100 + + +GraphBadOutputOfLoop2 + EndOfInitLoop__Max + EndOfInitLoop + Max + +3 + 136221856 + diff --git a/examples/GraphGOTO.py b/examples/GraphGOTO.py index 00b7414..d6af11f 100644 --- a/examples/GraphGOTO.py +++ b/examples/GraphGOTO.py @@ -2,277 +2,295 @@ # Generated python file of Graph GraphGOTO from SuperV import * -# Graph creation -GraphGOTO = Graph( 'GraphGOTO' ) -GraphGOTO.SetName( 'GraphGOTO' ) -GraphGOTO.SetAuthor( 'JR' ) -GraphGOTO.SetComment( 'Syracuse algorithm' ) -GraphGOTO.Coords( 0 , 0 ) -# Creation of Factory Nodes - -test_ISEVEN = GraphGOTO.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( 195 , 417 ) - -test_ISONE = GraphGOTO.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 , 145 ) - -m3p1 = GraphGOTO.FNode( 'SyrComponent' , 'SyrComponent' , 'C_M3P1' ) -m3p1.SetName( 'm3p1' ) -m3p1.SetAuthor( '' ) -m3p1.SetContainer( 'localhost/FactoryServer' ) -m3p1.SetComment( 'C_M3P1 from SyrComponent' ) -m3p1.Coords( 784 , 36 ) - -div2 = GraphGOTO.FNode( 'SyrComponent' , 'SyrComponent' , 'C_DIV2' ) -div2.SetName( 'div2' ) -div2.SetAuthor( '' ) -div2.SetContainer( 'localhost/FactoryServer' ) -div2.SetComment( 'C_DIV2 from SyrComponent' ) -div2.Coords( 788 , 409 ) - -incr = GraphGOTO.FNode( 'SyrComponent' , 'SyrComponent' , 'C_INCR' ) -incr.SetName( 'incr' ) -incr.SetAuthor( '' ) -incr.SetContainer( 'localhost/FactoryServer' ) -incr.SetComment( 'C_INCR from SyrComponent' ) -incr.Coords( 788 , 230 ) - -# 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 = GraphGOTO.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( 9 , 250 ) - -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 = GraphGOTO.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( 396 , 193 ) - -# 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 = GraphGOTO.SNode( 'Switch_OneEven' , Pytest ) -EndSwitch_OneEven.SetName( 'EndSwitch_OneEven' ) -EndSwitch_OneEven.SetAuthor( '' ) -EndSwitch_OneEven.SetComment( '' ) -EndSwitch_OneEven.Coords( 1152 , 292 ) -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( 595 , 239 ) - -# Creation of GOTO Nodes -Pycontrol_m3p1 = [] -Pycontrol_m3p1.append( 'def control_m3p1( N , K ):' ) -Pycontrol_m3p1.append( ' return 0,1,N,K' ) -control_m3p1 = GraphGOTO.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( 980 , 81 ) - -Pycontrol_div2 = [] -Pycontrol_div2.append( 'def control_div2( N , NB ) :' ) -Pycontrol_div2.append( ' return N,NB' ) -control_div2 = GraphGOTO.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( 1039 , 454 ) - -# Creation of Links -test_ISEVENBoolEven = test_ISEVEN.Port( 'BoolEven' ) -label_testValEven = GraphGOTO.Link( test_ISEVENBoolEven , label_test.Port( 'ValEven' ) ) -label_testValEven.AddCoord( 1 , 369 , 273 ) -label_testValEven.AddCoord( 2 , 370 , 498 ) - -test_ISONEBoolOne = test_ISONE.Port( 'BoolOne' ) -label_testValOne = GraphGOTO.Link( test_ISONEBoolOne , label_test.Port( 'ValOne' ) ) -label_testValOne.AddCoord( 1 , 385 , 303 ) -label_testValOne.AddCoord( 2 , 384 , 225 ) - -m3p1anEvenInteger = m3p1.Port( 'anEvenInteger' ) -control_m3p1N = GraphGOTO.Link( m3p1anEvenInteger , control_m3p1.Port( 'N' ) ) - -div2anInteger = div2.Port( 'anInteger' ) -control_div2N = GraphGOTO.Link( div2anInteger , control_div2.Port( 'N' ) ) - -incraNewCount = incr.Port( 'aNewCount' ) -control_m3p1K = GraphGOTO.Link( incraNewCount , control_m3p1.Port( 'K' ) ) -control_m3p1K.AddCoord( 1 , 964 , 145 ) -control_m3p1K.AddCoord( 2 , 964 , 309 ) - -control_div2K = GraphGOTO.Link( incraNewCount , control_div2.Port( 'K' ) ) -control_div2K.AddCoord( 1 , 963 , 518 ) -control_div2K.AddCoord( 2 , 964 , 312 ) - -label_beginNT = label_begin.Port( 'NT' ) -label_testNT = GraphGOTO.Link( label_beginNT , label_test.Port( 'NT' ) ) - -test_ISONEanInteger = GraphGOTO.Link( label_beginNT , test_ISONE.Port( 'anInteger' ) ) -test_ISONEanInteger.AddCoord( 1 , 192 , 226 ) -test_ISONEanInteger.AddCoord( 2 , 191 , 331 ) - -test_ISEVENanInteger = GraphGOTO.Link( label_beginNT , test_ISEVEN.Port( 'anInteger' ) ) -test_ISEVENanInteger.AddCoord( 1 , 191 , 494 ) -test_ISEVENanInteger.AddCoord( 2 , 192 , 331 ) - -label_beginKT = label_begin.Port( 'KT' ) -label_testKT = GraphGOTO.Link( label_beginKT , label_test.Port( 'KT' ) ) - -label_testValEven = label_test.Port( 'ValEven' ) -testValEven = GraphGOTO.Link( label_testValEven , test.Port( 'ValEven' ) ) -testValEven.AddCoord( 1 , 587 , 318 ) -testValEven.AddCoord( 2 , 570 , 318 ) -testValEven.AddCoord( 3 , 569 , 272 ) - -label_testValOne = label_test.Port( 'ValOne' ) -testValOne = GraphGOTO.Link( label_testValOne , test.Port( 'ValOne' ) ) -testValOne.AddCoord( 1 , 585 , 273 ) -testValOne.AddCoord( 2 , 586 , 303 ) - -label_testNT = label_test.Port( 'NT' ) -testNT = GraphGOTO.Link( label_testNT , test.Port( 'NT' ) ) - -label_testKT = label_test.Port( 'KT' ) -testKT = GraphGOTO.Link( label_testKT , test.Port( 'KT' ) ) - -testFinished = test.Port( 'Finished' ) -EndSwitch_OneEvenFinished = GraphGOTO.Link( testFinished , EndSwitch_OneEven.Port( 'Finished' ) ) - -testIncr = test.Port( 'Incr' ) -incrInGate = GraphGOTO.Link( testIncr , incr.Port( 'InGate' ) ) -incrInGate.AddCoord( 1 , 783 , 341 ) -incrInGate.AddCoord( 2 , 782 , 302 ) - -testEven = test.Port( 'Even' ) -div2InGate = GraphGOTO.Link( testEven , div2.Port( 'InGate' ) ) -div2InGate.AddCoord( 1 , 754 , 518 ) -div2InGate.AddCoord( 2 , 753 , 330 ) - -testOdd = test.Port( 'Odd' ) -m3p1InGate = GraphGOTO.Link( testOdd , m3p1.Port( 'InGate' ) ) -m3p1InGate.AddCoord( 1 , 758 , 145 ) -m3p1InGate.AddCoord( 2 , 760 , 359 ) - -testN = test.Port( 'N' ) -m3p1anOddInteger = GraphGOTO.Link( testN , m3p1.Port( 'anOddInteger' ) ) -m3p1anOddInteger.AddCoord( 1 , 767 , 116 ) -m3p1anOddInteger.AddCoord( 2 , 767 , 116 ) -m3p1anOddInteger.AddCoord( 3 , 767 , 390 ) - -div2anEvenInteger = GraphGOTO.Link( testN , div2.Port( 'anEvenInteger' ) ) -div2anEvenInteger.AddCoord( 1 , 767 , 489 ) -div2anEvenInteger.AddCoord( 2 , 766 , 389 ) - -testK = test.Port( 'K' ) -EndSwitch_OneEvenK = GraphGOTO.Link( testK , EndSwitch_OneEven.Port( 'K' ) ) - -incraCount = GraphGOTO.Link( testK , incr.Port( 'aCount' ) ) -incraCount.AddCoord( 1 , 772 , 311 ) -incraCount.AddCoord( 2 , 772 , 417 ) -incraCount.AddCoord( 3 , 772 , 417 ) - -testDefault = test.Port( 'Default' ) -EndSwitch_OneEvenDefault = GraphGOTO.Link( testDefault , EndSwitch_OneEven.Port( 'Default' ) ) -EndSwitch_OneEvenDefault.AddCoord( 1 , 778 , 384 ) -EndSwitch_OneEvenDefault.AddCoord( 2 , 778 , 448 ) - -control_m3p1OutGate = control_m3p1.Port( 'OutGate' ) -label_testInGate = GraphGOTO.Link( control_m3p1OutGate , label_test.Port( 'InGate' ) ) -label_testInGate.AddCoord( 1 , 388 , 388 ) -label_testInGate.AddCoord( 2 , 389 , 597 ) -label_testInGate.AddCoord( 3 , 1319 , 597 ) -label_testInGate.AddCoord( 4 , 1318 , 231 ) - -control_div2OutGate = control_div2.Port( 'OutGate' ) -label_beginInGate = GraphGOTO.Link( control_div2OutGate , label_begin.Port( 'InGate' ) ) -label_beginInGate.AddCoord( 1 , 4 , 388 ) -label_beginInGate.AddCoord( 2 , 3 , 587 ) -label_beginInGate.AddCoord( 3 , 1214 , 588 ) -label_beginInGate.AddCoord( 4 , 1213 , 546 ) - -# 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' ) +# Graph creation of GraphGOTO +def DefGraphGOTO() : + GraphGOTO = Graph( 'GraphGOTO' ) + GraphGOTO.SetName( 'GraphGOTO' ) + GraphGOTO.SetAuthor( 'JR' ) + GraphGOTO.SetComment( 'Syracuse algorithm' ) + GraphGOTO.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + test_ISEVEN = GraphGOTO.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( 195 , 417 ) + 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 = GraphGOTO.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 , 145 ) + 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 = GraphGOTO.FNode( 'SyrComponent' , 'SyrComponent' , 'C_M3P1' ) + m3p1.SetName( 'm3p1' ) + m3p1.SetAuthor( '' ) + m3p1.SetContainer( 'localhost/FactoryServer' ) + m3p1.SetComment( 'C_M3P1 from SyrComponent' ) + m3p1.Coords( 784 , 36 ) + Im3p1anOddInteger = m3p1.GetInPort( 'anOddInteger' ) + Im3p1Gate = m3p1.GetInPort( 'Gate' ) + Om3p1anEvenInteger = m3p1.GetOutPort( 'anEvenInteger' ) + Om3p1Gate = m3p1.GetOutPort( 'Gate' ) + + div2 = GraphGOTO.FNode( 'SyrComponent' , 'SyrComponent' , 'C_DIV2' ) + div2.SetName( 'div2' ) + div2.SetAuthor( '' ) + div2.SetContainer( 'localhost/FactoryServer' ) + div2.SetComment( 'C_DIV2 from SyrComponent' ) + div2.Coords( 788 , 409 ) + Idiv2anEvenInteger = div2.GetInPort( 'anEvenInteger' ) + Idiv2Gate = div2.GetInPort( 'Gate' ) + Odiv2anInteger = div2.GetOutPort( 'anInteger' ) + Odiv2Gate = div2.GetOutPort( 'Gate' ) + + incr = GraphGOTO.FNode( 'SyrComponent' , 'SyrComponent' , 'C_INCR' ) + incr.SetName( 'incr' ) + incr.SetAuthor( '' ) + incr.SetContainer( 'localhost/FactoryServer' ) + incr.SetComment( 'C_INCR from SyrComponent' ) + incr.Coords( 788 , 230 ) + 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 = GraphGOTO.INode( 'label_begin' , Pylabel_begin ) + label_begin.SetName( 'label_begin' ) + label_begin.SetAuthor( '' ) + label_begin.SetComment( 'Python function' ) + label_begin.Coords( 9 , 250 ) + 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 = GraphGOTO.INode( 'label_test' , Pylabel_test ) + label_test.SetName( 'label_test' ) + label_test.SetAuthor( '' ) + label_test.SetComment( 'Python function' ) + label_test.Coords( 396 , 193 ) + 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 = GraphGOTO.SNode( 'Switch_OneEven' , Pytest ) + EndSwitch_OneEven.SetName( 'EndSwitch_OneEven' ) + EndSwitch_OneEven.SetAuthor( '' ) + EndSwitch_OneEven.SetComment( 'Compute Node' ) + EndSwitch_OneEven.Coords( 1152 , 292 ) + 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( 595 , 239 ) + 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 = GraphGOTO.GNode( 'control_m3p1' , Pycontrol_m3p1 , 'label_test' ) + control_m3p1.SetName( 'control_m3p1' ) + control_m3p1.SetAuthor( '' ) + control_m3p1.SetComment( 'Compute Node' ) + control_m3p1.Coords( 980 , 81 ) + 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 = GraphGOTO.GNode( 'control_div2' , Pycontrol_div2 , 'label_begin' ) + control_div2.SetName( 'control_div2' ) + control_div2.SetAuthor( '' ) + control_div2.SetComment( 'Compute Node' ) + control_div2.Coords( 1039 , 454 ) + 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 = GraphGOTO.Link( Otest_ISEVENBoolEven , Ilabel_testValEven ) + Ltest_ISEVENBoolEvenlabel_testValEven.AddCoord( 1 , 369 , 273 ) + Ltest_ISEVENBoolEvenlabel_testValEven.AddCoord( 2 , 370 , 498 ) + + Ltest_ISONEBoolOnelabel_testValOne = GraphGOTO.Link( Otest_ISONEBoolOne , Ilabel_testValOne ) + Ltest_ISONEBoolOnelabel_testValOne.AddCoord( 1 , 385 , 303 ) + Ltest_ISONEBoolOnelabel_testValOne.AddCoord( 2 , 384 , 225 ) + + Lm3p1anEvenIntegercontrol_m3p1N = GraphGOTO.Link( Om3p1anEvenInteger , Icontrol_m3p1N ) + + Ldiv2anIntegercontrol_div2N = GraphGOTO.Link( Odiv2anInteger , Icontrol_div2N ) + + LincraNewCountcontrol_m3p1K = GraphGOTO.Link( OincraNewCount , Icontrol_m3p1K ) + LincraNewCountcontrol_m3p1K.AddCoord( 1 , 964 , 145 ) + LincraNewCountcontrol_m3p1K.AddCoord( 2 , 964 , 309 ) + + LincraNewCountcontrol_div2K = GraphGOTO.Link( OincraNewCount , Icontrol_div2K ) + LincraNewCountcontrol_div2K.AddCoord( 1 , 963 , 518 ) + LincraNewCountcontrol_div2K.AddCoord( 2 , 964 , 312 ) + + Llabel_beginNTlabel_testNT = GraphGOTO.Link( Olabel_beginNT , Ilabel_testNT ) + + Llabel_beginNTtest_ISONEanInteger = GraphGOTO.Link( Olabel_beginNT , Itest_ISONEanInteger ) + Llabel_beginNTtest_ISONEanInteger.AddCoord( 1 , 192 , 226 ) + Llabel_beginNTtest_ISONEanInteger.AddCoord( 2 , 191 , 331 ) + + Llabel_beginNTtest_ISEVENanInteger = GraphGOTO.Link( Olabel_beginNT , Itest_ISEVENanInteger ) + Llabel_beginNTtest_ISEVENanInteger.AddCoord( 1 , 191 , 494 ) + Llabel_beginNTtest_ISEVENanInteger.AddCoord( 2 , 192 , 331 ) + + Llabel_beginKTlabel_testKT = GraphGOTO.Link( Olabel_beginKT , Ilabel_testKT ) + + Llabel_testValEventestValEven = GraphGOTO.Link( Olabel_testValEven , ItestValEven ) + Llabel_testValEventestValEven.AddCoord( 1 , 587 , 318 ) + Llabel_testValEventestValEven.AddCoord( 2 , 570 , 318 ) + Llabel_testValEventestValEven.AddCoord( 3 , 569 , 272 ) + + Llabel_testValOnetestValOne = GraphGOTO.Link( Olabel_testValOne , ItestValOne ) + Llabel_testValOnetestValOne.AddCoord( 1 , 585 , 273 ) + Llabel_testValOnetestValOne.AddCoord( 2 , 586 , 303 ) + + Llabel_testNTtestNT = GraphGOTO.Link( Olabel_testNT , ItestNT ) + + Llabel_testKTtestKT = GraphGOTO.Link( Olabel_testKT , ItestKT ) + + LtestFinishedEndSwitch_OneEvenFinished = GraphGOTO.Link( OtestFinished , IEndSwitch_OneEvenFinished ) + + LtestIncrincrGate = GraphGOTO.Link( OtestIncr , IincrGate ) + LtestIncrincrGate.AddCoord( 1 , 783 , 341 ) + LtestIncrincrGate.AddCoord( 2 , 782 , 302 ) + + LtestEvendiv2Gate = GraphGOTO.Link( OtestEven , Idiv2Gate ) + LtestEvendiv2Gate.AddCoord( 1 , 754 , 518 ) + LtestEvendiv2Gate.AddCoord( 2 , 753 , 330 ) + + LtestOddm3p1Gate = GraphGOTO.Link( OtestOdd , Im3p1Gate ) + LtestOddm3p1Gate.AddCoord( 1 , 758 , 145 ) + LtestOddm3p1Gate.AddCoord( 2 , 760 , 359 ) + + LtestNm3p1anOddInteger = GraphGOTO.Link( OtestN , Im3p1anOddInteger ) + LtestNm3p1anOddInteger.AddCoord( 1 , 767 , 116 ) + LtestNm3p1anOddInteger.AddCoord( 2 , 767 , 116 ) + LtestNm3p1anOddInteger.AddCoord( 3 , 767 , 390 ) + + LtestNdiv2anEvenInteger = GraphGOTO.Link( OtestN , Idiv2anEvenInteger ) + LtestNdiv2anEvenInteger.AddCoord( 1 , 767 , 489 ) + LtestNdiv2anEvenInteger.AddCoord( 2 , 766 , 389 ) + + LtestKEndSwitch_OneEvenK = GraphGOTO.Link( OtestK , IEndSwitch_OneEvenK ) + + LtestKincraCount = GraphGOTO.Link( OtestK , IincraCount ) + LtestKincraCount.AddCoord( 1 , 772 , 311 ) + LtestKincraCount.AddCoord( 2 , 772 , 417 ) + LtestKincraCount.AddCoord( 3 , 772 , 417 ) + + LtestDefaultEndSwitch_OneEvenDefault = GraphGOTO.Link( OtestDefault , IEndSwitch_OneEvenDefault ) + LtestDefaultEndSwitch_OneEvenDefault.AddCoord( 1 , 778 , 384 ) + LtestDefaultEndSwitch_OneEvenDefault.AddCoord( 2 , 778 , 448 ) + + Lcontrol_m3p1Gatelabel_testGate = GraphGOTO.Link( Ocontrol_m3p1Gate , Ilabel_testGate ) + Lcontrol_m3p1Gatelabel_testGate.AddCoord( 1 , 388 , 388 ) + Lcontrol_m3p1Gatelabel_testGate.AddCoord( 2 , 389 , 597 ) + Lcontrol_m3p1Gatelabel_testGate.AddCoord( 3 , 1319 , 597 ) + Lcontrol_m3p1Gatelabel_testGate.AddCoord( 4 , 1318 , 231 ) + + Lcontrol_div2Gatelabel_beginGate = GraphGOTO.Link( Ocontrol_div2Gate , Ilabel_beginGate ) + Lcontrol_div2Gatelabel_beginGate.AddCoord( 1 , 4 , 388 ) + Lcontrol_div2Gatelabel_beginGate.AddCoord( 2 , 3 , 587 ) + Lcontrol_div2Gatelabel_beginGate.AddCoord( 3 , 1214 , 588 ) + Lcontrol_div2Gatelabel_beginGate.AddCoord( 4 , 1213 , 546 ) + + # Input datas + Ilabel_beginNB.Input( 7 ) + Ilabel_beginKB.Input( 0 ) + + # Output Ports of the graph + #OEndSwitch_OneEvenFinished = EndSwitch_OneEven.GetOutPort( 'Finished' ) + #OEndSwitch_OneEvenK = EndSwitch_OneEven.GetOutPort( 'K' ) + return GraphGOTO + + +GraphGOTO = DefGraphGOTO() GraphGOTO.Run() diff --git a/examples/GraphGOTO.xml b/examples/GraphGOTO.xml index 27ba57d..967674f 100644 --- a/examples/GraphGOTO.xml +++ b/examples/GraphGOTO.xml @@ -1,727 +1,728 @@ - + + ? - ? - GraphSyrControl - 1 - ? - + ? + GraphGOTO + 1 + ? + GraphSyrControl - + long - label_begin\NB - + label_begin__NB + long - label_begin\KB - + label_begin__KB + long - EndSwitch_OneEven\Finished - + EndSwitch_OneEven__Finished + long - EndSwitch_OneEven\K - - - 11/3/2003 - 18:34:21 - 18/9/2003 - 17:27:23 - 1.04 - JR - ? - Syracuse algorithm - 0 - 0 - + EndSwitch_OneEven__K + + + 11/3/2003 - 18:34:21 + 14/12/2004 - 15:48:37 + 1.04 + JR + ? + Syracuse algorithm + 0 + 0 + SyrComponent - SyrComponent - test_ISEVEN - 0 - ? - + SyrComponent + test_ISEVEN + 0 + ? + C_ISEVEN - + long - anInteger - + anInteger + long - BoolEven - - - 18/9/2003 - 17:27:22 - 18/9/2003 - 17:27:22 - 1.04 - ? - localhost/FactoryServer - C_ISEVEN from SyrComponent - 195 - 417 - + BoolEven + + + 14/12/2004 - 15:48:37 + 14/12/2004 - 15:48:37 + 1.04 + ? + localhost/FactoryServer + C_ISEVEN from SyrComponent + 195 + 417 + SyrComponent - SyrComponent - test_ISONE - 0 - ? - + SyrComponent + test_ISONE + 0 + ? + C_ISONE - + long - anInteger - + anInteger + long - BoolOne - - - 18/9/2003 - 17:27:22 - 18/9/2003 - 17:27:22 - 1.04 - ? - localhost/FactoryServer - C_ISONE from SyrComponent - 201 - 145 - + BoolOne + + + 14/12/2004 - 15:48:37 + 14/12/2004 - 15:48:37 + 1.04 + ? + localhost/FactoryServer + C_ISONE from SyrComponent + 201 + 145 + SyrComponent - SyrComponent - m3p1 - 0 - ? - + SyrComponent + m3p1 + 0 + ? + C_M3P1 - + long - anOddInteger - + anOddInteger + long - anEvenInteger - - - 18/9/2003 - 17:27:22 - 18/9/2003 - 17:27:22 - 1.04 - ? - localhost/FactoryServer - C_M3P1 from SyrComponent - 784 - 36 - + anEvenInteger + + + 14/12/2004 - 15:48:37 + 14/12/2004 - 15:48:37 + 1.04 + ? + localhost/FactoryServer + C_M3P1 from SyrComponent + 784 + 36 + SyrComponent - SyrComponent - div2 - 0 - ? - + SyrComponent + div2 + 0 + ? + C_DIV2 - + long - anEvenInteger - + anEvenInteger + long - anInteger - - - 18/9/2003 - 17:27:22 - 18/9/2003 - 17:27:22 - 1.04 - ? - localhost/FactoryServer - C_DIV2 from SyrComponent - 788 - 409 - + anInteger + + + 14/12/2004 - 15:48:37 + 14/12/2004 - 15:48:37 + 1.04 + ? + localhost/FactoryServer + C_DIV2 from SyrComponent + 788 + 409 + SyrComponent - SyrComponent - incr - 0 - ? - + SyrComponent + incr + 0 + ? + C_INCR - + long - aCount - + aCount + long - aNewCount - - - 18/9/2003 - 17:27:23 - 18/9/2003 - 17:27:23 - 1.04 - ? - localhost/FactoryServer - C_INCR from SyrComponent - 788 - 230 - + aNewCount + + + 14/12/2004 - 15:48:37 + 14/12/2004 - 15:48:37 + 1.04 + ? + localhost/FactoryServer + C_INCR from SyrComponent + 788 + 230 + ? - ? - label_begin - 3 - ? - + ? + label_begin + 3 + ? + label_begin - + long - NB - + NB + long - KB - + KB + long - NT - + NT + long - KT - - + KT + + label_begin - - - - 18/9/2003 - 17:27:23 - 18/9/2003 - 17:27:23 - 1.04 - ? - ? - Python function - 9 - 250 - + + + + 14/12/2004 - 15:48:37 + 14/12/2004 - 15:48:37 + 1.04 + ? + ? + Python function + 9 + 250 + ? - ? - 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/9/2003 - 17:27:23 - 18/9/2003 - 17:27:23 - 1.04 - ? - ? - Python function - 396 - 193 - + + + + 14/12/2004 - 15:48:37 + 14/12/2004 - 15:48:37 + 1.04 + ? + ? + Python function + 396 + 193 + ? - ? - 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 - - - - - - - - - - - - - - - - 18/9/2003 - 17:27:23 - 18/9/2003 - 17:27:23 - 1.04 - ? - ? - ? - 595 - 239 - + + + + + + + + + + + + + + + + 14/12/2004 - 15:48:37 + 14/12/2004 - 15:48:37 + 1.04 + ? + ? + Compute Node + 595 + 239 + ? - ? - EndSwitch_OneEven - 7 - test - + ? + EndSwitch_OneEven + 7 + test + EndSwitch_OneEven - + long - Finished - + Finished + long - K - + K + long - Finished - + Finished + long - K - - + K + + EndSwitch_OneEven - - - - 18/9/2003 - 17:27:23 - 18/9/2003 - 17:27:23 - 1.04 - ? - ? - ? - 1152 - 292 - + + + + 14/12/2004 - 15:48:37 + 14/12/2004 - 15:48:37 + 1.04 + ? + ? + Compute Node + 1152 + 292 + ? - ? - 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/9/2003 - 17:27:23 - 18/9/2003 - 17:27:23 - 1.04 - ? - ? - ? - 980 - 81 - + + + 14/12/2004 - 15:48:37 + 14/12/2004 - 15:48:37 + 1.04 + ? + ? + Compute Node + 980 + 81 + ? - ? - 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/9/2003 - 17:27:23 - 18/9/2003 - 17:27:23 - 1.04 - ? - ? - ? - 1039 - 454 - + + + 14/12/2004 - 15:48:37 + 14/12/2004 - 15:48:37 + 1.04 + ? + ? + Compute Node + 1039 + 454 + test_ISEVEN - BoolEven - label_test - ValEven - + BoolEven + label_test + ValEven + 369 - 273 - + 273 + 370 - 498 - + 498 + test_ISONE - BoolOne - label_test - ValOne - + BoolOne + label_test + ValOne + 385 - 303 - + 303 + 384 - 225 - + 225 + 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 + 964 - 145 - + 145 + 964 - 309 - + 309 + incr - aNewCount - control_div2 - K - + aNewCount + control_div2 + K + 963 - 518 - + 518 + 964 - 312 - + 312 + label_begin - NT - label_test - NT - - + NT + label_test + NT + + label_begin - NT - test_ISONE - anInteger - + NT + test_ISONE + anInteger + 192 - 226 - + 226 + 191 - 331 - + 331 + label_begin - NT - test_ISEVEN - anInteger - + NT + test_ISEVEN + anInteger + 191 - 494 - + 494 + 192 - 331 - + 331 + label_begin - KT - label_test - KT - - + KT + label_test + KT + + label_test - ValEven - test - ValEven - + ValEven + test + ValEven + 587 - 318 - + 318 + 570 - 318 - + 318 + 569 - 272 - + 272 + label_test - ValOne - test - ValOne - + ValOne + test + ValOne + 585 - 273 - + 273 + 586 - 303 - + 303 + label_test - NT - test - NT - - + NT + test + NT + + label_test - KT - test - KT - - + KT + test + KT + + test - Finished - EndSwitch_OneEven - Finished - - + Finished + EndSwitch_OneEven + Finished + + test - Incr - incr - InGate - + Incr + incr + Gate + 783 - 341 - + 341 + 782 - 302 - + 302 + test - Even - div2 - InGate - + Even + div2 + Gate + 754 - 518 - + 518 + 753 - 330 - + 330 + test - Odd - m3p1 - InGate - + Odd + m3p1 + Gate + 758 - 145 - + 145 + 760 - 359 - + 359 + test - N - m3p1 - anOddInteger - + N + m3p1 + anOddInteger + 767 - 116 - + 116 + 767 - 116 - + 116 + 767 - 390 - + 390 + test - N - div2 - anEvenInteger - + N + div2 + anEvenInteger + 767 - 489 - + 489 + 766 - 389 - + 389 + test - K - EndSwitch_OneEven - K - - + K + EndSwitch_OneEven + K + + test - K - incr - aCount - + K + incr + aCount + 772 - 311 - + 311 + 772 - 417 - + 417 + 772 - 417 - + 417 + test - Default - EndSwitch_OneEven - Default - + Default + EndSwitch_OneEven + Default + 778 - 384 - + 384 + 778 - 448 - + 448 + control_m3p1 - OutGate - label_test - InGate - + Gate + label_test + Gate + 388 - 388 - + 388 + 389 - 597 - + 597 + 1319 - 597 - + 597 + 1318 - 231 - + 231 + control_div2 - OutGate - label_begin - InGate - + Gate + label_begin + Gate + 4 - 388 - + 388 + 3 - 587 - + 587 + 1214 - 588 - + 588 + 1213 - 546 - + 546 + -GraphSyrControl - label_begin\NB - label_begin - NB - +GraphGOTO + label_begin__NB + label_begin + NB + 3 - 7 - - -GraphSyrControl - label_begin\KB - label_begin - KB - + 7 + + +GraphGOTO + label_begin__KB + label_begin + KB + 3 - 0 - + 0 + diff --git a/examples/GraphLoop.py b/examples/GraphLoop.py index 8488517..288913f 100644 --- a/examples/GraphLoop.py +++ b/examples/GraphLoop.py @@ -2,80 +2,93 @@ # Generated python file of Graph GraphLoop from SuperV import * -# Graph creation -GraphLoop = Graph( 'GraphLoop' ) -GraphLoop.SetName( 'GraphLoop' ) -GraphLoop.SetAuthor( '' ) -GraphLoop.SetComment( '' ) -GraphLoop.Coords( 0 , 0 ) -# Creation of Factory Nodes +# Graph creation of GraphLoop +def DefGraphLoop() : + GraphLoop = Graph( 'GraphLoop' ) + GraphLoop.SetName( 'GraphLoop' ) + GraphLoop.SetAuthor( '' ) + GraphLoop.SetComment( '' ) + GraphLoop.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of Loop Nodes + PyInit = [] + PyInit.append( 'def Init(Index,Min,Max,Incr) : ' ) + PyInit.append( ' if Min <= Max : ' ) + PyInit.append( ' Index = Min ' ) + PyInit.append( ' else : ' ) + PyInit.append( ' Index = Max ' ) + PyInit.append( ' return Index,Min,Max,Incr ' ) + PyMoreInit = [] + PyMoreInit.append( 'import time ' ) + PyMoreInit.append( 'def More(Index,Min,Max,Incr) : ' ) + PyMoreInit.append( ' time.sleep(2) ' ) + PyMoreInit.append( ' if Index < Max : ' ) + PyMoreInit.append( ' DoLoop = 1 ' ) + PyMoreInit.append( ' else : ' ) + PyMoreInit.append( ' DoLoop = 0 ' ) + PyMoreInit.append( ' return DoLoop,Index,Min,Max,Incr ' ) + PyNextInit = [] + PyNextInit.append( 'def Next(Index,Min,Max,Incr) : ' ) + PyNextInit.append( ' Index = Index + Incr ' ) + PyNextInit.append( ' return Index,Min,Max,Incr ' ) + Init,EndInit = GraphLoop.LNode( 'Init' , PyInit , 'More' , PyMoreInit , 'Next' , PyNextInit ) + EndInit.SetName( 'EndInit' ) + EndInit.SetAuthor( '' ) + EndInit.SetComment( 'Compute Node' ) + EndInit.Coords( 366 , 262 ) + PyEndInit = [] + EndInit.SetPyFunction( '' , PyEndInit ) + IInitInitLoop = Init.GetInPort( 'InitLoop' ) + IInitIndex = Init.InPort( 'Index' , 'long' ) + IInitMin = Init.InPort( 'Min' , 'long' ) + IInitMax = Init.InPort( 'Max' , 'long' ) + IInitIncr = Init.InPort( 'Incr' , 'long' ) + IInitGate = Init.GetInPort( 'Gate' ) + OInitDoLoop = Init.GetOutPort( 'DoLoop' ) + OInitIndex = Init.GetOutPort( 'Index' ) + OInitMin = Init.GetOutPort( 'Min' ) + OInitMax = Init.GetOutPort( 'Max' ) + OInitIncr = Init.GetOutPort( 'Incr' ) + IEndInitDoLoop = EndInit.GetInPort( 'DoLoop' ) + IEndInitIndex = EndInit.GetInPort( 'Index' ) + IEndInitMin = EndInit.GetInPort( 'Min' ) + IEndInitMax = EndInit.GetInPort( 'Max' ) + IEndInitIncr = EndInit.GetInPort( 'Incr' ) + IEndInitGate = EndInit.GetInPort( 'Gate' ) + OEndInitDoLoop = EndInit.GetOutPort( 'DoLoop' ) + OEndInitIndex = EndInit.GetOutPort( 'Index' ) + OEndInitMin = EndInit.GetOutPort( 'Min' ) + OEndInitMax = EndInit.GetOutPort( 'Max' ) + OEndInitIncr = EndInit.GetOutPort( 'Incr' ) + Init.SetName( 'Init' ) + Init.SetAuthor( '' ) + Init.SetComment( 'Compute Node' ) + Init.Coords( 17 , 257 ) + + # Creation of Links + LInitIndexEndInitIndex = GraphLoop.Link( OInitIndex , IEndInitIndex ) + + LInitMinEndInitMin = GraphLoop.Link( OInitMin , IEndInitMin ) + + LInitMaxEndInitMax = GraphLoop.Link( OInitMax , IEndInitMax ) + + LInitIncrEndInitIncr = GraphLoop.Link( OInitIncr , IEndInitIncr ) + + # Input datas + IInitIndex.Input( 0 ) + IInitMin.Input( 5 ) + IInitMax.Input( 10 ) + IInitIncr.Input( 1 ) + + # Output Ports of the graph + #OEndInitIndex = EndInit.GetOutPort( 'Index' ) + #OEndInitMin = EndInit.GetOutPort( 'Min' ) + #OEndInitMax = EndInit.GetOutPort( 'Max' ) + #OEndInitIncr = EndInit.GetOutPort( 'Incr' ) + return GraphLoop -# Creation of Loop Nodes -PyInit = [] -PyInit.append( 'def Init(Index,Min,Max,Incr) : ' ) -PyInit.append( ' if Min <= Max : ' ) -PyInit.append( ' Index = Min ' ) -PyInit.append( ' else : ' ) -PyInit.append( ' Index = Max ' ) -PyInit.append( ' return Index,Min,Max,Incr ' ) -PyMoreInit = [] -PyMoreInit.append( 'def More(Index,Min,Max,Incr) : ' ) -PyMoreInit.append( ' if Index < Max : ' ) -PyMoreInit.append( ' DoLoop = 1 ' ) -PyMoreInit.append( ' else : ' ) -PyMoreInit.append( ' DoLoop = 0 ' ) -PyMoreInit.append( ' return DoLoop,Index,Min,Max,Incr ' ) -PyNextInit = [] -PyNextInit.append( 'def Next(Index,Min,Max,Incr) : ' ) -PyNextInit.append( ' Index = Index + Incr ' ) -PyNextInit.append( ' return Index,Min,Max,Incr ' ) -Init,EndInit = GraphLoop.LNode( 'Init' , PyInit , 'More' , PyMoreInit , 'Next' , PyNextInit ) -EndInit.SetName( 'EndInit' ) -EndInit.SetAuthor( '' ) -EndInit.SetComment( '' ) -EndInit.Coords( 314 , 91 ) -Init.InPort( 'Index' , 'long' ) -Init.InPort( 'Min' , 'long' ) -Init.InPort( 'Max' , 'long' ) -Init.InPort( 'Incr' , 'long' ) -Init.OutPort( 'Index' , 'long' ) -Init.OutPort( 'Min' , 'long' ) -Init.OutPort( 'Max' , 'long' ) -Init.OutPort( 'Incr' , 'long' ) -Init.SetName( 'Init' ) -Init.SetAuthor( '' ) -Init.SetComment( '' ) -Init.Coords( 31 , 74 ) - -# Creation of Links -InitIndex = Init.Port( 'Index' ) -EndInitIndex = GraphLoop.Link( InitIndex , EndInit.Port( 'Index' ) ) - -InitMin = Init.Port( 'Min' ) -EndInitMin = GraphLoop.Link( InitMin , EndInit.Port( 'Min' ) ) - -InitMax = Init.Port( 'Max' ) -EndInitMax = GraphLoop.Link( InitMax , EndInit.Port( 'Max' ) ) - -InitIncr = Init.Port( 'Incr' ) -EndInitIncr = GraphLoop.Link( InitIncr , EndInit.Port( 'Incr' ) ) - -# Creation of Input datas -InitIndex = Init.Input( 'Index' , 0) -InitMin = Init.Input( 'Min' , 0) -InitMax = Init.Input( 'Max' , 1000) -InitIncr = Init.Input( 'Incr' , 1) - -# Creation of Output variables -EndInitIndex = EndInit.Port( 'Index' ) -EndInitMin = EndInit.Port( 'Min' ) -EndInitMax = EndInit.Port( 'Max' ) -EndInitIncr = EndInit.Port( 'Incr' ) - -GraphLoop.Run() - -GraphLoop.DoneW() - -GraphLoop.PrintPorts() +GraphLoop = DefGraphLoop() diff --git a/examples/GraphLoop.xml b/examples/GraphLoop.xml index 57ef977..ec9e895 100644 --- a/examples/GraphLoop.xml +++ b/examples/GraphLoop.xml @@ -1,232 +1,237 @@ - + + ? - ? - GraphLoop - 1 - ? - + ? + GraphLoop + 1 + ? + GraphLoop - + long - Init\Index - + Init__Index + long - Init\Min - + Init__Min + long - Init\Max - + Init__Max + long - Init\Incr - + Init__Incr + long - EndInit\Index - + EndInit__Index + long - EndInit\Min - + EndInit__Min + long - EndInit\Max - + EndInit__Max + long - EndInit\Incr - - - 24/3/2003 - 14:44:35 - 25/3/2003 - 9:50:2 - 1.04 - ? - ? - ? - 0 - 0 - + EndInit__Incr + + + 24/3/2003 - 14:44:35 + 16/12/2004 - 11:8:15 + 1.04 + ? + ? + ? + 0 + 0 + ? - ? - Init - 4 - EndInit - + ? + Init + 4 + EndInit + Init - + long - Index - + Index + long - Min - + Min + long - Max - + Max + long - Incr - + Incr + long - Index - + Index + long - Min - + Min + long - Max - + Max + long - Incr - - + Incr + + Init - - - - - - - + + + + + + + More - - - - - - - + + + + + + + + + Next - - - - 25/3/2003 - 9:50:2 - 25/3/2003 - 9:50:2 - 1.04 - ? - ? - ? - 17 - 257 - + + + + 16/12/2004 - 11:8:15 + 16/12/2004 - 11:8:15 + 1.04 + ? + ? + Compute Node + 17 + 257 + ? - ? - EndInit - 5 - Init - + ? + EndInit + 5 + Init + EndInit - + long - Index - + Index + long - Min - + Min + long - Max - + Max + long - Incr - + Incr + long - Index - + Index + long - Min - + Min + long - Max - + Max + long - Incr - - - - 25/3/2003 - 9:50:2 - 25/3/2003 - 9:50:2 - 1.04 - ? - ? - ? - 626 - 259 - + Incr + + + +? + + 16/12/2004 - 11:8:15 + 16/12/2004 - 11:8:15 + 1.04 + ? + ? + Compute Node + 366 + 262 + Init - DoLoop - EndInit - DoLoop - - + DoLoop + EndInit + DoLoop + + Init - Index - EndInit - Index - - + Index + EndInit + Index + + Init - Min - EndInit - Min - - + Min + EndInit + Min + + Init - Max - EndInit - Max - - + Max + EndInit + Max + + Init - Incr - EndInit - Incr - - + Incr + EndInit + Incr + + EndInit - DoLoop - Init - InitLoop - - + DoLoop + Init + InitLoop + + GraphLoop - Init\Index - Init - Index - + Init__Index + Init + Index + 3 - 0 - - + 0 + + GraphLoop - Init\Min - Init - Min - + Init__Min + Init + Min + 3 - 0 - - + 5 + + GraphLoop - Init\Max - Init - Max - + Init__Max + Init + Max + 3 - 10 - - + 10 + + GraphLoop - Init\Incr - Init - Incr - + Init__Incr + Init + Incr + 3 - 1 - + 1 + diff --git a/examples/GraphLoopDoWhile.py b/examples/GraphLoopDoWhile.py new file mode 100644 index 0000000..130a495 --- /dev/null +++ b/examples/GraphLoopDoWhile.py @@ -0,0 +1,76 @@ + +# Generated python file of Graph GraphLoopDoWhile + +from SuperV import * + +# Graph creation of GraphLoopDoWhile +def DefGraphLoopDoWhile() : + GraphLoopDoWhile = Graph( 'GraphLoopDoWhile' ) + GraphLoopDoWhile.SetName( 'GraphLoopDoWhile' ) + GraphLoopDoWhile.SetAuthor( 'JR' ) + GraphLoopDoWhile.SetComment( '' ) + GraphLoopDoWhile.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of Loop Nodes + PyLoop = [] + PyMoreLoop = [] + PyMoreLoop.append( '' ) + PyNextLoop = [] + PyNextLoop.append( 'def LoopWhileNext(Index,Max) : ' ) + PyNextLoop.append( ' Index = Index + 1 ' ) + PyNextLoop.append( ' return Index,Max ' ) + PyNextLoop.append( '' ) + Loop,EndLoop = GraphLoopDoWhile.LNode( '' , PyLoop , '' , PyMoreLoop , 'LoopWhileNext' , PyNextLoop ) + EndLoop.SetName( 'EndLoop' ) + EndLoop.SetAuthor( '' ) + EndLoop.SetComment( 'Compute Node' ) + EndLoop.Coords( 414 , 232 ) + PyEndLoop = [] + PyEndLoop.append( 'import time ' ) + PyEndLoop.append( 'def DoWhile(DoLoop,Index,Max) : ' ) + PyEndLoop.append( ' print 'DoWhile',DoLoop,Index,Max ' ) + PyEndLoop.append( ' time.sleep(2) ' ) + PyEndLoop.append( ' if Index == Max : ' ) + PyEndLoop.append( ' DoLoop = 0 ' ) + PyEndLoop.append( ' else : ' ) + PyEndLoop.append( ' DoLoop = 1 ' ) + PyEndLoop.append( ' print 'DoWhile',DoLoop,Index,Max ' ) + PyEndLoop.append( ' return DoLoop,Index,Max ' ) + EndLoop.SetPyFunction( 'DoWhile' , PyEndLoop ) + ILoopDoLoop = Loop.GetInPort( 'DoLoop' ) + ILoopIndex = Loop.InPort( 'Index' , 'long' ) + ILoopMax = Loop.InPort( 'Max' , 'long' ) + ILoopGate = Loop.GetInPort( 'Gate' ) + OLoopDoLoop = Loop.GetOutPort( 'DoLoop' ) + OLoopIndex = Loop.GetOutPort( 'Index' ) + OLoopMax = Loop.GetOutPort( 'Max' ) + IEndLoopDoLoop = EndLoop.GetInPort( 'DoLoop' ) + IEndLoopIndex = EndLoop.GetInPort( 'Index' ) + IEndLoopMax = EndLoop.GetInPort( 'Max' ) + IEndLoopGate = EndLoop.GetInPort( 'Gate' ) + OEndLoopDoLoop = EndLoop.GetOutPort( 'DoLoop' ) + OEndLoopIndex = EndLoop.GetOutPort( 'Index' ) + OEndLoopMax = EndLoop.GetOutPort( 'Max' ) + Loop.SetName( 'Loop' ) + Loop.SetAuthor( '' ) + Loop.SetComment( 'Compute Node' ) + Loop.Coords( 105 , 226 ) + + # Creation of Links + LLoopIndexEndLoopIndex = GraphLoopDoWhile.Link( OLoopIndex , IEndLoopIndex ) + + LLoopMaxEndLoopMax = GraphLoopDoWhile.Link( OLoopMax , IEndLoopMax ) + + # Input datas + ILoopIndex.Input( 5 ) + ILoopMax.Input( 10 ) + + # Output Ports of the graph + #OEndLoopIndex = EndLoop.GetOutPort( 'Index' ) + #OEndLoopMax = EndLoop.GetOutPort( 'Max' ) + return GraphLoopDoWhile + + +GraphLoopDoWhile = DefGraphLoopDoWhile() diff --git a/examples/GraphLoopDoWhile.xml b/examples/GraphLoopDoWhile.xml new file mode 100644 index 0000000..e57d955 --- /dev/null +++ b/examples/GraphLoopDoWhile.xml @@ -0,0 +1,169 @@ + + + + + +? + ? + GraphLoopDoWhile + 1 + ? + +GraphLoopDoWhile + + +long + Loop__Index + +long + Loop__Max + + +long + EndLoop__Index + +long + EndLoop__Max + + + 16/12/2004 - 15:39:50 + 16/12/2004 - 18:44:10 + 2.0 + JR + ? + ? + 0 + 0 + + +? + ? + Loop + 4 + EndLoop + +Loop + + +long + Index + +long + Max + + +long + Index + +long + Max + + + +? + + +? + + +LoopWhileNext + + + + + 16/12/2004 - 18:44:10 + 16/12/2004 - 18:44:10 + 2.0 + ? + ? + Compute Node + 105 + 226 + +? + ? + EndLoop + 5 + Loop + +EndLoop + + +long + Index + +long + Max + + +long + Index + +long + Max + + + +DoWhile + + + + + + + + + + + 16/12/2004 - 18:44:10 + 16/12/2004 - 18:44:10 + 2.0 + ? + ? + Compute Node + 414 + 232 + + +Loop + DoLoop + EndLoop + DoLoop + + +Loop + Index + EndLoop + Index + + +Loop + Max + EndLoop + Max + + +EndLoop + DoLoop + Loop + DoLoop + + + +GraphLoopDoWhile + Loop__Index + Loop + Index + +3 + 5 + + +GraphLoopDoWhile + Loop__Max + Loop + Max + +3 + 10 + diff --git a/examples/GraphLoopSwitch.py b/examples/GraphLoopSwitch.py index c14aad1..f9998e6 100755 --- a/examples/GraphLoopSwitch.py +++ b/examples/GraphLoopSwitch.py @@ -1,137 +1,151 @@ -# Generated python file of Graph GraphLoopSwitch +# Generated python file of Graph GraphLoopSwitch_1 from SuperV import * -# Graph creation -GraphLoopSwitch = Graph( 'GraphLoopSwitch' ) -GraphLoopSwitch.SetName( 'GraphLoopSwitch' ) -GraphLoopSwitch.SetAuthor( '' ) -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.INode( 'IsOdd' , PyIsOdd ) -IsOdd.SetName( 'IsOdd' ) -IsOdd.SetAuthor( '' ) -IsOdd.SetComment( 'Python function' ) -IsOdd.Coords( 397 , 1 ) -IsOdd.InPort( 'a' , 'long' ) -IsOdd.InPort( 'Even' , 'boolean' ) -IsOdd.OutPort( 'a' , 'long' ) - -# Creation of Loop Nodes -PyInitLoop = [] -PyInitLoop.append( ' ' ) -PyMoreInitLoop = [] -PyMoreInitLoop.append( ' ' ) -PyNextInitLoop = [] -PyNextInitLoop.append( ' ' ) -InitLoop,EndOfInitLoop = GraphLoopSwitch.LNode( '' , PyInitLoop , '' , PyMoreInitLoop , '' , PyNextInitLoop ) -EndOfInitLoop.SetName( 'EndOfInitLoop' ) -EndOfInitLoop.SetAuthor( '' ) -EndOfInitLoop.SetComment( '' ) -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 ) -InitLoop.SetName( 'InitLoop' ) -InitLoop.SetAuthor( '' ) -InitLoop.SetComment( '' ) -InitLoop.Coords( 10 , 108 ) -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,EndSwitch = GraphLoopSwitch.SNode( 'Switch' , PySwitch ) -EndSwitch.SetName( 'EndSwitch' ) -EndSwitch.SetAuthor( '' ) -EndSwitch.SetComment( '' ) -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 ) -EndSwitch.InPort( 'a' , 'long' ) -EndSwitch.OutPort( 'a' , 'long' ) -Switch.SetName( 'Switch' ) -Switch.SetAuthor( '' ) -Switch.SetComment( '' ) -Switch.Coords( 194 , 109 ) -Switch.InPort( 'a' , 'long' ) -Switch.OutPort( 'Odd' , 'long' ) -Switch.OutPort( 'Even' , 'int' ) -Switch.OutPort( 'a' , 'int' ) - -# Creation of Links -IsOdda = IsOdd.Port( 'a' ) -EndSwitcha = GraphLoopSwitch.Link( IsOdda , EndSwitch.Port( 'a' ) ) -EndSwitcha.AddCoord( 1 , 576 , 136 ) -EndSwitcha.AddCoord( 2 , 575 , 81 ) - -InitLoopIndex = InitLoop.Port( 'Index' ) -Switcha = GraphLoopSwitch.Link( InitLoopIndex , Switch.Port( 'a' ) ) - -InitLoopMin = InitLoop.Port( 'Min' ) -EndOfInitLoopMin = GraphLoopSwitch.Link( InitLoopMin , EndOfInitLoop.Port( 'Min' ) ) - -InitLoopMax = InitLoop.Port( 'Max' ) -EndOfInitLoopMax = GraphLoopSwitch.Link( InitLoopMax , EndOfInitLoop.Port( 'Max' ) ) - -SwitchOdd = Switch.Port( 'Odd' ) -IsOddInGate = GraphLoopSwitch.Link( SwitchOdd , IsOdd.Port( 'InGate' ) ) - -SwitchEven = Switch.Port( 'Even' ) -EndSwitchDefault = GraphLoopSwitch.Link( SwitchEven , EndSwitch.Port( 'Default' ) ) - -IsOddEven = GraphLoopSwitch.Link( SwitchEven , IsOdd.Port( 'Even' ) ) -IsOddEven.AddCoord( 1 , 375 , 111 ) -IsOddEven.AddCoord( 2 , 375 , 172 ) - -Switcha = Switch.Port( 'a' ) -IsOdda = GraphLoopSwitch.Link( Switcha , IsOdd.Port( 'a' ) ) -IsOdda.AddCoord( 1 , 362 , 82 ) -IsOdda.AddCoord( 2 , 360 , 201 ) - -EndSwitcha = EndSwitch.Port( 'a' ) -EndOfInitLoopIndex = GraphLoopSwitch.Link( EndSwitcha , EndOfInitLoop.Port( 'Index' ) ) - -# Creation of Input datas -InitLoopIndex = InitLoop.Input( 'Index' , 0) -InitLoopMin = InitLoop.Input( 'Min' , 0) -InitLoopMax = InitLoop.Input( 'Max' , 100) - -# Creation of Output variables -EndOfInitLoopIndex = EndOfInitLoop.Port( 'Index' ) -EndOfInitLoopMin = EndOfInitLoop.Port( 'Min' ) -EndOfInitLoopMax = EndOfInitLoop.Port( 'Max' ) - -GraphLoopSwitch.Run() -GraphLoopSwitch.DoneW() -GraphLoopSwitch.State() -GraphLoopSwitch.PrintPorts() +# 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 ) + + # 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 ) + 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' ) + + # 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 = GraphLoopSwitch_1.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' ) + 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 = GraphLoopSwitch_1.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 = GraphLoopSwitch_1.Link( OIsOdda , IEndSwitcha ) + LIsOddaEndSwitcha.AddCoord( 1 , 576 , 136 ) + LIsOddaEndSwitcha.AddCoord( 2 , 575 , 81 ) + + LInitLoopIndexSwitcha = GraphLoopSwitch_1.Link( OInitLoopIndex , ISwitcha ) + + LInitLoopMinEndOfInitLoopMin = GraphLoopSwitch_1.Link( OInitLoopMin , IEndOfInitLoopMin ) + + LInitLoopMaxEndOfInitLoopMax = GraphLoopSwitch_1.Link( OInitLoopMax , IEndOfInitLoopMax ) + + LSwitchOddIsOddGate = GraphLoopSwitch_1.Link( OSwitchOdd , IIsOddGate ) + + LSwitchEvenEndSwitchDefault = GraphLoopSwitch_1.Link( OSwitchEven , IEndSwitchDefault ) + + LSwitchEvenIsOddEven = GraphLoopSwitch_1.Link( OSwitchEven , IIsOddEven ) + LSwitchEvenIsOddEven.AddCoord( 1 , 375 , 111 ) + LSwitchEvenIsOddEven.AddCoord( 2 , 375 , 172 ) + + LSwitchaIsOdda = GraphLoopSwitch_1.Link( OSwitcha , IIsOdda ) + LSwitchaIsOdda.AddCoord( 1 , 362 , 82 ) + LSwitchaIsOdda.AddCoord( 2 , 360 , 201 ) + + LEndSwitchaEndOfInitLoopIndex = GraphLoopSwitch_1.Link( OEndSwitcha , IEndOfInitLoopIndex ) + + # Input datas + IInitLoopIndex.Input( 0 ) + IInitLoopMin.Input( 5 ) + IInitLoopMax.Input( 100 ) + + # Output Ports of the graph + #OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) + #OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) + #OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) + return GraphLoopSwitch_1 + + +GraphLoopSwitch_1 = DefGraphLoopSwitch_1() diff --git a/examples/GraphLoopSwitch.xml b/examples/GraphLoopSwitch.xml index a5e717d..d52d92f 100755 --- a/examples/GraphLoopSwitch.xml +++ b/examples/GraphLoopSwitch.xml @@ -1,356 +1,360 @@ - + + ? - ? - GraphLoopSwitch - 1 - ? - -GraphLoopSwitch - + ? + GraphLoopSwitch_1 + 1 + ? + +GraphLoopSwitch_1 + long - InitLoop\Index - + InitLoop__Index + long - InitLoop\Min - + InitLoop__Min + long - InitLoop\Max - + InitLoop__Max + long - EndOfInitLoop\Index - + EndOfInitLoop__Index + long - EndOfInitLoop\Min - + EndOfInitLoop__Min + long - EndOfInitLoop\Max - - - 22/10/2003 - 10:36:39 - 22/10/2003 - 10:37:20 - 1.05 - ? - ? - ? - 0 - 0 - + EndOfInitLoop__Max + + + 22/10/2003 - 10:36:39 + 16/12/2004 - 16:45:0 + 1.05 + ? + ? + ? + 0 + 0 + ? - ? - IsOdd - 3 - ? - + ? + IsOdd + 3 + ? + IsOdd - + long - a - + a + boolean - Even - + Even + long - a - - + a + + IsOdd - - - - - - 22/10/2003 - 10:36:39 - 22/10/2003 - 10:36:39 - 1.05 - ? - ? - Python function - 397 - 1 - + + + + + + 16/12/2004 - 16:45:0 + 16/12/2004 - 16:45:0 + 1.05 + ? + ? + Python function + 397 + 1 + ? - ? - InitLoop - 4 - EndOfInitLoop - -Loop - + ? + InitLoop + 4 + EndOfInitLoop + +InitLoop + long - Index - + Index + long - Min - + Min + long - Max - + Max + long - Index - + Index + long - Min - + Min + long - Max - - + Max + + +InitLoop + + + + + ? - - + + ? - - -? - - 22/10/2003 - 10:36:40 - 22/10/2003 - 10:36:40 - 1.05 - ? - ? - ? - 10 - 108 - + + 16/12/2004 - 16:45:0 + 16/12/2004 - 16:45:0 + 1.05 + ? + ? + Compute Node + 10 + 108 + ? - ? - EndOfInitLoop - 5 - InitLoop - -EndLoop - + ? + EndOfInitLoop + 5 + InitLoop + +EndOfInitLoop + long - Index - + Index + long - Min - + Min + long - Max - + Max + long - Index - + Index + long - Min - + Min + long - Max - - + Max + + EndOfInitLoop - - - - - - - - 22/10/2003 - 10:36:40 - 22/10/2003 - 10:36:40 - 1.05 - ? - ? - ? - 767 - 102 - + + + + + + + + 16/12/2004 - 16:45:0 + 16/12/2004 - 16:45:0 + 1.05 + ? + ? + Compute Node + 767 + 102 + ? - ? - Switch - 6 - EndSwitch - + ? + Switch + 6 + EndSwitch + Switch - + long - a - + a + long - Odd - + Odd + int - Even - + Even + int - a - - + a + + Switch - - - - - - 22/10/2003 - 10:36:59 - 22/10/2003 - 10:36:59 - 1.05 - ? - ? - ? - 194 - 109 - + + + + + + 16/12/2004 - 16:45:0 + 16/12/2004 - 16:45:0 + 1.05 + ? + ? + Compute Node + 194 + 109 + ? - ? - EndSwitch - 7 - Switch - + ? + EndSwitch + 7 + Switch + EndSwitch - + long - a - + a + long - a - - + a + + EndSwitch - - - - - 22/10/2003 - 10:36:59 - 22/10/2003 - 10:36:59 - 1.05 - ? - ? - ? - 587 - 103 - + + + + + 16/12/2004 - 16:45:0 + 16/12/2004 - 16:45:0 + 1.05 + ? + ? + Compute Node + 587 + 103 + IsOdd - a - EndSwitch - a - + a + EndSwitch + a + 576 - 136 - + 136 + 575 - 81 - + 81 + InitLoop - DoLoop - EndOfInitLoop - DoLoop - - + DoLoop + EndOfInitLoop + DoLoop + + InitLoop - Index - Switch - a - - + Index + Switch + a + + InitLoop - Min - EndOfInitLoop - Min - - + Min + EndOfInitLoop + Min + + InitLoop - Max - EndOfInitLoop - Max - - + Max + EndOfInitLoop + Max + + EndOfInitLoop - DoLoop - InitLoop - InitLoop - - + DoLoop + InitLoop + DoLoop + + Switch - Odd - IsOdd - InGate - - + Odd + IsOdd + Gate + + Switch - Even - EndSwitch - Default - - + Even + EndSwitch + Default + + Switch - Even - IsOdd - Even - + Even + IsOdd + Even + 375 - 111 - + 111 + 375 - 172 - + 172 + Switch - a - IsOdd - a - + a + IsOdd + a + 362 - 82 - + 82 + 360 - 201 - + 201 + EndSwitch - a - EndOfInitLoop - Index - - + a + EndOfInitLoop + Index + + -GraphLoopSwitch - InitLoop\Index - InitLoop - Index - +GraphLoopSwitch_1 + InitLoop__Index + InitLoop + Index + 3 - 0 - - -GraphLoopSwitch - InitLoop\Min - InitLoop - Min - + 0 + + +GraphLoopSwitch_1 + InitLoop__Min + InitLoop + Min + 3 - 0 - - -GraphLoopSwitch - InitLoop\Max - InitLoop - Max - + 5 + + +GraphLoopSwitch_1 + InitLoop__Max + InitLoop + Max + 3 - 100 - + 100 + diff --git a/examples/GraphLoopWhile.py b/examples/GraphLoopWhile.py new file mode 100644 index 0000000..c6f8f8d --- /dev/null +++ b/examples/GraphLoopWhile.py @@ -0,0 +1,74 @@ + +# Generated python file of Graph GraphLoopWhile + +from SuperV import * + +# Graph creation of GraphLoopWhile +def DefGraphLoopWhile() : + GraphLoopWhile = Graph( 'GraphLoopWhile' ) + GraphLoopWhile.SetName( 'GraphLoopWhile' ) + GraphLoopWhile.SetAuthor( 'JR' ) + GraphLoopWhile.SetComment( '' ) + GraphLoopWhile.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of Loop Nodes + PyLoop = [] + PyMoreLoop = [] + PyMoreLoop.append( 'import time ' ) + PyMoreLoop.append( 'def LoopWhileMore(Index,Max) : ' ) + PyMoreLoop.append( ' time.sleep(2) ' ) + PyMoreLoop.append( ' if Index < Max : ' ) + PyMoreLoop.append( ' DoLoop = 1 ' ) + PyMoreLoop.append( ' else : ' ) + PyMoreLoop.append( ' DoLoop = 0 ' ) + PyMoreLoop.append( ' return DoLoop,Index,Max ' ) + PyMoreLoop.append( '' ) + PyNextLoop = [] + PyNextLoop.append( 'def LoopWhileNext(Index,Max) : ' ) + PyNextLoop.append( ' Index = Index + 1 ' ) + PyNextLoop.append( ' return Index,Max ' ) + PyNextLoop.append( '' ) + Loop,EndLoop = GraphLoopWhile.LNode( '' , PyLoop , 'LoopWhileMore' , PyMoreLoop , 'LoopWhileNext' , PyNextLoop ) + EndLoop.SetName( 'EndLoop' ) + EndLoop.SetAuthor( '' ) + EndLoop.SetComment( 'Compute Node' ) + EndLoop.Coords( 414 , 232 ) + PyEndLoop = [] + EndLoop.SetPyFunction( 'EndLoop' , PyEndLoop ) + ILoopDoLoop = Loop.GetInPort( 'DoLoop' ) + ILoopIndex = Loop.InPort( 'Index' , 'long' ) + ILoopMax = Loop.InPort( 'Max' , 'long' ) + ILoopGate = Loop.GetInPort( 'Gate' ) + OLoopDoLoop = Loop.GetOutPort( 'DoLoop' ) + OLoopIndex = Loop.GetOutPort( 'Index' ) + OLoopMax = Loop.GetOutPort( 'Max' ) + IEndLoopDoLoop = EndLoop.GetInPort( 'DoLoop' ) + IEndLoopIndex = EndLoop.GetInPort( 'Index' ) + IEndLoopMax = EndLoop.GetInPort( 'Max' ) + IEndLoopGate = EndLoop.GetInPort( 'Gate' ) + OEndLoopDoLoop = EndLoop.GetOutPort( 'DoLoop' ) + OEndLoopIndex = EndLoop.GetOutPort( 'Index' ) + OEndLoopMax = EndLoop.GetOutPort( 'Max' ) + Loop.SetName( 'Loop' ) + Loop.SetAuthor( '' ) + Loop.SetComment( 'Compute Node' ) + Loop.Coords( 105 , 226 ) + + # Creation of Links + LLoopIndexEndLoopIndex = GraphLoopWhile.Link( OLoopIndex , IEndLoopIndex ) + + LLoopMaxEndLoopMax = GraphLoopWhile.Link( OLoopMax , IEndLoopMax ) + + # Input datas + ILoopIndex.Input( 5 ) + ILoopMax.Input( 10 ) + + # Output Ports of the graph + #OEndLoopIndex = EndLoop.GetOutPort( 'Index' ) + #OEndLoopMax = EndLoop.GetOutPort( 'Max' ) + return GraphLoopWhile + + +GraphLoopWhile = DefGraphLoopWhile() diff --git a/examples/GraphLoopWhile.xml b/examples/GraphLoopWhile.xml new file mode 100644 index 0000000..1733430 --- /dev/null +++ b/examples/GraphLoopWhile.xml @@ -0,0 +1,168 @@ + + + + + +? + ? + GraphLoopWhile + 1 + ? + +GraphLoopWhile_1 + + +long + Loop__Index + +long + Loop__Max + + +long + EndLoop__Index + +long + EndLoop__Max + + + 16/12/2004 - 15:39:50 + 16/12/2004 - 16:51:46 + 2.0 + JR + ? + ? + 0 + 0 + + +? + ? + Loop + 4 + EndLoop + +Loop + + +long + Index + +long + Max + + +long + Index + +long + Max + + + +? + + +LoopWhileMore + + + + + + + + + + +LoopWhileNext + + + + + 16/12/2004 - 16:51:46 + 16/12/2004 - 16:51:46 + 2.0 + ? + ? + Compute Node + 105 + 226 + +? + ? + EndLoop + 5 + Loop + +EndLoop + + +long + Index + +long + Max + + +long + Index + +long + Max + + + +EndLoop + + 16/12/2004 - 16:51:46 + 16/12/2004 - 16:51:46 + 2.0 + ? + ? + Compute Node + 414 + 232 + + +Loop + DoLoop + EndLoop + DoLoop + + +Loop + Index + EndLoop + Index + + +Loop + Max + EndLoop + Max + + +EndLoop + DoLoop + Loop + DoLoop + + + +GraphLoopWhile + Loop__Index + Loop + Index + +3 + 5 + + +GraphLoopWhile + Loop__Max + Loop + Max + +3 + 10 + diff --git a/examples/GraphLoopsCoupled.py b/examples/GraphLoopsCoupled.py new file mode 100644 index 0000000..26e5c5d --- /dev/null +++ b/examples/GraphLoopsCoupled.py @@ -0,0 +1,215 @@ + +# Generated python file of Graph GraphLoopsCoupled_3 + +from SuperV import * + +# Graph creation of GraphLoopsCoupled_3 +def DefGraphLoopsCoupled_3() : + GraphLoopsCoupled_3 = Graph( 'GraphLoopsCoupled_3' ) + GraphLoopsCoupled_3.SetName( 'GraphLoopsCoupled_3' ) + GraphLoopsCoupled_3.SetAuthor( 'JR' ) + GraphLoopsCoupled_3.SetComment( '' ) + GraphLoopsCoupled_3.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyAdd = [] + PyAdd.append( 'def Add(x,y) : ' ) + PyAdd.append( ' return x+y ' ) + PyAdd.append( '' ) + Add = GraphLoopsCoupled_3.INode( 'Add' , PyAdd ) + Add.SetName( 'Add' ) + Add.SetAuthor( '' ) + Add.SetComment( 'Compute Node' ) + Add.Coords( 245 , 38 ) + IAddx = Add.InPort( 'x' , 'long' ) + IAddy = Add.InPort( 'y' , 'long' ) + IAddGate = Add.GetInPort( 'Gate' ) + OAddz = Add.OutPort( 'z' , 'long' ) + OAddGate = Add.GetOutPort( 'Gate' ) + + PyAdd_1 = [] + PyAdd_1.append( 'def Add(x,y) : ' ) + PyAdd_1.append( ' return x+y ' ) + PyAdd_1.append( '' ) + Add_1 = GraphLoopsCoupled_3.INode( 'Add' , PyAdd_1 ) + Add_1.SetName( 'Add_1' ) + Add_1.SetAuthor( '' ) + Add_1.SetComment( 'Compute Node' ) + Add_1.Coords( 243 , 288 ) + IAdd_1x = Add_1.InPort( 'x' , 'long' ) + IAdd_1y = Add_1.InPort( 'y' , 'long' ) + IAdd_1Gate = Add_1.GetInPort( 'Gate' ) + OAdd_1z = Add_1.OutPort( 'z' , 'long' ) + OAdd_1Gate = Add_1.GetOutPort( 'Gate' ) + + PySub = [] + PySub.append( 'def Sub(x,y) : ' ) + PySub.append( ' return x-y ' ) + PySub.append( '' ) + Sub = GraphLoopsCoupled_3.INode( 'Sub' , PySub ) + Sub.SetName( 'Sub' ) + Sub.SetAuthor( '' ) + Sub.SetComment( 'Compute Node' ) + Sub.Coords( 458 , 18 ) + ISubx = Sub.InPort( 'x' , 'long' ) + ISuby = Sub.InPort( 'y' , 'long' ) + ISubGate = Sub.GetInPort( 'Gate' ) + OSubz = Sub.OutPort( 'z' , 'long' ) + OSubGate = Sub.GetOutPort( 'Gate' ) + + PySub_1 = [] + PySub_1.append( 'def Sub(x,y) : ' ) + PySub_1.append( ' return x-y ' ) + PySub_1.append( '' ) + Sub_1 = GraphLoopsCoupled_3.INode( 'Sub' , PySub_1 ) + Sub_1.SetName( 'Sub_1' ) + Sub_1.SetAuthor( '' ) + Sub_1.SetComment( 'Compute Node' ) + Sub_1.Coords( 461 , 268 ) + ISub_1x = Sub_1.InPort( 'x' , 'long' ) + ISub_1y = Sub_1.InPort( 'y' , 'long' ) + ISub_1Gate = Sub_1.GetInPort( 'Gate' ) + OSub_1z = Sub_1.OutPort( 'z' , 'long' ) + OSub_1Gate = Sub_1.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyLoop = [] + PyLoop.append( ' ' ) + PyMoreLoop = [] + PyMoreLoop.append( 'def More(Index,Max,z) : ' ) + PyMoreLoop.append( ' DoLoop = 0 ' ) + PyMoreLoop.append( ' if Index < Max : ' ) + PyMoreLoop.append( ' DoLoop = 1 ' ) + PyMoreLoop.append( ' return DoLoop,Index,Max,z ' ) + PyMoreLoop.append( ' ' ) + PyNextLoop = [] + PyNextLoop.append( 'def Next(Index,Max,z) : ' ) + PyNextLoop.append( ' Index = Index + 1 ' ) + PyNextLoop.append( ' return Index,Max,z ' ) + PyNextLoop.append( ' ' ) + Loop,EndLoop = GraphLoopsCoupled_3.LNode( '' , PyLoop , 'More' , PyMoreLoop , 'Next' , PyNextLoop ) + EndLoop.SetName( 'EndLoop' ) + EndLoop.SetAuthor( '' ) + EndLoop.SetComment( 'Compute Node' ) + EndLoop.Coords( 662 , 38 ) + PyEndLoop = [] + EndLoop.SetPyFunction( 'EndLoop' , PyEndLoop ) + ILoopDoLoop = Loop.GetInPort( 'DoLoop' ) + ILoopIndex = Loop.InPort( 'Index' , 'long' ) + ILoopMax = Loop.InPort( 'Max' , 'long' ) + ILoopz = Loop.InPort( 'z' , 'long' ) + ILoopGate = Loop.GetInPort( 'Gate' ) + OLoopDoLoop = Loop.GetOutPort( 'DoLoop' ) + OLoopIndex = Loop.GetOutPort( 'Index' ) + OLoopMax = Loop.GetOutPort( 'Max' ) + OLoopz = Loop.GetOutPort( 'z' ) + IEndLoopDoLoop = EndLoop.GetInPort( 'DoLoop' ) + IEndLoopIndex = EndLoop.GetInPort( 'Index' ) + IEndLoopMax = EndLoop.GetInPort( 'Max' ) + IEndLoopz = EndLoop.GetInPort( 'z' ) + IEndLoopGate = EndLoop.GetInPort( 'Gate' ) + OEndLoopDoLoop = EndLoop.GetOutPort( 'DoLoop' ) + OEndLoopIndex = EndLoop.GetOutPort( 'Index' ) + OEndLoopMax = EndLoop.GetOutPort( 'Max' ) + OEndLoopz = EndLoop.GetOutPort( 'z' ) + OEndLoopGate = EndLoop.GetOutPort( 'Gate' ) + Loop.SetName( 'Loop' ) + Loop.SetAuthor( '' ) + Loop.SetComment( 'Compute Node' ) + Loop.Coords( 15 , 58 ) + + PyInit = [] + PyInit.append( ' ' ) + PyMoreInit = [] + PyMoreInit.append( 'def More(Index,Max,z) : ' ) + PyMoreInit.append( ' DoLoop = 0 ' ) + PyMoreInit.append( ' if Index < Max : ' ) + PyMoreInit.append( ' DoLoop = 1 ' ) + PyMoreInit.append( ' return DoLoop,Index,Max,z ' ) + PyMoreInit.append( ' ' ) + PyNextInit = [] + PyNextInit.append( 'def Next(Index,Max,z) : ' ) + PyNextInit.append( ' Index = Index + 1 ' ) + PyNextInit.append( ' return Index,Max,z ' ) + PyNextInit.append( ' ' ) + Init,EndInit = GraphLoopsCoupled_3.LNode( '' , PyInit , 'More' , PyMoreInit , 'Next' , PyNextInit ) + EndInit.SetName( 'EndInit' ) + EndInit.SetAuthor( '' ) + EndInit.SetComment( 'Compute Node' ) + EndInit.Coords( 670 , 288 ) + PyEndInit = [] + EndInit.SetPyFunction( 'EndInit' , PyEndInit ) + IInitDoLoop = Init.GetInPort( 'DoLoop' ) + IInitIndex = Init.InPort( 'Index' , 'long' ) + IInitMax = Init.InPort( 'Max' , 'long' ) + IInitz = Init.InPort( 'z' , 'long' ) + IInitGate = Init.GetInPort( 'Gate' ) + OInitDoLoop = Init.GetOutPort( 'DoLoop' ) + OInitIndex = Init.GetOutPort( 'Index' ) + OInitMax = Init.GetOutPort( 'Max' ) + OInitz = Init.GetOutPort( 'z' ) + IEndInitDoLoop = EndInit.GetInPort( 'DoLoop' ) + IEndInitIndex = EndInit.GetInPort( 'Index' ) + IEndInitMax = EndInit.GetInPort( 'Max' ) + IEndInitz = EndInit.GetInPort( 'z' ) + IEndInitGate = EndInit.GetInPort( 'Gate' ) + OEndInitDoLoop = EndInit.GetOutPort( 'DoLoop' ) + OEndInitIndex = EndInit.GetOutPort( 'Index' ) + OEndInitMax = EndInit.GetOutPort( 'Max' ) + OEndInitz = EndInit.GetOutPort( 'z' ) + OEndInitGate = EndInit.GetOutPort( 'Gate' ) + Init.SetName( 'Init' ) + Init.SetAuthor( '' ) + Init.SetComment( 'Compute Node' ) + Init.Coords( 10 , 308 ) + + # Creation of Links + LAddzSuby = GraphLoopsCoupled_3.Link( OAddz , ISuby ) + + LAddzSub_1x = GraphLoopsCoupled_3.Link( OAddz , ISub_1x ) + + LAdd_1zSub_1y = GraphLoopsCoupled_3.Link( OAdd_1z , ISub_1y ) + + LAdd_1zSubx = GraphLoopsCoupled_3.Link( OAdd_1z , ISubx ) + + LSubzEndInitz = GraphLoopsCoupled_3.Link( OSubz , IEndInitz ) + + LSub_1zEndLoopz = GraphLoopsCoupled_3.Link( OSub_1z , IEndLoopz ) + + LLoopIndexEndLoopIndex = GraphLoopsCoupled_3.Link( OLoopIndex , IEndLoopIndex ) + + LLoopMaxEndLoopMax = GraphLoopsCoupled_3.Link( OLoopMax , IEndLoopMax ) + + LLoopMaxAddx = GraphLoopsCoupled_3.Link( OLoopMax , IAddx ) + + LLoopzAddy = GraphLoopsCoupled_3.Link( OLoopz , IAddy ) + + LInitIndexEndInitIndex = GraphLoopsCoupled_3.Link( OInitIndex , IEndInitIndex ) + + LInitMaxEndInitMax = GraphLoopsCoupled_3.Link( OInitMax , IEndInitMax ) + + LInitMaxAdd_1x = GraphLoopsCoupled_3.Link( OInitMax , IAdd_1x ) + + LInitzAdd_1y = GraphLoopsCoupled_3.Link( OInitz , IAdd_1y ) + + # Input datas + ILoopIndex.Input( 5 ) + ILoopMax.Input( 15 ) + ILoopz.Input( -1 ) + IInitIndex.Input( 3 ) + IInitMax.Input( 13 ) + IInitz.Input( -2 ) + + # Output Ports of the graph + #OEndLoopIndex = EndLoop.GetOutPort( 'Index' ) + #OEndLoopMax = EndLoop.GetOutPort( 'Max' ) + #OEndLoopz = EndLoop.GetOutPort( 'z' ) + #OEndInitIndex = EndInit.GetOutPort( 'Index' ) + #OEndInitMax = EndInit.GetOutPort( 'Max' ) + #OEndInitz = EndInit.GetOutPort( 'z' ) + return GraphLoopsCoupled_3 + + +GraphLoopsCoupled_3 = DefGraphLoopsCoupled_3() diff --git a/examples/GraphLoopsCoupled.xml b/examples/GraphLoopsCoupled.xml new file mode 100644 index 0000000..33d583e --- /dev/null +++ b/examples/GraphLoopsCoupled.xml @@ -0,0 +1,553 @@ + + + + + +? + ? + GraphLoopsCoupled_3 + 1 + ? + +GraphLoopsCoupled_3 + + +long + Loop__Index + +long + Loop__Max + +long + Loop__z + +long + Init__Index + +long + Init__Max + +long + Init__z + + +long + EndLoop__Index + +long + EndLoop__Max + +long + EndLoop__z + +long + EndInit__Index + +long + EndInit__Max + +long + EndInit__z + + + 17/12/2004 - 17:11:7 + 17/12/2004 - 18:26:39 + 2.0 + JR + ? + ? + 0 + 0 + + +? + ? + Add + 3 + ? + +Add + + +long + x + +long + y + + +long + z + + + +Add + + + + 17/12/2004 - 18:26:39 + 17/12/2004 - 18:26:39 + 2.0 + ? + ? + Compute Node + 245 + 38 + +? + ? + Add_1 + 3 + ? + +Add_1 + + +long + x + +long + y + + +long + z + + + +Add + + + + 17/12/2004 - 18:26:39 + 17/12/2004 - 18:26:39 + 2.0 + ? + ? + Compute Node + 243 + 288 + +? + ? + Sub + 3 + ? + +Sub + + +long + x + +long + y + + +long + z + + + +Sub + + + + 17/12/2004 - 18:26:39 + 17/12/2004 - 18:26:39 + 2.0 + ? + ? + Compute Node + 458 + 18 + +? + ? + Sub_1 + 3 + ? + +Sub_1 + + +long + x + +long + y + + +long + z + + + +Sub + + + + 17/12/2004 - 18:26:39 + 17/12/2004 - 18:26:39 + 2.0 + ? + ? + Compute Node + 461 + 268 + +? + ? + Loop + 4 + EndLoop + +Loop + + +long + Index + +long + Max + +long + z + + +long + Index + +long + Max + +long + z + + + +? + + +More + + + + + + + +Next + + + + + 17/12/2004 - 18:26:39 + 17/12/2004 - 18:26:39 + 2.0 + ? + ? + Compute Node + 15 + 58 + +? + ? + EndLoop + 5 + Loop + +EndLoop + + +long + Index + +long + Max + +long + z + + +long + Index + +long + Max + +long + z + + + +EndLoop + + 17/12/2004 - 18:26:39 + 17/12/2004 - 18:26:39 + 2.0 + ? + ? + Compute Node + 662 + 38 + +? + ? + Init + 4 + EndInit + +Init + + +long + Index + +long + Max + +long + z + + +long + Index + +long + Max + +long + z + + + +? + + +More + + + + + + + +Next + + + + + 17/12/2004 - 18:26:39 + 17/12/2004 - 18:26:39 + 2.0 + ? + ? + Compute Node + 10 + 308 + +? + ? + EndInit + 5 + Init + +EndInit + + +long + Index + +long + Max + +long + z + + +long + Index + +long + Max + +long + z + + + +EndInit + + 17/12/2004 - 18:26:39 + 17/12/2004 - 18:26:39 + 2.0 + ? + ? + Compute Node + 670 + 288 + + +Add + z + Sub + y + + +Add + z + Sub_1 + x + + +Add_1 + z + Sub_1 + y + + +Add_1 + z + Sub + x + + +Sub + z + EndInit + z + + +Sub_1 + z + EndLoop + z + + +Loop + DoLoop + EndLoop + DoLoop + + +Loop + Index + EndLoop + Index + + +Loop + Max + EndLoop + Max + + +Loop + Max + Add + x + + +Loop + z + Add + y + + +EndLoop + DoLoop + Loop + DoLoop + + +Init + DoLoop + EndInit + DoLoop + + +Init + Index + EndInit + Index + + +Init + Max + EndInit + Max + + +Init + Max + Add_1 + x + + +Init + z + Add_1 + y + + +EndInit + DoLoop + Init + DoLoop + + + +GraphLoopsCoupled_3 + Loop__Index + Loop + Index + +3 + 5 + + +GraphLoopsCoupled_3 + Loop__Max + Loop + Max + +3 + 15 + + +GraphLoopsCoupled_3 + Loop__z + Loop + z + +3 + -1 + + +GraphLoopsCoupled_3 + Init__Index + Init + Index + +3 + 3 + + +GraphLoopsCoupled_3 + Init__Max + Init + Max + +3 + 13 + + +GraphLoopsCoupled_3 + Init__z + Init + z + +3 + -2 + diff --git a/examples/GraphNonVoidEndLoop.py b/examples/GraphNonVoidEndLoop.py new file mode 100644 index 0000000..5131b3b --- /dev/null +++ b/examples/GraphNonVoidEndLoop.py @@ -0,0 +1,101 @@ + +# Generated python file of Graph GraphNonVoidEndLoop + +from SuperV import * + +# Graph creation of GraphNonVoidEndLoop +def DefGraphNonVoidEndLoop() : + GraphNonVoidEndLoop = Graph( 'GraphNonVoidEndLoop' ) + GraphNonVoidEndLoop.SetName( 'GraphNonVoidEndLoop' ) + GraphNonVoidEndLoop.SetAuthor( '' ) + GraphNonVoidEndLoop.SetComment( '' ) + GraphNonVoidEndLoop.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of Loop Nodes + PyInit = [] + PyInit.append( 'def Init(Index,Min,Max,Incr) : ' ) + PyInit.append( ' if Min <= Max : ' ) + PyInit.append( ' Index = Min ' ) + PyInit.append( ' else : ' ) + PyInit.append( ' Index = Max ' ) + PyInit.append( ' print 'Init',Index,Min,Max,Incr ' ) + PyInit.append( ' return Index,Min,Max,Incr ' ) + PyMoreInit = [] + PyMoreInit.append( 'import time ' ) + PyMoreInit.append( 'def More(Index,Min,Max,Incr) : ' ) + PyMoreInit.append( ' time.sleep(2) ' ) + PyMoreInit.append( ' if Index < Max : ' ) + PyMoreInit.append( ' DoLoop = 1 ' ) + PyMoreInit.append( ' else : ' ) + PyMoreInit.append( ' DoLoop = 0 ' ) + PyMoreInit.append( ' print 'More', DoLoop,Index,Min,Max,Incr ' ) + PyMoreInit.append( ' return DoLoop,Index,Min,Max,Incr ' ) + PyNextInit = [] + PyNextInit.append( 'def Next(Index,Min,Max,Incr) : ' ) + PyNextInit.append( ' Index = Index + Incr ' ) + PyNextInit.append( ' print 'Next', Index,Min,Max,Incr ' ) + PyNextInit.append( ' return Index,Min,Max,Incr ' ) + Init,EndInit = GraphNonVoidEndLoop.LNode( 'Init' , PyInit , 'More' , PyMoreInit , 'Next' , PyNextInit ) + EndInit.SetName( 'EndInit' ) + EndInit.SetAuthor( '' ) + EndInit.SetComment( 'Compute Node' ) + EndInit.Coords( 411 , 260 ) + PyEndInit = [] + PyEndInit.append( 'def EndLoop(DoLoop,Index,Min,Max,Incr) : ' ) + PyEndInit.append( ' print 'EndLoop',DoLoop,Index,Min,Max,Incr ' ) + PyEndInit.append( ' return DoLoop,Index,Min,Max,Incr ' ) + PyEndInit.append( '' ) + EndInit.SetPyFunction( 'EndLoop' , PyEndInit ) + IInitDoLoop = Init.GetInPort( 'DoLoop' ) + IInitIndex = Init.InPort( 'Index' , 'long' ) + IInitMin = Init.InPort( 'Min' , 'long' ) + IInitMax = Init.InPort( 'Max' , 'long' ) + IInitIncr = Init.InPort( 'Incr' , 'long' ) + IInitGate = Init.GetInPort( 'Gate' ) + OInitDoLoop = Init.GetOutPort( 'DoLoop' ) + OInitIndex = Init.GetOutPort( 'Index' ) + OInitMin = Init.GetOutPort( 'Min' ) + OInitMax = Init.GetOutPort( 'Max' ) + OInitIncr = Init.GetOutPort( 'Incr' ) + IEndInitDoLoop = EndInit.GetInPort( 'DoLoop' ) + IEndInitIndex = EndInit.GetInPort( 'Index' ) + IEndInitMin = EndInit.GetInPort( 'Min' ) + IEndInitMax = EndInit.GetInPort( 'Max' ) + IEndInitIncr = EndInit.GetInPort( 'Incr' ) + IEndInitGate = EndInit.GetInPort( 'Gate' ) + OEndInitDoLoop = EndInit.GetOutPort( 'DoLoop' ) + OEndInitIndex = EndInit.GetOutPort( 'Index' ) + OEndInitMin = EndInit.GetOutPort( 'Min' ) + OEndInitMax = EndInit.GetOutPort( 'Max' ) + OEndInitIncr = EndInit.GetOutPort( 'Incr' ) + Init.SetName( 'Init' ) + Init.SetAuthor( '' ) + Init.SetComment( 'Compute Node' ) + Init.Coords( 17 , 257 ) + + # Creation of Links + LInitIndexEndInitIndex = GraphNonVoidEndLoop.Link( OInitIndex , IEndInitIndex ) + + LInitMinEndInitMin = GraphNonVoidEndLoop.Link( OInitMin , IEndInitMin ) + + LInitMaxEndInitMax = GraphNonVoidEndLoop.Link( OInitMax , IEndInitMax ) + + LInitIncrEndInitIncr = GraphNonVoidEndLoop.Link( OInitIncr , IEndInitIncr ) + + # Input datas + IInitIndex.Input( 0 ) + IInitMin.Input( 5 ) + IInitMax.Input( 10 ) + IInitIncr.Input( 1 ) + + # Output Ports of the graph + #OEndInitIndex = EndInit.GetOutPort( 'Index' ) + #OEndInitMin = EndInit.GetOutPort( 'Min' ) + #OEndInitMax = EndInit.GetOutPort( 'Max' ) + #OEndInitIncr = EndInit.GetOutPort( 'Incr' ) + return GraphNonVoidEndLoop + + +GraphNonVoidEndLoop = DefGraphNonVoidEndLoop() diff --git a/examples/GraphNonVoidEndLoop.xml b/examples/GraphNonVoidEndLoop.xml new file mode 100644 index 0000000..8094cb0 --- /dev/null +++ b/examples/GraphNonVoidEndLoop.xml @@ -0,0 +1,243 @@ + + + + + +? + ? + GraphNonVoidEndLoop + 1 + ? + +GraphNonVoidEndLoop_1 + + +long + Init__Index + +long + Init__Min + +long + Init__Max + +long + Init__Incr + + +long + EndInit__Index + +long + EndInit__Min + +long + EndInit__Max + +long + EndInit__Incr + + + 24/3/2003 - 14:44:35 + 16/12/2004 - 16:53:28 + 1.04 + ? + ? + ? + 0 + 0 + + +? + ? + Init + 4 + EndInit + +Init + + +long + Index + +long + Min + +long + Max + +long + Incr + + +long + Index + +long + Min + +long + Max + +long + Incr + + + +Init + + + + + + + + +More + + + + + + + + + + +Next + + + + + 16/12/2004 - 16:53:28 + 16/12/2004 - 16:53:28 + 1.04 + ? + ? + Compute Node + 17 + 257 + +? + ? + EndInit + 5 + Init + +EndInit + + +long + Index + +long + Min + +long + Max + +long + Incr + + +long + Index + +long + Min + +long + Max + +long + Incr + + + +EndLoop + + + + + 16/12/2004 - 16:53:28 + 16/12/2004 - 16:53:28 + 1.04 + ? + ? + Compute Node + 411 + 260 + + +Init + DoLoop + EndInit + DoLoop + + +Init + Index + EndInit + Index + + +Init + Min + EndInit + Min + + +Init + Max + EndInit + Max + + +Init + Incr + EndInit + Incr + + +EndInit + DoLoop + Init + DoLoop + + + +GraphNonVoidEndLoop + Init__Index + Init + Index + +3 + 0 + + +GraphNonVoidEndLoop + Init__Min + Init + Min + +3 + 5 + + +GraphNonVoidEndLoop + Init__Max + Init + Max + +3 + 10 + + +GraphNonVoidEndLoop + Init__Incr + Init + Incr + +3 + 1 + diff --git a/examples/GraphTwoLoops.py b/examples/GraphTwoLoops.py new file mode 100644 index 0000000..98b1989 --- /dev/null +++ b/examples/GraphTwoLoops.py @@ -0,0 +1,132 @@ + +# Generated python file of Graph GraphTwoLoops + +from SuperV import * + +# Graph creation of GraphTwoLoops +def DefGraphTwoLoops() : + GraphTwoLoops = Graph( 'GraphTwoLoops' ) + GraphTwoLoops.SetName( 'GraphTwoLoops' ) + GraphTwoLoops.SetAuthor( 'JR' ) + GraphTwoLoops.SetComment( '' ) + GraphTwoLoops.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of Loop Nodes + PyLoop1 = [] + PyLoop1.append( 'def Loop1(Index,Max) : ' ) + PyLoop1.append( ' return Index,Max ' ) + PyLoop1.append( '' ) + PyMoreLoop1 = [] + PyMoreLoop1.append( 'import time ' ) + PyMoreLoop1.append( 'def More(Index,Max) : ' ) + PyMoreLoop1.append( ' time.sleep(2) ' ) + PyMoreLoop1.append( ' DoLoop = 0 ' ) + PyMoreLoop1.append( ' if Index < Max : ' ) + PyMoreLoop1.append( ' DoLoop = 1 ' ) + PyMoreLoop1.append( ' return DoLoop,Index,Max ' ) + PyMoreLoop1.append( '' ) + PyNextLoop1 = [] + PyNextLoop1.append( 'def Next(Index,Max) : ' ) + PyNextLoop1.append( ' Index = Index + 1 ' ) + PyNextLoop1.append( ' return Index,Max ' ) + PyNextLoop1.append( '' ) + Loop1,EndLoop1 = GraphTwoLoops.LNode( 'Loop1' , PyLoop1 , 'More' , PyMoreLoop1 , 'Next' , PyNextLoop1 ) + EndLoop1.SetName( 'EndLoop1' ) + EndLoop1.SetAuthor( '' ) + EndLoop1.SetComment( 'Compute Node' ) + EndLoop1.Coords( 634 , 177 ) + PyEndLoop1 = [] + EndLoop1.SetPyFunction( 'EndLoop1' , PyEndLoop1 ) + ILoop1DoLoop = Loop1.GetInPort( 'DoLoop' ) + ILoop1Index = Loop1.InPort( 'Index' , 'long' ) + ILoop1Max = Loop1.InPort( 'Max' , 'long' ) + ILoop1Gate = Loop1.GetInPort( 'Gate' ) + OLoop1DoLoop = Loop1.GetOutPort( 'DoLoop' ) + OLoop1Index = Loop1.GetOutPort( 'Index' ) + OLoop1Max = Loop1.GetOutPort( 'Max' ) + IEndLoop1DoLoop = EndLoop1.GetInPort( 'DoLoop' ) + IEndLoop1Index = EndLoop1.GetInPort( 'Index' ) + IEndLoop1Max = EndLoop1.GetInPort( 'Max' ) + IEndLoop1Gate = EndLoop1.GetInPort( 'Gate' ) + OEndLoop1DoLoop = EndLoop1.GetOutPort( 'DoLoop' ) + OEndLoop1Index = EndLoop1.GetOutPort( 'Index' ) + OEndLoop1Max = EndLoop1.GetOutPort( 'Max' ) + OEndLoop1Gate = EndLoop1.GetOutPort( 'Gate' ) + Loop1.SetName( 'Loop1' ) + Loop1.SetAuthor( '' ) + Loop1.SetComment( 'Compute Node' ) + Loop1.Coords( 7 , 175 ) + + PyLoop = [] + PyMoreLoop = [] + PyMoreLoop.append( '' ) + PyNextLoop = [] + PyNextLoop.append( 'def Next(Index,Max) : ' ) + PyNextLoop.append( ' Index = Index + 1 ' ) + PyNextLoop.append( ' return Index,Max ' ) + PyNextLoop.append( '' ) + Loop,EndLoop = GraphTwoLoops.LNode( '' , PyLoop , '' , PyMoreLoop , 'Next' , PyNextLoop ) + EndLoop.SetName( 'EndLoop' ) + EndLoop.SetAuthor( '' ) + EndLoop.SetComment( 'Compute Node' ) + EndLoop.Coords( 426 , 180 ) + PyEndLoop = [] + PyEndLoop.append( 'import time ' ) + PyEndLoop.append( 'def EndLoop(DoLoop,Index,Max) : ' ) + PyEndLoop.append( ' time.sleep(1) ' ) + PyEndLoop.append( ' DoLoop = 0 ' ) + PyEndLoop.append( ' if Index < Max : ' ) + PyEndLoop.append( ' DoLoop = 1 ' ) + PyEndLoop.append( ' return DoLoop,Index,Max ' ) + PyEndLoop.append( '' ) + EndLoop.SetPyFunction( 'EndLoop' , PyEndLoop ) + ILoopDoLoop = Loop.GetInPort( 'DoLoop' ) + ILoopIndex = Loop.InPort( 'Index' , 'long' ) + ILoopMax = Loop.InPort( 'Max' , 'long' ) + ILoopGate = Loop.GetInPort( 'Gate' ) + OLoopDoLoop = Loop.GetOutPort( 'DoLoop' ) + OLoopIndex = Loop.GetOutPort( 'Index' ) + OLoopMax = Loop.GetOutPort( 'Max' ) + IEndLoopDoLoop = EndLoop.GetInPort( 'DoLoop' ) + IEndLoopIndex = EndLoop.GetInPort( 'Index' ) + IEndLoopMax = EndLoop.GetInPort( 'Max' ) + IEndLoopGate = EndLoop.GetInPort( 'Gate' ) + OEndLoopDoLoop = EndLoop.GetOutPort( 'DoLoop' ) + OEndLoopIndex = EndLoop.GetOutPort( 'Index' ) + OEndLoopMax = EndLoop.GetOutPort( 'Max' ) + OEndLoopGate = EndLoop.GetOutPort( 'Gate' ) + Loop.SetName( 'Loop' ) + Loop.SetAuthor( '' ) + Loop.SetComment( 'Compute Node' ) + Loop.Coords( 208 , 179 ) + + # Creation of Links + LLoop1IndexEndLoop1Index = GraphTwoLoops.Link( OLoop1Index , IEndLoop1Index ) + + LLoop1MaxEndLoop1Max = GraphTwoLoops.Link( OLoop1Max , IEndLoop1Max ) + + LLoop1GateLoopGate = GraphTwoLoops.Link( OLoop1Gate , ILoopGate ) + + LLoopIndexEndLoopIndex = GraphTwoLoops.Link( OLoopIndex , IEndLoopIndex ) + + LLoopMaxEndLoopMax = GraphTwoLoops.Link( OLoopMax , IEndLoopMax ) + + LEndLoopGateEndLoop1Gate = GraphTwoLoops.Link( OEndLoopGate , IEndLoop1Gate ) + + # Input datas + ILoop1Index.Input( 5 ) + ILoop1Max.Input( 15 ) + ILoopIndex.Input( 2 ) + ILoopMax.Input( 20 ) + + # Output Ports of the graph + #OEndLoop1Index = EndLoop1.GetOutPort( 'Index' ) + #OEndLoop1Max = EndLoop1.GetOutPort( 'Max' ) + #OEndLoopIndex = EndLoop.GetOutPort( 'Index' ) + #OEndLoopMax = EndLoop.GetOutPort( 'Max' ) + return GraphTwoLoops + + +GraphTwoLoops = DefGraphTwoLoops() diff --git a/examples/GraphTwoLoops.xml b/examples/GraphTwoLoops.xml new file mode 100644 index 0000000..2809c05 --- /dev/null +++ b/examples/GraphTwoLoops.xml @@ -0,0 +1,321 @@ + + + + + +? + ? + GraphTwoLoops + 1 + ? + +aNewDataFlow + + +long + Loop1__Index + +long + Loop1__Max + +long + Loop__Index + +long + Loop__Max + + +long + EndLoop1__Index + +long + EndLoop1__Max + +long + EndLoop__Index + +long + EndLoop__Max + + + 17/12/2004 - 11:3:21 + 17/12/2004 - 16:23:40 + 2.0 + JR + ? + ? + 0 + 0 + + +? + ? + Loop1 + 4 + EndLoop1 + +Loop1 + + +long + Index + +long + Max + + +long + Index + +long + Max + + + +Loop1 + + + + +More + + + + + + + + + +Next + + + + + 17/12/2004 - 16:23:40 + 17/12/2004 - 16:23:40 + 2.0 + ? + ? + Compute Node + 7 + 175 + +? + ? + EndLoop1 + 5 + Loop1 + +EndLoop1 + + +long + Index + +long + Max + + +long + Index + +long + Max + + + +EndLoop1 + + 17/12/2004 - 16:23:40 + 17/12/2004 - 16:23:40 + 2.0 + ? + ? + Compute Node + 634 + 177 + +? + ? + Loop + 4 + EndLoop + +Loop + + +long + Index + +long + Max + + +long + Index + +long + Max + + + +? + + +? + + +Next + + + + + 17/12/2004 - 16:23:40 + 17/12/2004 - 16:23:40 + 2.0 + ? + ? + Compute Node + 208 + 179 + +? + ? + EndLoop + 5 + Loop + +EndLoop + + +long + Index + +long + Max + + +long + Index + +long + Max + + + +EndLoop + + + + + + + + + 17/12/2004 - 16:23:40 + 17/12/2004 - 16:23:40 + 2.0 + ? + ? + Compute Node + 426 + 180 + + +Loop1 + DoLoop + EndLoop1 + DoLoop + + +Loop1 + Index + EndLoop1 + Index + + +Loop1 + Max + EndLoop1 + Max + + +Loop1 + Gate + Loop + Gate + + +EndLoop1 + DoLoop + Loop1 + DoLoop + + +Loop + DoLoop + EndLoop + DoLoop + + +Loop + Index + EndLoop + Index + + +Loop + Max + EndLoop + Max + + +EndLoop + DoLoop + Loop + DoLoop + + +EndLoop + Gate + EndLoop1 + Gate + + + +GraphTwoLoops + Loop1__Index + Loop1 + Index + +3 + 5 + + +GraphTwoLoops + Loop1__Max + Loop1 + Max + +3 + 15 + + +GraphTwoLoops + Loop__Index + Loop + Index + +3 + 2 + + +GraphTwoLoops + Loop__Max + Loop + Max + +3 + 20 + diff --git a/examples/GraphVoidMoreLoop.py b/examples/GraphVoidMoreLoop.py new file mode 100644 index 0000000..e83d66d --- /dev/null +++ b/examples/GraphVoidMoreLoop.py @@ -0,0 +1,97 @@ + +# Generated python file of Graph GraphNonVoidEndLoop_1 + +from SuperV import * + +# Graph creation of GraphNonVoidEndLoop_1 +def DefGraphNonVoidEndLoop_1() : + GraphNonVoidEndLoop_1 = Graph( 'GraphNonVoidEndLoop_1' ) + GraphNonVoidEndLoop_1.SetName( 'GraphNonVoidEndLoop_1' ) + GraphNonVoidEndLoop_1.SetAuthor( '' ) + GraphNonVoidEndLoop_1.SetComment( '' ) + GraphNonVoidEndLoop_1.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of Loop Nodes + PyInit = [] + PyInit.append( 'def Init(Index,Min,Max,Incr) : ' ) + PyInit.append( ' if Min <= Max : ' ) + PyInit.append( ' Index = Min ' ) + PyInit.append( ' else : ' ) + PyInit.append( ' Index = Max ' ) + PyInit.append( ' print 'Init',Index,Min,Max,Incr ' ) + PyInit.append( ' return Index,Min,Max,Incr ' ) + PyMoreInit = [] + PyMoreInit.append( ' ' ) + PyNextInit = [] + PyNextInit.append( 'import time ' ) + PyNextInit.append( 'def Next(Index,Min,Max,Incr) : ' ) + PyNextInit.append( ' time.sleep(2) ' ) + PyNextInit.append( ' Index = Index + Incr ' ) + PyNextInit.append( ' print 'Next', Index,Min,Max,Incr ' ) + PyNextInit.append( ' return Index,Min,Max,Incr ' ) + Init,EndInit = GraphNonVoidEndLoop_1.LNode( 'Init' , PyInit , '' , PyMoreInit , 'Next' , PyNextInit ) + EndInit.SetName( 'EndInit' ) + EndInit.SetAuthor( '' ) + EndInit.SetComment( 'Compute Node' ) + EndInit.Coords( 411 , 260 ) + PyEndInit = [] + PyEndInit.append( 'def EndLoop(DoLoop,Index,Min,Max,Incr) : ' ) + PyEndInit.append( ' print 'EndLoop',DoLoop,Index,Min,Max,Incr ' ) + PyEndInit.append( ' if Index == Max : ' ) + PyEndInit.append( ' DoLoop = 0 ' ) + PyEndInit.append( ' return DoLoop,Index,Min,Max,Incr ' ) + PyEndInit.append( '' ) + EndInit.SetPyFunction( 'EndLoop' , PyEndInit ) + IInitInitLoop = Init.GetInPort( 'InitLoop' ) + IInitIndex = Init.InPort( 'Index' , 'long' ) + IInitMin = Init.InPort( 'Min' , 'long' ) + IInitMax = Init.InPort( 'Max' , 'long' ) + IInitIncr = Init.InPort( 'Incr' , 'long' ) + IInitGate = Init.GetInPort( 'Gate' ) + OInitDoLoop = Init.GetOutPort( 'DoLoop' ) + OInitIndex = Init.GetOutPort( 'Index' ) + OInitMin = Init.GetOutPort( 'Min' ) + OInitMax = Init.GetOutPort( 'Max' ) + OInitIncr = Init.GetOutPort( 'Incr' ) + IEndInitDoLoop = EndInit.GetInPort( 'DoLoop' ) + IEndInitIndex = EndInit.GetInPort( 'Index' ) + IEndInitMin = EndInit.GetInPort( 'Min' ) + IEndInitMax = EndInit.GetInPort( 'Max' ) + IEndInitIncr = EndInit.GetInPort( 'Incr' ) + IEndInitGate = EndInit.GetInPort( 'Gate' ) + OEndInitDoLoop = EndInit.GetOutPort( 'DoLoop' ) + OEndInitIndex = EndInit.GetOutPort( 'Index' ) + OEndInitMin = EndInit.GetOutPort( 'Min' ) + OEndInitMax = EndInit.GetOutPort( 'Max' ) + OEndInitIncr = EndInit.GetOutPort( 'Incr' ) + Init.SetName( 'Init' ) + Init.SetAuthor( '' ) + Init.SetComment( 'Compute Node' ) + Init.Coords( 17 , 257 ) + + # Creation of Links + LInitIndexEndInitIndex = GraphNonVoidEndLoop_1.Link( OInitIndex , IEndInitIndex ) + + LInitMinEndInitMin = GraphNonVoidEndLoop_1.Link( OInitMin , IEndInitMin ) + + LInitMaxEndInitMax = GraphNonVoidEndLoop_1.Link( OInitMax , IEndInitMax ) + + LInitIncrEndInitIncr = GraphNonVoidEndLoop_1.Link( OInitIncr , IEndInitIncr ) + + # Input datas + IInitIndex.Input( 0 ) + IInitMin.Input( 5 ) + IInitMax.Input( 10 ) + IInitIncr.Input( 1 ) + + # Output Ports of the graph + #OEndInitIndex = EndInit.GetOutPort( 'Index' ) + #OEndInitMin = EndInit.GetOutPort( 'Min' ) + #OEndInitMax = EndInit.GetOutPort( 'Max' ) + #OEndInitIncr = EndInit.GetOutPort( 'Incr' ) + return GraphNonVoidEndLoop_1 + + +GraphNonVoidEndLoop_1 = DefGraphNonVoidEndLoop_1() diff --git a/examples/GraphVoidMoreLoop.xml b/examples/GraphVoidMoreLoop.xml new file mode 100644 index 0000000..6126ed7 --- /dev/null +++ b/examples/GraphVoidMoreLoop.xml @@ -0,0 +1,239 @@ + + + + + +? + ? + GraphNonVoidEndLoop_1 + 1 + ? + +GraphNonVoidEndLoop_1 + + +long + Init__Index + +long + Init__Min + +long + Init__Max + +long + Init__Incr + + +long + EndInit__Index + +long + EndInit__Min + +long + EndInit__Max + +long + EndInit__Incr + + + 24/3/2003 - 14:44:35 + 16/12/2004 - 11:17:3 + 1.04 + ? + ? + ? + 0 + 0 + + +? + ? + Init + 4 + EndInit + +Init + + +long + Index + +long + Min + +long + Max + +long + Incr + + +long + Index + +long + Min + +long + Max + +long + Incr + + + +Init + + + + + + + + +? + + +Next + + + + + + + 16/12/2004 - 11:17:3 + 16/12/2004 - 11:17:3 + 1.04 + ? + ? + Compute Node + 17 + 257 + +? + ? + EndInit + 5 + Init + +EndInit + + +long + Index + +long + Min + +long + Max + +long + Incr + + +long + Index + +long + Min + +long + Max + +long + Incr + + + +EndLoop + + + + + + + 16/12/2004 - 11:17:3 + 16/12/2004 - 11:17:3 + 1.04 + ? + ? + Compute Node + 411 + 260 + + +Init + DoLoop + EndInit + DoLoop + + +Init + Index + EndInit + Index + + +Init + Min + EndInit + Min + + +Init + Max + EndInit + Max + + +Init + Incr + EndInit + Incr + + +EndInit + DoLoop + Init + InitLoop + + + +GraphNonVoidEndLoop_1 + Init__Index + Init + Index + +3 + 0 + + +GraphNonVoidEndLoop_1 + Init__Min + Init + Min + +3 + 5 + + +GraphNonVoidEndLoop_1 + Init__Max + Init + Max + +3 + 10 + + +GraphNonVoidEndLoop_1 + Init__Incr + Init + Incr + +3 + 1 + diff --git a/src/Supervision/Graph_Impl.cxx b/src/Supervision/Graph_Impl.cxx index 15132a8..125b051 100644 --- a/src/Supervision/Graph_Impl.cxx +++ b/src/Supervision/Graph_Impl.cxx @@ -523,7 +523,8 @@ SUPERV::LNode_ptr Graph_Impl::LNode( const char * InitName , myNode->SetCoupled( myEndNode->BaseNode()->Name() ) ; myEndNode->SetCoupled( myNode->BaseNode()->Name() ) ; Link( myNode->Port( "DoLoop" ) , myEndNode->Port( "DoLoop" ) ) ; - Link( myEndNode->Port( "DoLoop" ) , myNode->Port( "InitLoop" ) ) ; +// Link( myEndNode->Port( "DoLoop" ) , myNode->Port( "InitLoop" ) ) ; + Link( myEndNode->Port( "DoLoop" ) , myNode->Port( "DoLoop" ) ) ; } } anEndOfLoop = SUPERV::ELNode::_duplicate( iendobject ) ; -- 2.39.2