From 7d0b3caa558ced1062ee3adbce4d8eec2e547013 Mon Sep 17 00:00:00 2001 From: rahuel Date: Wed, 9 Mar 2005 13:38:03 +0000 Subject: [PATCH] Additionnal tests of Switches --- examples/GraphLoopSwitchDefault.py | 144 +++ examples/GraphLoopSwitchDefault.xml | 336 +++++++ examples/GraphLoopSwitchDefaultAborted.py | 161 ++++ examples/GraphLoopSwitchDefaultAborted.xml | 374 ++++++++ examples/GraphLoopSwitchOddEven.py | 162 ++++ examples/GraphLoopSwitchOddEven.xml | 377 ++++++++ examples/GraphLoopSwitchOfSwitch1.py | 249 ++++++ examples/GraphLoopSwitchOfSwitch1.xml | 590 +++++++++++++ examples/GraphLoopSwitchOfSwitchAborted.py | 244 ++++++ examples/GraphLoopSwitchOfSwitchAborted.xml | 575 ++++++++++++ examples/GraphLoopSwitchsAborted.py | 231 +++++ examples/GraphLoopSwitchsAborted.xml | 553 ++++++++++++ examples/GraphLoopSwitchsBranches.py | 290 ++++++ examples/GraphLoopSwitchsBranches.xml | 692 +++++++++++++++ .../GraphLoopSwitchsBranchesDefaultAborted.py | 346 ++++++++ ...GraphLoopSwitchsBranchesDefaultAborted.xml | 814 +++++++++++++++++ examples/GraphLoopSwitchsBranchesdefault.py | 350 ++++++++ examples/GraphLoopSwitchsBranchesdefault.xml | 826 ++++++++++++++++++ examples/GraphLoopSwitchsNOTValid.py | 229 +++++ examples/GraphLoopSwitchsNOTValid.xml | 559 ++++++++++++ examples/GraphSwitchCheckBranch1NoDefault.py | 231 +++++ examples/GraphSwitchCheckBranch1NoDefault.xml | 532 +++++++++++ examples/GraphSwitchCheckBranch2NOTValid.py | 237 +++++ examples/GraphSwitchCheckBranch2NOTValid.xml | 548 ++++++++++++ examples/GraphSwitchCheckNoDefault2.py | 332 +++++++ examples/GraphSwitchCheckNoDefault2.xml | 781 +++++++++++++++++ examples/GraphSwitchGates.py | 156 ++++ examples/GraphSwitchGates.xml | 354 ++++++++ examples/GraphSwitchGatesDefault.py | 159 ++++ examples/GraphSwitchGatesDefault.xml | 361 ++++++++ examples/GraphSwitchGatesNoDefaultAborted.py | 157 ++++ examples/GraphSwitchGatesNoDefaultAborted.xml | 355 ++++++++ examples/GraphSwitchGatesdefault.py | 163 ++++ examples/GraphSwitchGatesdefault.xml | 367 ++++++++ examples/GraphSwitchGatesdefaultBranch.py | 178 ++++ examples/GraphSwitchGatesdefaultBranch.xml | 399 +++++++++ examples/GraphSwitchNOTValid.py | 143 +++ examples/GraphSwitchNOTValid.xml | 347 ++++++++ 38 files changed, 13902 insertions(+) create mode 100644 examples/GraphLoopSwitchDefault.py create mode 100644 examples/GraphLoopSwitchDefault.xml create mode 100644 examples/GraphLoopSwitchDefaultAborted.py create mode 100644 examples/GraphLoopSwitchDefaultAborted.xml create mode 100644 examples/GraphLoopSwitchOddEven.py create mode 100644 examples/GraphLoopSwitchOddEven.xml create mode 100644 examples/GraphLoopSwitchOfSwitch1.py create mode 100644 examples/GraphLoopSwitchOfSwitch1.xml create mode 100644 examples/GraphLoopSwitchOfSwitchAborted.py create mode 100644 examples/GraphLoopSwitchOfSwitchAborted.xml create mode 100644 examples/GraphLoopSwitchsAborted.py create mode 100644 examples/GraphLoopSwitchsAborted.xml create mode 100644 examples/GraphLoopSwitchsBranches.py create mode 100644 examples/GraphLoopSwitchsBranches.xml create mode 100644 examples/GraphLoopSwitchsBranchesDefaultAborted.py create mode 100644 examples/GraphLoopSwitchsBranchesDefaultAborted.xml create mode 100644 examples/GraphLoopSwitchsBranchesdefault.py create mode 100644 examples/GraphLoopSwitchsBranchesdefault.xml create mode 100644 examples/GraphLoopSwitchsNOTValid.py create mode 100644 examples/GraphLoopSwitchsNOTValid.xml create mode 100644 examples/GraphSwitchCheckBranch1NoDefault.py create mode 100644 examples/GraphSwitchCheckBranch1NoDefault.xml create mode 100644 examples/GraphSwitchCheckBranch2NOTValid.py create mode 100644 examples/GraphSwitchCheckBranch2NOTValid.xml create mode 100644 examples/GraphSwitchCheckNoDefault2.py create mode 100644 examples/GraphSwitchCheckNoDefault2.xml create mode 100644 examples/GraphSwitchGates.py create mode 100644 examples/GraphSwitchGates.xml create mode 100644 examples/GraphSwitchGatesDefault.py create mode 100644 examples/GraphSwitchGatesDefault.xml create mode 100644 examples/GraphSwitchGatesNoDefaultAborted.py create mode 100644 examples/GraphSwitchGatesNoDefaultAborted.xml create mode 100644 examples/GraphSwitchGatesdefault.py create mode 100644 examples/GraphSwitchGatesdefault.xml create mode 100644 examples/GraphSwitchGatesdefaultBranch.py create mode 100644 examples/GraphSwitchGatesdefaultBranch.xml create mode 100644 examples/GraphSwitchNOTValid.py create mode 100644 examples/GraphSwitchNOTValid.xml diff --git a/examples/GraphLoopSwitchDefault.py b/examples/GraphLoopSwitchDefault.py new file mode 100644 index 0000000..3118178 --- /dev/null +++ b/examples/GraphLoopSwitchDefault.py @@ -0,0 +1,144 @@ + +# Generated python file of Graph GraphLoopSwitchDefault + +from SuperV import * + +# Graph creation of GraphLoopSwitchDefault +def DefGraphLoopSwitchDefault() : + GraphLoopSwitchDefault = Graph( 'GraphLoopSwitchDefault' ) + GraphLoopSwitchDefault.SetName( 'GraphLoopSwitchDefault' ) + GraphLoopSwitchDefault.SetAuthor( 'JR' ) + GraphLoopSwitchDefault.SetComment( '' ) + GraphLoopSwitchDefault.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsOdd = [] + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd(a) : ' ) + PyIsOdd.append( ' print a,"IsOdd (GraphLoopSwitch1)" ' ) + PyIsOdd.append( ' sleep( 1 ) ' ) + PyIsOdd.append( ' return a ' ) + IsOdd = GraphLoopSwitchDefault.INode( 'IsOdd' , PyIsOdd ) + IsOdd.SetName( 'IsOdd' ) + IsOdd.SetAuthor( '' ) + IsOdd.SetComment( 'Python function' ) + IsOdd.Coords( 397 , 1 ) + IIsOdda = IsOdd.InPort( 'a' , 'long' ) + IIsOddGate = IsOdd.GetInPort( 'Gate' ) + OIsOdda = IsOdd.OutPort( 'a' , 'long' ) + OIsOddGate = IsOdd.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyInitLoop = [] + PyInitLoop.append( 'def InitLoop(Index,Min,Max) : ' ) + PyInitLoop.append( ' Index = Min ' ) + PyInitLoop.append( ' return Index,Min,Max ' ) + PyInitLoop.append( '' ) + PyMoreInitLoop = [] + PyMoreInitLoop.append( '' ) + PyNextInitLoop = [] + PyNextInitLoop.append( '' ) + InitLoop,EndOfInitLoop = GraphLoopSwitchDefault.LNode( 'InitLoop' , PyInitLoop , '' , PyMoreInitLoop , '' , PyNextInitLoop ) + EndOfInitLoop.SetName( 'EndOfInitLoop' ) + EndOfInitLoop.SetAuthor( '' ) + EndOfInitLoop.SetComment( 'Compute Node' ) + EndOfInitLoop.Coords( 767 , 102 ) + PyEndOfInitLoop = [] + PyEndOfInitLoop.append( 'def EndOfInitLoop( DoLoop , Index , Min , Max ) :' ) + PyEndOfInitLoop.append( ' Index = Index + 1 ' ) + PyEndOfInitLoop.append( ' if Index <= Max : ' ) + PyEndOfInitLoop.append( ' DoLoop = 1 ' ) + PyEndOfInitLoop.append( ' else : ' ) + PyEndOfInitLoop.append( ' DoLoop = 0 ' ) + PyEndOfInitLoop.append( ' return DoLoop,Index,Min,Max ' ) + EndOfInitLoop.SetPyFunction( 'EndOfInitLoop' , PyEndOfInitLoop ) + IInitLoopDoLoop = InitLoop.GetInPort( 'DoLoop' ) + IInitLoopIndex = InitLoop.InPort( 'Index' , 'long' ) + IInitLoopMin = InitLoop.InPort( 'Min' , 'long' ) + IInitLoopMax = InitLoop.InPort( 'Max' , 'long' ) + IInitLoopGate = InitLoop.GetInPort( 'Gate' ) + OInitLoopDoLoop = InitLoop.GetOutPort( 'DoLoop' ) + OInitLoopIndex = InitLoop.GetOutPort( 'Index' ) + OInitLoopMin = InitLoop.GetOutPort( 'Min' ) + OInitLoopMax = InitLoop.GetOutPort( 'Max' ) + IEndOfInitLoopDoLoop = EndOfInitLoop.GetInPort( 'DoLoop' ) + IEndOfInitLoopIndex = EndOfInitLoop.GetInPort( 'Index' ) + IEndOfInitLoopMin = EndOfInitLoop.GetInPort( 'Min' ) + IEndOfInitLoopMax = EndOfInitLoop.GetInPort( 'Max' ) + IEndOfInitLoopGate = EndOfInitLoop.GetInPort( 'Gate' ) + OEndOfInitLoopDoLoop = EndOfInitLoop.GetOutPort( 'DoLoop' ) + OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) + OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) + OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) + OEndOfInitLoopGate = EndOfInitLoop.GetOutPort( 'Gate' ) + InitLoop.SetName( 'InitLoop' ) + InitLoop.SetAuthor( '' ) + InitLoop.SetComment( 'Compute Node' ) + InitLoop.Coords( 10 , 108 ) + + # Creation of Switch Nodes + PySwitch = [] + PySwitch.append( 'from time import * ' ) + PySwitch.append( 'def Switch(a) : ' ) + PySwitch.append( ' if ( a & 1 ) == 0 : ' ) + PySwitch.append( ' sleep(1) ' ) + PySwitch.append( ' return a & 1,1-(a&1),a ' ) + Switch,EndSwitch = GraphLoopSwitchDefault.SNode( 'Switch' , PySwitch ) + EndSwitch.SetName( 'EndSwitch' ) + EndSwitch.SetAuthor( '' ) + EndSwitch.SetComment( 'Compute Node' ) + EndSwitch.Coords( 587 , 103 ) + PyEndSwitch = [] + PyEndSwitch.append( 'def EndSwitch(a) : ' ) + PyEndSwitch.append( ' if ( a & 1 ) == 0 : ' ) + PyEndSwitch.append( ' sleep(1) ' ) + PyEndSwitch.append( ' return a ' ) + EndSwitch.SetPyFunction( 'EndSwitch' , PyEndSwitch ) + IEndSwitcha = EndSwitch.InPort( 'a' , 'long' ) + IEndSwitchDefault = EndSwitch.GetInPort( 'Default' ) + OEndSwitcha = EndSwitch.OutPort( 'a' , 'long' ) + OEndSwitchGate = EndSwitch.GetOutPort( 'Gate' ) + Switch.SetName( 'Switch' ) + Switch.SetAuthor( '' ) + Switch.SetComment( 'Compute Node' ) + Switch.Coords( 194 , 109 ) + ISwitcha = Switch.InPort( 'a' , 'long' ) + ISwitchGate = Switch.GetInPort( 'Gate' ) + OSwitchOdd = Switch.OutPort( 'Odd' , 'long' ) + OSwitchEven = Switch.OutPort( 'Even' , 'int' ) + OSwitcha = Switch.OutPort( 'a' , 'int' ) + OSwitchDefault = Switch.GetOutPort( 'Default' ) + + # Creation of Links + LIsOddaEndSwitcha = GraphLoopSwitchDefault.Link( OIsOdda , IEndSwitcha ) + + LInitLoopIndexSwitcha = GraphLoopSwitchDefault.Link( OInitLoopIndex , ISwitcha ) + + LInitLoopMinEndOfInitLoopMin = GraphLoopSwitchDefault.Link( OInitLoopMin , IEndOfInitLoopMin ) + + LInitLoopMaxEndOfInitLoopMax = GraphLoopSwitchDefault.Link( OInitLoopMax , IEndOfInitLoopMax ) + + LSwitchOddIsOddGate = GraphLoopSwitchDefault.Link( OSwitchOdd , IIsOddGate ) + + LSwitchaIsOdda = GraphLoopSwitchDefault.Link( OSwitcha , IIsOdda ) + + LSwitchDefaultEndSwitchDefault = GraphLoopSwitchDefault.Link( OSwitchDefault , IEndSwitchDefault ) + + LEndSwitchaEndOfInitLoopIndex = GraphLoopSwitchDefault.Link( OEndSwitcha , IEndOfInitLoopIndex ) + + # Input datas + IInitLoopIndex.Input( 0 ) + IInitLoopMin.Input( 5 ) + IInitLoopMax.Input( 23 ) + + # Output Ports of the graph + #OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) + #OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) + #OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) + #OSwitchEven = Switch.GetOutPort( 'Even' ) + return GraphLoopSwitchDefault + + +GraphLoopSwitchDefault = DefGraphLoopSwitchDefault() diff --git a/examples/GraphLoopSwitchDefault.xml b/examples/GraphLoopSwitchDefault.xml new file mode 100644 index 0000000..9cc9dea --- /dev/null +++ b/examples/GraphLoopSwitchDefault.xml @@ -0,0 +1,336 @@ + + + + + +? + ? + GraphLoopSwitchDefault + 1 + ? + +GraphLoopSwitch_1_1 + + +long + InitLoop__Index + +long + InitLoop__Min + +long + InitLoop__Max + + +long + EndOfInitLoop__Index + +long + EndOfInitLoop__Min + +long + EndOfInitLoop__Max + +int + Switch__Even + + + 22/10/2003 - 10:36:39 + 9/2/2005 - 10:29:19 + 1.05 + JR + ? + ? + 0 + 0 + + +? + ? + IsOdd + 3 + ? + +IsOdd + + +long + a + + +long + a + + + +IsOdd + + + + + + 9/2/2005 - 10:29:19 + 9/2/2005 - 10:29:19 + 1.05 + ? + ? + Python function + 397 + 1 + +? + ? + InitLoop + 4 + EndOfInitLoop + +InitLoop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +InitLoop + + + + + +? + + +? + + 9/2/2005 - 10:29:19 + 9/2/2005 - 10:29:19 + 1.05 + ? + ? + Compute Node + 10 + 108 + +? + ? + EndOfInitLoop + 5 + InitLoop + +EndOfInitLoop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +EndOfInitLoop + + + + + + + + 9/2/2005 - 10:29:19 + 9/2/2005 - 10:29:19 + 1.05 + ? + ? + Compute Node + 767 + 102 + +? + ? + Switch + 6 + EndSwitch + +Switch + + +long + a + + +long + Odd + +int + Even + +int + a + + + +Switch + + + + + + 9/2/2005 - 10:29:19 + 9/2/2005 - 10:29:19 + 1.05 + ? + ? + Compute Node + 194 + 109 + +? + ? + EndSwitch + 7 + Switch + +EndSwitch + + +long + a + + +long + a + + + +EndSwitch + + + + + 9/2/2005 - 10:29:19 + 9/2/2005 - 10:29:19 + 1.05 + ? + ? + Compute Node + 587 + 103 + + +IsOdd + a + EndSwitch + a + + +InitLoop + DoLoop + EndOfInitLoop + DoLoop + + +InitLoop + Index + Switch + a + + +InitLoop + Min + EndOfInitLoop + Min + + +InitLoop + Max + EndOfInitLoop + Max + + +EndOfInitLoop + DoLoop + InitLoop + DoLoop + + +Switch + Odd + IsOdd + Gate + + +Switch + a + IsOdd + a + + +Switch + Default + EndSwitch + Default + + +EndSwitch + a + EndOfInitLoop + Index + + + +GraphLoopSwitchDefault + InitLoop__Index + InitLoop + Index + +3 + 0 + + +GraphLoopSwitchDefault + InitLoop__Min + InitLoop + Min + +3 + 5 + + +GraphLoopSwitchDefault + InitLoop__Max + InitLoop + Max + +3 + 23 + diff --git a/examples/GraphLoopSwitchDefaultAborted.py b/examples/GraphLoopSwitchDefaultAborted.py new file mode 100644 index 0000000..8ede72b --- /dev/null +++ b/examples/GraphLoopSwitchDefaultAborted.py @@ -0,0 +1,161 @@ + +# Generated python file of Graph GraphLoopSwitchDefaultAborted + +from SuperV import * + +# Graph creation of GraphLoopSwitchDefaultAborted +def DefGraphLoopSwitchDefaultAborted() : + GraphLoopSwitchDefaultAborted = Graph( 'GraphLoopSwitchDefaultAborted' ) + GraphLoopSwitchDefaultAborted.SetName( 'GraphLoopSwitchDefaultAborted' ) + GraphLoopSwitchDefaultAborted.SetAuthor( 'JR' ) + GraphLoopSwitchDefaultAborted.SetComment( 'Default Ports are not connected and the Executor will detect a Default condition ==> ABORT' ) + GraphLoopSwitchDefaultAborted.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsOdd = [] + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd(a) : ' ) + PyIsOdd.append( ' print a,"IsOdd (GraphLoopSwitch1)" ' ) + PyIsOdd.append( ' sleep( 1 ) ' ) + PyIsOdd.append( ' return a ' ) + IsOdd = GraphLoopSwitchDefaultAborted.INode( 'IsOdd' , PyIsOdd ) + IsOdd.SetName( 'IsOdd' ) + IsOdd.SetAuthor( '' ) + IsOdd.SetComment( 'Python function' ) + IsOdd.Coords( 397 , 1 ) + IIsOdda = IsOdd.InPort( 'a' , 'long' ) + IIsOddGate = IsOdd.GetInPort( 'Gate' ) + OIsOdda = IsOdd.OutPort( 'a' , 'long' ) + OIsOddGate = IsOdd.GetOutPort( 'Gate' ) + + PyVala = [] + PyVala.append( 'from time import * ' ) + PyVala.append( 'def ValEven(Even) : ' ) + PyVala.append( ' sleep(1) ' ) + PyVala.append( ' return Even ' ) + PyVala.append( '' ) + Vala = GraphLoopSwitchDefaultAborted.INode( 'ValEven' , PyVala ) + Vala.SetName( 'Vala' ) + Vala.SetAuthor( '' ) + Vala.SetComment( 'Compute Node' ) + Vala.Coords( 394 , 137 ) + IValaEven = Vala.InPort( 'Even' , 'long' ) + IValaGate = Vala.GetInPort( 'Gate' ) + OValaEven = Vala.OutPort( 'Even' , 'long' ) + OValaGate = Vala.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyInitLoop = [] + PyInitLoop.append( 'def InitLoop(Index,Min,Max) : ' ) + PyInitLoop.append( ' Index = Min ' ) + PyInitLoop.append( ' return Index,Min,Max ' ) + PyInitLoop.append( '' ) + PyMoreInitLoop = [] + PyMoreInitLoop.append( '' ) + PyNextInitLoop = [] + PyNextInitLoop.append( '' ) + InitLoop,EndOfInitLoop = GraphLoopSwitchDefaultAborted.LNode( 'InitLoop' , PyInitLoop , '' , PyMoreInitLoop , '' , PyNextInitLoop ) + EndOfInitLoop.SetName( 'EndOfInitLoop' ) + EndOfInitLoop.SetAuthor( '' ) + EndOfInitLoop.SetComment( 'Compute Node' ) + EndOfInitLoop.Coords( 767 , 102 ) + PyEndOfInitLoop = [] + PyEndOfInitLoop.append( 'def EndOfInitLoop( DoLoop , Index , Min , Max ) :' ) + PyEndOfInitLoop.append( ' Index = Index + 1 ' ) + PyEndOfInitLoop.append( ' if Index <= Max : ' ) + PyEndOfInitLoop.append( ' DoLoop = 1 ' ) + PyEndOfInitLoop.append( ' else : ' ) + PyEndOfInitLoop.append( ' DoLoop = 0 ' ) + PyEndOfInitLoop.append( ' return DoLoop,Index,Min,Max ' ) + EndOfInitLoop.SetPyFunction( 'EndOfInitLoop' , PyEndOfInitLoop ) + IInitLoopDoLoop = InitLoop.GetInPort( 'DoLoop' ) + IInitLoopIndex = InitLoop.InPort( 'Index' , 'long' ) + IInitLoopMin = InitLoop.InPort( 'Min' , 'long' ) + IInitLoopMax = InitLoop.InPort( 'Max' , 'long' ) + IInitLoopGate = InitLoop.GetInPort( 'Gate' ) + OInitLoopDoLoop = InitLoop.GetOutPort( 'DoLoop' ) + OInitLoopIndex = InitLoop.GetOutPort( 'Index' ) + OInitLoopMin = InitLoop.GetOutPort( 'Min' ) + OInitLoopMax = InitLoop.GetOutPort( 'Max' ) + IEndOfInitLoopDoLoop = EndOfInitLoop.GetInPort( 'DoLoop' ) + IEndOfInitLoopIndex = EndOfInitLoop.GetInPort( 'Index' ) + IEndOfInitLoopMin = EndOfInitLoop.GetInPort( 'Min' ) + IEndOfInitLoopMax = EndOfInitLoop.GetInPort( 'Max' ) + IEndOfInitLoopGate = EndOfInitLoop.GetInPort( 'Gate' ) + OEndOfInitLoopDoLoop = EndOfInitLoop.GetOutPort( 'DoLoop' ) + OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) + OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) + OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) + OEndOfInitLoopGate = EndOfInitLoop.GetOutPort( 'Gate' ) + InitLoop.SetName( 'InitLoop' ) + InitLoop.SetAuthor( '' ) + InitLoop.SetComment( 'Compute Node' ) + InitLoop.Coords( 10 , 108 ) + + # Creation of Switch Nodes + PySwitch = [] + PySwitch.append( 'from time import * ' ) + PySwitch.append( 'def Switch(a) : ' ) + PySwitch.append( ' if ( a & 1 ) == 0 : ' ) + PySwitch.append( ' sleep(1) ' ) + PySwitch.append( ' return a & 1,1-(a&1),a ' ) + Switch,EndSwitch = GraphLoopSwitchDefaultAborted.SNode( 'Switch' , PySwitch ) + EndSwitch.SetName( 'EndSwitch' ) + EndSwitch.SetAuthor( '' ) + EndSwitch.SetComment( 'Compute Node' ) + EndSwitch.Coords( 587 , 103 ) + PyEndSwitch = [] + PyEndSwitch.append( 'def EndSwitch(a,Even) : ' ) + PyEndSwitch.append( ' sleep(1) ' ) + PyEndSwitch.append( ' return a ' ) + EndSwitch.SetPyFunction( 'EndSwitch' , PyEndSwitch ) + IEndSwitcha = EndSwitch.InPort( 'a' , 'long' ) + IEndSwitchEven = EndSwitch.InPort( 'Even' , 'long' ) + IEndSwitchDefault = EndSwitch.GetInPort( 'Default' ) + OEndSwitcha = EndSwitch.OutPort( 'a' , 'long' ) + OEndSwitchGate = EndSwitch.GetOutPort( 'Gate' ) + Switch.SetName( 'Switch' ) + Switch.SetAuthor( '' ) + Switch.SetComment( 'Compute Node' ) + Switch.Coords( 194 , 109 ) + ISwitcha = Switch.InPort( 'a' , 'long' ) + ISwitchGate = Switch.GetInPort( 'Gate' ) + OSwitchOdd = Switch.OutPort( 'Odd' , 'long' ) + OSwitchEven = Switch.OutPort( 'Even' , 'int' ) + OSwitcha = Switch.OutPort( 'a' , 'int' ) + OSwitchDefault = Switch.GetOutPort( 'Default' ) + + # Creation of Links + LIsOddaEndSwitcha = GraphLoopSwitchDefaultAborted.Link( OIsOdda , IEndSwitcha ) + + LInitLoopIndexSwitcha = GraphLoopSwitchDefaultAborted.Link( OInitLoopIndex , ISwitcha ) + + LInitLoopMinEndOfInitLoopMin = GraphLoopSwitchDefaultAborted.Link( OInitLoopMin , IEndOfInitLoopMin ) + + LInitLoopMaxEndOfInitLoopMax = GraphLoopSwitchDefaultAborted.Link( OInitLoopMax , IEndOfInitLoopMax ) + + LSwitchOddIsOddGate = GraphLoopSwitchDefaultAborted.Link( OSwitchOdd , IIsOddGate ) + + LSwitchEvenValaEven = GraphLoopSwitchDefaultAborted.Link( OSwitchEven , IValaEven ) + + LSwitchaIsOdda = GraphLoopSwitchDefaultAborted.Link( OSwitcha , IIsOdda ) + + LEndSwitchaEndOfInitLoopIndex = GraphLoopSwitchDefaultAborted.Link( OEndSwitcha , IEndOfInitLoopIndex ) + + LValaEvenEndSwitchEven = GraphLoopSwitchDefaultAborted.Link( OValaEven , IEndSwitchEven ) + + # Input datas + IInitLoopIndex.Input( 0 ) + IInitLoopMin.Input( 5 ) + IInitLoopMax.Input( 23 ) + + # Output Ports of the graph + #OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) + #OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) + #OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) + return GraphLoopSwitchDefaultAborted + + +GraphLoopSwitchDefaultAborted = DefGraphLoopSwitchDefaultAborted() diff --git a/examples/GraphLoopSwitchDefaultAborted.xml b/examples/GraphLoopSwitchDefaultAborted.xml new file mode 100644 index 0000000..6fdf946 --- /dev/null +++ b/examples/GraphLoopSwitchDefaultAborted.xml @@ -0,0 +1,374 @@ + + + + + +? + ? + GraphLoopSwitchDefaultAborted + 1 + ? + +GraphLoopSwitch_1 + + +long + InitLoop__Index + +long + InitLoop__Min + +long + InitLoop__Max + + +long + EndOfInitLoop__Index + +long + EndOfInitLoop__Min + +long + EndOfInitLoop__Max + + + 22/10/2003 - 10:36:39 + 11/2/2005 - 11:46:10 + 1.05 + JR + ? + Default Ports are not connected and the Executor will detect a Default condition ==> ABORT + 0 + 0 + + +? + ? + IsOdd + 3 + ? + +IsOdd + + +long + a + + +long + a + + + +IsOdd + + + + + + 11/2/2005 - 11:46:10 + 11/2/2005 - 11:46:10 + 1.05 + ? + ? + Python function + 397 + 1 + +? + ? + InitLoop + 4 + EndOfInitLoop + +InitLoop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +InitLoop + + + + + +? + + +? + + 11/2/2005 - 11:46:10 + 11/2/2005 - 11:46:10 + 1.05 + ? + ? + Compute Node + 10 + 108 + +? + ? + EndOfInitLoop + 5 + InitLoop + +EndOfInitLoop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +EndOfInitLoop + + + + + + + + 11/2/2005 - 11:46:10 + 11/2/2005 - 11:46:10 + 1.05 + ? + ? + Compute Node + 767 + 102 + +? + ? + Switch + 6 + EndSwitch + +Switch + + +long + a + + +long + Odd + +int + Even + +int + a + + + +Switch + + + + + + 11/2/2005 - 11:46:10 + 11/2/2005 - 11:46:10 + 1.05 + ? + ? + Compute Node + 194 + 109 + +? + ? + EndSwitch + 7 + Switch + +EndSwitch + + +long + a + +long + Even + + +long + a + + + +EndSwitch + + + + 11/2/2005 - 11:46:10 + 11/2/2005 - 11:46:10 + 1.05 + ? + ? + Compute Node + 587 + 103 + +? + ? + Vala + 3 + ? + +Vala + + +long + Even + + +long + Even + + + +ValEven + + + + + + 11/2/2005 - 11:46:10 + 11/2/2005 - 11:46:10 + 2.0 + ? + ? + Compute Node + 394 + 137 + + +IsOdd + a + EndSwitch + a + + +InitLoop + DoLoop + EndOfInitLoop + DoLoop + + +InitLoop + Index + Switch + a + + +InitLoop + Min + EndOfInitLoop + Min + + +InitLoop + Max + EndOfInitLoop + Max + + +EndOfInitLoop + DoLoop + InitLoop + DoLoop + + +Switch + Odd + IsOdd + Gate + + +Switch + Even + Vala + Even + + +Switch + a + IsOdd + a + + +EndSwitch + a + EndOfInitLoop + Index + + +Vala + Even + EndSwitch + Even + + + +GraphLoopSwitchDefaultAborted + InitLoop__Index + InitLoop + Index + +3 + 0 + + +GraphLoopSwitchDefaultAborted + InitLoop__Min + InitLoop + Min + +3 + 5 + + +GraphLoopSwitchDefaultAborted + InitLoop__Max + InitLoop + Max + +3 + 23 + diff --git a/examples/GraphLoopSwitchOddEven.py b/examples/GraphLoopSwitchOddEven.py new file mode 100644 index 0000000..645890a --- /dev/null +++ b/examples/GraphLoopSwitchOddEven.py @@ -0,0 +1,162 @@ + +# Generated python file of Graph GraphLoopSwitchOddEven + +from SuperV import * + +# Graph creation of GraphLoopSwitchOddEven +def DefGraphLoopSwitchOddEven() : + GraphLoopSwitchOddEven = Graph( 'GraphLoopSwitchOddEven' ) + GraphLoopSwitchOddEven.SetName( 'GraphLoopSwitchOddEven' ) + GraphLoopSwitchOddEven.SetAuthor( 'JR' ) + GraphLoopSwitchOddEven.SetComment( '' ) + GraphLoopSwitchOddEven.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsOdd = [] + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd(a) : ' ) + PyIsOdd.append( ' print a,"IsOdd (GraphLoopSwitch1)" ' ) + PyIsOdd.append( ' sleep( 1 ) ' ) + PyIsOdd.append( ' return a ' ) + IsOdd = GraphLoopSwitchOddEven.INode( 'IsOdd' , PyIsOdd ) + IsOdd.SetName( 'IsOdd' ) + IsOdd.SetAuthor( '' ) + IsOdd.SetComment( 'Python function' ) + IsOdd.Coords( 397 , 1 ) + IIsOdda = IsOdd.InPort( 'a' , 'long' ) + IIsOddGate = IsOdd.GetInPort( 'Gate' ) + OIsOdda = IsOdd.OutPort( 'a' , 'long' ) + OIsOddGate = IsOdd.GetOutPort( 'Gate' ) + + PyIsEven = [] + PyIsEven.append( 'from time import * ' ) + PyIsEven.append( 'def IsEven(a) : ' ) + PyIsEven.append( ' sleep(1) ' ) + PyIsEven.append( ' return a ' ) + PyIsEven.append( ' ' ) + IsEven = GraphLoopSwitchOddEven.INode( 'IsEven' , PyIsEven ) + IsEven.SetName( 'IsEven' ) + IsEven.SetAuthor( '' ) + IsEven.SetComment( 'Compute Node' ) + IsEven.Coords( 400 , 160 ) + IIsEvena = IsEven.InPort( 'a' , 'long' ) + IIsEvenGate = IsEven.GetInPort( 'Gate' ) + OIsEvena = IsEven.OutPort( 'a' , 'long' ) + OIsEvenGate = IsEven.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyInitLoop = [] + PyInitLoop.append( 'def InitLoop(Index,Min,Max) : ' ) + PyInitLoop.append( ' Index = Min ' ) + PyInitLoop.append( ' return Index,Min,Max ' ) + PyInitLoop.append( '' ) + PyMoreInitLoop = [] + PyMoreInitLoop.append( '' ) + PyNextInitLoop = [] + PyNextInitLoop.append( '' ) + InitLoop,EndOfInitLoop = GraphLoopSwitchOddEven.LNode( 'InitLoop' , PyInitLoop , '' , PyMoreInitLoop , '' , PyNextInitLoop ) + EndOfInitLoop.SetName( 'EndOfInitLoop' ) + EndOfInitLoop.SetAuthor( '' ) + EndOfInitLoop.SetComment( 'Compute Node' ) + EndOfInitLoop.Coords( 767 , 102 ) + PyEndOfInitLoop = [] + PyEndOfInitLoop.append( 'def EndOfInitLoop( DoLoop , Index , Min , Max ) :' ) + PyEndOfInitLoop.append( ' Index = Index + 1 ' ) + PyEndOfInitLoop.append( ' if Index <= Max : ' ) + PyEndOfInitLoop.append( ' DoLoop = 1 ' ) + PyEndOfInitLoop.append( ' else : ' ) + PyEndOfInitLoop.append( ' DoLoop = 0 ' ) + PyEndOfInitLoop.append( ' return DoLoop,Index,Min,Max ' ) + EndOfInitLoop.SetPyFunction( 'EndOfInitLoop' , PyEndOfInitLoop ) + IInitLoopDoLoop = InitLoop.GetInPort( 'DoLoop' ) + IInitLoopIndex = InitLoop.InPort( 'Index' , 'long' ) + IInitLoopMin = InitLoop.InPort( 'Min' , 'long' ) + IInitLoopMax = InitLoop.InPort( 'Max' , 'long' ) + IInitLoopGate = InitLoop.GetInPort( 'Gate' ) + OInitLoopDoLoop = InitLoop.GetOutPort( 'DoLoop' ) + OInitLoopIndex = InitLoop.GetOutPort( 'Index' ) + OInitLoopMin = InitLoop.GetOutPort( 'Min' ) + OInitLoopMax = InitLoop.GetOutPort( 'Max' ) + IEndOfInitLoopDoLoop = EndOfInitLoop.GetInPort( 'DoLoop' ) + IEndOfInitLoopIndex = EndOfInitLoop.GetInPort( 'Index' ) + IEndOfInitLoopMin = EndOfInitLoop.GetInPort( 'Min' ) + IEndOfInitLoopMax = EndOfInitLoop.GetInPort( 'Max' ) + IEndOfInitLoopGate = EndOfInitLoop.GetInPort( 'Gate' ) + OEndOfInitLoopDoLoop = EndOfInitLoop.GetOutPort( 'DoLoop' ) + OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) + OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) + OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) + OEndOfInitLoopGate = EndOfInitLoop.GetOutPort( 'Gate' ) + InitLoop.SetName( 'InitLoop' ) + InitLoop.SetAuthor( '' ) + InitLoop.SetComment( 'Compute Node' ) + InitLoop.Coords( 10 , 108 ) + + # Creation of Switch Nodes + PySwitch = [] + PySwitch.append( 'from time import * ' ) + PySwitch.append( 'def Switch(a) : ' ) + PySwitch.append( ' if ( a & 1 ) == 0 : ' ) + PySwitch.append( ' sleep(1) ' ) + PySwitch.append( ' return a & 1,1-(a&1),a ' ) + Switch,EndSwitch = GraphLoopSwitchOddEven.SNode( 'Switch' , PySwitch ) + EndSwitch.SetName( 'EndSwitch' ) + EndSwitch.SetAuthor( '' ) + EndSwitch.SetComment( 'Compute Node' ) + EndSwitch.Coords( 587 , 103 ) + PyEndSwitch = [] + PyEndSwitch.append( 'def EndSwitch(a) : ' ) + PyEndSwitch.append( ' sleep(1) ' ) + PyEndSwitch.append( ' return a ' ) + EndSwitch.SetPyFunction( 'EndSwitch' , PyEndSwitch ) + IEndSwitcha = EndSwitch.InPort( 'a' , 'long' ) + IEndSwitchDefault = EndSwitch.GetInPort( 'Default' ) + OEndSwitcha = EndSwitch.OutPort( 'a' , 'long' ) + OEndSwitchGate = EndSwitch.GetOutPort( 'Gate' ) + Switch.SetName( 'Switch' ) + Switch.SetAuthor( '' ) + Switch.SetComment( 'Compute Node' ) + Switch.Coords( 194 , 109 ) + ISwitcha = Switch.InPort( 'a' , 'long' ) + ISwitchGate = Switch.GetInPort( 'Gate' ) + OSwitchOdd = Switch.OutPort( 'Odd' , 'long' ) + OSwitchEven = Switch.OutPort( 'Even' , 'int' ) + OSwitcha = Switch.OutPort( 'a' , 'int' ) + OSwitchDefault = Switch.GetOutPort( 'Default' ) + + # Creation of Links + LIsOddaEndSwitcha = GraphLoopSwitchOddEven.Link( OIsOdda , IEndSwitcha ) + + LInitLoopIndexSwitcha = GraphLoopSwitchOddEven.Link( OInitLoopIndex , ISwitcha ) + + LInitLoopMinEndOfInitLoopMin = GraphLoopSwitchOddEven.Link( OInitLoopMin , IEndOfInitLoopMin ) + + LInitLoopMaxEndOfInitLoopMax = GraphLoopSwitchOddEven.Link( OInitLoopMax , IEndOfInitLoopMax ) + + LSwitchOddIsOddGate = GraphLoopSwitchOddEven.Link( OSwitchOdd , IIsOddGate ) + + LSwitchEvenIsEvenGate = GraphLoopSwitchOddEven.Link( OSwitchEven , IIsEvenGate ) + + LSwitchaIsOdda = GraphLoopSwitchOddEven.Link( OSwitcha , IIsOdda ) + + LSwitchaIsEvena = GraphLoopSwitchOddEven.Link( OSwitcha , IIsEvena ) + + LEndSwitchaEndOfInitLoopIndex = GraphLoopSwitchOddEven.Link( OEndSwitcha , IEndOfInitLoopIndex ) + + LIsEvenaEndSwitcha = GraphLoopSwitchOddEven.Link( OIsEvena , IEndSwitcha ) + + # Input datas + IInitLoopIndex.Input( 0 ) + IInitLoopMin.Input( 5 ) + IInitLoopMax.Input( 23 ) + + # Output Ports of the graph + #OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) + #OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) + #OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) + return GraphLoopSwitchOddEven + + +GraphLoopSwitchOddEven = DefGraphLoopSwitchOddEven() diff --git a/examples/GraphLoopSwitchOddEven.xml b/examples/GraphLoopSwitchOddEven.xml new file mode 100644 index 0000000..219eeca --- /dev/null +++ b/examples/GraphLoopSwitchOddEven.xml @@ -0,0 +1,377 @@ + + + + + +? + ? + GraphLoopSwitchOddEven + 1 + ? + +GraphLoopSwitchOddEven + + +long + InitLoop__Index + +long + InitLoop__Min + +long + InitLoop__Max + + +long + EndOfInitLoop__Index + +long + EndOfInitLoop__Min + +long + EndOfInitLoop__Max + + + 22/10/2003 - 10:36:39 + 14/2/2005 - 16:43:55 + 1.05 + JR + ? + ? + 0 + 0 + + +? + ? + IsOdd + 3 + ? + +IsOdd + + +long + a + + +long + a + + + +IsOdd + + + + + + 14/2/2005 - 16:43:55 + 14/2/2005 - 16:43:55 + 1.05 + ? + ? + Python function + 397 + 1 + +? + ? + InitLoop + 4 + EndOfInitLoop + +InitLoop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +InitLoop + + + + + +? + + +? + + 14/2/2005 - 16:43:55 + 14/2/2005 - 16:43:55 + 1.05 + ? + ? + Compute Node + 10 + 108 + +? + ? + EndOfInitLoop + 5 + InitLoop + +EndOfInitLoop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +EndOfInitLoop + + + + + + + + 14/2/2005 - 16:43:55 + 14/2/2005 - 16:43:55 + 1.05 + ? + ? + Compute Node + 767 + 102 + +? + ? + Switch + 6 + EndSwitch + +Switch + + +long + a + + +long + Odd + +int + Even + +int + a + + + +Switch + + + + + + 14/2/2005 - 16:43:55 + 14/2/2005 - 16:43:55 + 1.05 + ? + ? + Compute Node + 194 + 109 + +? + ? + EndSwitch + 7 + Switch + +EndSwitch + + +long + a + + +long + a + + + +EndSwitch + + + + 14/2/2005 - 16:43:55 + 14/2/2005 - 16:43:55 + 1.05 + ? + ? + Compute Node + 587 + 103 + +? + ? + IsEven + 3 + ? + +IsEven + + +long + a + + +long + a + + + +IsEven + + + + + + 14/2/2005 - 16:43:55 + 14/2/2005 - 16:43:55 + 2.0 + ? + ? + Compute Node + 400 + 160 + + +IsOdd + a + EndSwitch + a + + +InitLoop + DoLoop + EndOfInitLoop + DoLoop + + +InitLoop + Index + Switch + a + + +InitLoop + Min + EndOfInitLoop + Min + + +InitLoop + Max + EndOfInitLoop + Max + + +EndOfInitLoop + DoLoop + InitLoop + DoLoop + + +Switch + Odd + IsOdd + Gate + + +Switch + Even + IsEven + Gate + + +Switch + a + IsOdd + a + + +Switch + a + IsEven + a + + +EndSwitch + a + EndOfInitLoop + Index + + +IsEven + a + EndSwitch + a + + + +GraphLoopSwitchOddEven + InitLoop__Index + InitLoop + Index + +3 + 0 + + +GraphLoopSwitchOddEven + InitLoop__Min + InitLoop + Min + +3 + 5 + + +GraphLoopSwitchOddEven + InitLoop__Max + InitLoop + Max + +3 + 23 + diff --git a/examples/GraphLoopSwitchOfSwitch1.py b/examples/GraphLoopSwitchOfSwitch1.py new file mode 100644 index 0000000..00f5c14 --- /dev/null +++ b/examples/GraphLoopSwitchOfSwitch1.py @@ -0,0 +1,249 @@ + +# Generated python file of Graph GraphLoopSwitchOfSwitch1 + +from SuperV import * + +# Graph creation of GraphLoopSwitchOfSwitch1 +def DefGraphLoopSwitchOfSwitch1() : + GraphLoopSwitchOfSwitch1 = Graph( 'GraphLoopSwitchOfSwitch1' ) + GraphLoopSwitchOfSwitch1.SetName( 'GraphLoopSwitchOfSwitch1' ) + GraphLoopSwitchOfSwitch1.SetAuthor( 'JR' ) + GraphLoopSwitchOfSwitch1.SetComment( 'DefaultPorts of SwitchOdd and EndSwitchOdd are not connected but that link was not used' ) + GraphLoopSwitchOfSwitch1.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsEven = [] + PyIsEven.append( 'from time import * ' ) + PyIsEven.append( 'def IsEven(a) : ' ) + PyIsEven.append( ' print a,"IsEven (GraphSwitch)" ' ) + PyIsEven.append( ' sleep( 1 ) ' ) + PyIsEven.append( ' return a ' ) + IsEven = GraphLoopSwitchOfSwitch1.INode( 'IsEven' , PyIsEven ) + IsEven.SetName( 'IsEven' ) + IsEven.SetAuthor( '' ) + IsEven.SetComment( 'Compute Node' ) + IsEven.Coords( 437 , 520 ) + IIsEvena = IsEven.InPort( 'a' , 'long' ) + IIsEvenGate = IsEven.GetInPort( 'Gate' ) + OIsEvena = IsEven.OutPort( 'a' , 'long' ) + OIsEvenGate = IsEven.GetOutPort( 'Gate' ) + + PyPseudoPOne = [] + PyPseudoPOne.append( 'from time import * ' ) + PyPseudoPOne.append( 'def PseudoPOne(POne) : ' ) + PyPseudoPOne.append( ' sleep(1) ' ) + PyPseudoPOne.append( ' return 6*POne+1 ' ) + PseudoPOne = GraphLoopSwitchOfSwitch1.INode( 'PseudoPOne' , PyPseudoPOne ) + PseudoPOne.SetName( 'PseudoPOne' ) + PseudoPOne.SetAuthor( '' ) + PseudoPOne.SetComment( 'Compute Node' ) + PseudoPOne.Coords( 612 , 5 ) + IPseudoPOnePOne = PseudoPOne.InPort( 'POne' , 'long' ) + IPseudoPOneGate = PseudoPOne.GetInPort( 'Gate' ) + OPseudoPOnea = PseudoPOne.OutPort( 'a' , 'long' ) + OPseudoPOneGate = PseudoPOne.GetOutPort( 'Gate' ) + + PyPseudoPThree = [] + PyPseudoPThree.append( 'from time import * ' ) + PyPseudoPThree.append( 'def PseudoPThree_1(PThree) : ' ) + PyPseudoPThree.append( ' sleep(1) ' ) + PyPseudoPThree.append( ' return 6*PThree+3 ' ) + PseudoPThree = GraphLoopSwitchOfSwitch1.INode( 'PseudoPThree_1' , PyPseudoPThree ) + PseudoPThree.SetName( 'PseudoPThree' ) + PseudoPThree.SetAuthor( '' ) + PseudoPThree.SetComment( 'Compute Node' ) + PseudoPThree.Coords( 620 , 149 ) + IPseudoPThreePThree = PseudoPThree.InPort( 'PThree' , 'long' ) + IPseudoPThreeGate = PseudoPThree.GetInPort( 'Gate' ) + OPseudoPThreea = PseudoPThree.OutPort( 'a' , 'long' ) + OPseudoPThreeGate = PseudoPThree.GetOutPort( 'Gate' ) + + PyPseudoPFive = [] + PyPseudoPFive.append( 'from time import * ' ) + PyPseudoPFive.append( 'def PseudoPFive(PFive) : ' ) + PyPseudoPFive.append( ' sleep(1) ' ) + PyPseudoPFive.append( ' return 6*PFive+5 ' ) + PseudoPFive = GraphLoopSwitchOfSwitch1.INode( 'PseudoPFive' , PyPseudoPFive ) + PseudoPFive.SetName( 'PseudoPFive' ) + PseudoPFive.SetAuthor( '' ) + PseudoPFive.SetComment( 'Compute Node' ) + PseudoPFive.Coords( 625 , 343 ) + IPseudoPFivePFive = PseudoPFive.InPort( 'PFive' , 'long' ) + IPseudoPFiveGate = PseudoPFive.GetInPort( 'Gate' ) + OPseudoPFivea = PseudoPFive.OutPort( 'a' , 'long' ) + OPseudoPFiveGate = PseudoPFive.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyLoopSwitch = [] + PyLoopSwitch.append( 'def InitLoop(Index,Min,Max) : ' ) + PyLoopSwitch.append( ' Index = Max ' ) + PyLoopSwitch.append( ' return Index,Min,Max ' ) + PyMoreLoopSwitch = [] + PyMoreLoopSwitch.append( 'def MoreLoop(Index,Min,Max) : ' ) + PyMoreLoopSwitch.append( ' if Index >= Min : ' ) + PyMoreLoopSwitch.append( ' DoLoop = 1 ' ) + PyMoreLoopSwitch.append( ' else : ' ) + PyMoreLoopSwitch.append( ' DoLoop = 0 ' ) + PyMoreLoopSwitch.append( ' return DoLoop,Index,Min,Max ' ) + PyNextLoopSwitch = [] + PyNextLoopSwitch.append( 'def NextLoop(Index,Min,Max) : ' ) + PyNextLoopSwitch.append( ' Index = Index - 1 ' ) + PyNextLoopSwitch.append( ' return Index,Min,Max ' ) + LoopSwitch,EndOfLoopSwitch = GraphLoopSwitchOfSwitch1.LNode( 'InitLoop' , PyLoopSwitch , 'MoreLoop' , PyMoreLoopSwitch , 'NextLoop' , PyNextLoopSwitch ) + EndOfLoopSwitch.SetName( 'EndOfLoopSwitch' ) + EndOfLoopSwitch.SetAuthor( '' ) + EndOfLoopSwitch.SetComment( 'Compute Node' ) + EndOfLoopSwitch.Coords( 1268 , 210 ) + PyEndOfLoopSwitch = [] + EndOfLoopSwitch.SetPyFunction( '' , PyEndOfLoopSwitch ) + ILoopSwitchDoLoop = LoopSwitch.GetInPort( 'DoLoop' ) + ILoopSwitchIndex = LoopSwitch.InPort( 'Index' , 'long' ) + ILoopSwitchMin = LoopSwitch.InPort( 'Min' , 'long' ) + ILoopSwitchMax = LoopSwitch.InPort( 'Max' , 'long' ) + ILoopSwitchGate = LoopSwitch.GetInPort( 'Gate' ) + OLoopSwitchDoLoop = LoopSwitch.GetOutPort( 'DoLoop' ) + OLoopSwitchIndex = LoopSwitch.GetOutPort( 'Index' ) + OLoopSwitchMin = LoopSwitch.GetOutPort( 'Min' ) + OLoopSwitchMax = LoopSwitch.GetOutPort( 'Max' ) + IEndOfLoopSwitchDoLoop = EndOfLoopSwitch.GetInPort( 'DoLoop' ) + IEndOfLoopSwitchIndex = EndOfLoopSwitch.GetInPort( 'Index' ) + IEndOfLoopSwitchMin = EndOfLoopSwitch.GetInPort( 'Min' ) + IEndOfLoopSwitchMax = EndOfLoopSwitch.GetInPort( 'Max' ) + IEndOfLoopSwitchGate = EndOfLoopSwitch.GetInPort( 'Gate' ) + OEndOfLoopSwitchDoLoop = EndOfLoopSwitch.GetOutPort( 'DoLoop' ) + OEndOfLoopSwitchIndex = EndOfLoopSwitch.GetOutPort( 'Index' ) + OEndOfLoopSwitchMin = EndOfLoopSwitch.GetOutPort( 'Min' ) + OEndOfLoopSwitchMax = EndOfLoopSwitch.GetOutPort( 'Max' ) + OEndOfLoopSwitchGate = EndOfLoopSwitch.GetOutPort( 'Gate' ) + LoopSwitch.SetName( 'LoopSwitch' ) + LoopSwitch.SetAuthor( '' ) + LoopSwitch.SetComment( 'Compute Node' ) + LoopSwitch.Coords( 6 , 233 ) + + # Creation of Switch Nodes + PySwitch = [] + PySwitch.append( 'from time import * ' ) + PySwitch.append( 'def Switch(a) : ' ) + PySwitch.append( ' sleep(1) ' ) + PySwitch.append( ' if a <= 0 : ' ) + PySwitch.append( ' return 0,a,0 ' ) + PySwitch.append( ' return a & 1,a,1-(a&1) ' ) + Switch,EndOfSwitch = GraphLoopSwitchOfSwitch1.SNode( 'Switch' , PySwitch ) + EndOfSwitch.SetName( 'EndOfSwitch' ) + EndOfSwitch.SetAuthor( '' ) + EndOfSwitch.SetComment( 'Compute Node' ) + EndOfSwitch.Coords( 1075 , 210 ) + PyEndOfSwitch = [] + EndOfSwitch.SetPyFunction( 'EndSwitch_1' , PyEndOfSwitch ) + IEndOfSwitcha = EndOfSwitch.InPort( 'a' , 'long' ) + IEndOfSwitchDefault = EndOfSwitch.GetInPort( 'Default' ) + OEndOfSwitcha = EndOfSwitch.OutPort( 'a' , 'long' ) + OEndOfSwitchGate = EndOfSwitch.GetOutPort( 'Gate' ) + Switch.SetName( 'Switch' ) + Switch.SetAuthor( '' ) + Switch.SetComment( 'Compute Node' ) + Switch.Coords( 201 , 233 ) + ISwitcha = Switch.InPort( 'a' , 'long' ) + ISwitchGate = Switch.GetInPort( 'Gate' ) + OSwitchOdd = Switch.OutPort( 'Odd' , 'long' ) + OSwitcha = Switch.OutPort( 'a' , 'int' ) + OSwitchEven = Switch.OutPort( 'Even' , 'boolean' ) + OSwitchDefault = Switch.GetOutPort( 'Default' ) + + PySwitchOdd = [] + PySwitchOdd.append( 'def SwitchOdd(a) : ' ) + PySwitchOdd.append( ' n = a/6 ' ) + PySwitchOdd.append( ' r = a%6 ' ) + PySwitchOdd.append( ' POne = 0 ' ) + PySwitchOdd.append( ' PThree = 0 ' ) + PySwitchOdd.append( ' PFive = 0 ' ) + PySwitchOdd.append( ' if r == 1 : ' ) + PySwitchOdd.append( ' POne = 1 ' ) + PySwitchOdd.append( ' if r == 3 : ' ) + PySwitchOdd.append( ' PThree = 1 ' ) + PySwitchOdd.append( ' if r == 5 : ' ) + PySwitchOdd.append( ' PFive = 1 ' ) + PySwitchOdd.append( ' return POne,PThree,PFive,n ' ) + SwitchOdd,EndOfSwitchOdd = GraphLoopSwitchOfSwitch1.SNode( 'SwitchOdd' , PySwitchOdd ) + EndOfSwitchOdd.SetName( 'EndOfSwitchOdd' ) + EndOfSwitchOdd.SetAuthor( '' ) + EndOfSwitchOdd.SetComment( 'Compute Node' ) + EndOfSwitchOdd.Coords( 851 , 210 ) + PyEndOfSwitchOdd = [] + EndOfSwitchOdd.SetPyFunction( 'EndSwitch' , PyEndOfSwitchOdd ) + IEndOfSwitchOddn = EndOfSwitchOdd.InPort( 'n' , 'long' ) + IEndOfSwitchOddDefault = EndOfSwitchOdd.GetInPort( 'Default' ) + OEndOfSwitchOddn = EndOfSwitchOdd.OutPort( 'n' , 'long' ) + OEndOfSwitchOddGate = EndOfSwitchOdd.GetOutPort( 'Gate' ) + SwitchOdd.SetName( 'SwitchOdd' ) + SwitchOdd.SetAuthor( '' ) + SwitchOdd.SetComment( 'Compute Node' ) + SwitchOdd.Coords( 412 , 169 ) + ISwitchOdda = SwitchOdd.InPort( 'a' , 'long' ) + ISwitchOddGate = SwitchOdd.GetInPort( 'Gate' ) + OSwitchOddPOne = SwitchOdd.OutPort( 'POne' , 'boolean' ) + OSwitchOddPThree = SwitchOdd.OutPort( 'PThree' , 'boolean' ) + OSwitchOddPFive = SwitchOdd.OutPort( 'PFive' , 'boolean' ) + OSwitchOddn = SwitchOdd.OutPort( 'n' , 'long' ) + OSwitchOddDefault = SwitchOdd.GetOutPort( 'Default' ) + + # Creation of Links + LLoopSwitchIndexSwitcha = GraphLoopSwitchOfSwitch1.Link( OLoopSwitchIndex , ISwitcha ) + + LLoopSwitchMinEndOfLoopSwitchMin = GraphLoopSwitchOfSwitch1.Link( OLoopSwitchMin , IEndOfLoopSwitchMin ) + + LLoopSwitchMaxEndOfLoopSwitchMax = GraphLoopSwitchOfSwitch1.Link( OLoopSwitchMax , IEndOfLoopSwitchMax ) + + LIsEvenaEndOfSwitcha = GraphLoopSwitchOfSwitch1.Link( OIsEvena , IEndOfSwitcha ) + LIsEvenaEndOfSwitcha.AddCoord( 1 , 719 , 591 ) + + LSwitchOddSwitchOddGate = GraphLoopSwitchOfSwitch1.Link( OSwitchOdd , ISwitchOddGate ) + + LSwitchaIsEvena = GraphLoopSwitchOfSwitch1.Link( OSwitcha , IIsEvena ) + + LSwitchaSwitchOdda = GraphLoopSwitchOfSwitch1.Link( OSwitcha , ISwitchOdda ) + + LSwitchEvenIsEvenGate = GraphLoopSwitchOfSwitch1.Link( OSwitchEven , IIsEvenGate ) + + LSwitchDefaultEndOfSwitchDefault = GraphLoopSwitchOfSwitch1.Link( OSwitchDefault , IEndOfSwitchDefault ) + LSwitchDefaultEndOfSwitchDefault.AddCoord( 1 , 1057 , 267 ) + LSwitchDefaultEndOfSwitchDefault.AddCoord( 2 , 1079 , 669 ) + LSwitchDefaultEndOfSwitchDefault.AddCoord( 3 , 383 , 666 ) + + LEndOfSwitchaEndOfLoopSwitchIndex = GraphLoopSwitchOfSwitch1.Link( OEndOfSwitcha , IEndOfLoopSwitchIndex ) + + LSwitchOddPOnePseudoPOneGate = GraphLoopSwitchOfSwitch1.Link( OSwitchOddPOne , IPseudoPOneGate ) + + LSwitchOddPThreePseudoPThreeGate = GraphLoopSwitchOfSwitch1.Link( OSwitchOddPThree , IPseudoPThreeGate ) + + LSwitchOddPFivePseudoPFiveGate = GraphLoopSwitchOfSwitch1.Link( OSwitchOddPFive , IPseudoPFiveGate ) + + LSwitchOddnPseudoPOnePOne = GraphLoopSwitchOfSwitch1.Link( OSwitchOddn , IPseudoPOnePOne ) + + LSwitchOddnPseudoPThreePThree = GraphLoopSwitchOfSwitch1.Link( OSwitchOddn , IPseudoPThreePThree ) + + LSwitchOddnPseudoPFivePFive = GraphLoopSwitchOfSwitch1.Link( OSwitchOddn , IPseudoPFivePFive ) + + LEndOfSwitchOddnEndOfSwitcha = GraphLoopSwitchOfSwitch1.Link( OEndOfSwitchOddn , IEndOfSwitcha ) + + LPseudoPOneaEndOfSwitchOddn = GraphLoopSwitchOfSwitch1.Link( OPseudoPOnea , IEndOfSwitchOddn ) + + LPseudoPThreeaEndOfSwitchOddn = GraphLoopSwitchOfSwitch1.Link( OPseudoPThreea , IEndOfSwitchOddn ) + + LPseudoPFiveaEndOfSwitchOddn = GraphLoopSwitchOfSwitch1.Link( OPseudoPFivea , IEndOfSwitchOddn ) + + # Input datas + ILoopSwitchIndex.Input( 0 ) + ILoopSwitchMin.Input( -5 ) + ILoopSwitchMax.Input( 65 ) + + # Output Ports of the graph + #OEndOfLoopSwitchIndex = EndOfLoopSwitch.GetOutPort( 'Index' ) + #OEndOfLoopSwitchMin = EndOfLoopSwitch.GetOutPort( 'Min' ) + #OEndOfLoopSwitchMax = EndOfLoopSwitch.GetOutPort( 'Max' ) + return GraphLoopSwitchOfSwitch1 + + +GraphLoopSwitchOfSwitch1 = DefGraphLoopSwitchOfSwitch1() diff --git a/examples/GraphLoopSwitchOfSwitch1.xml b/examples/GraphLoopSwitchOfSwitch1.xml new file mode 100644 index 0000000..2b0407b --- /dev/null +++ b/examples/GraphLoopSwitchOfSwitch1.xml @@ -0,0 +1,590 @@ + + + + + +? + ? + GraphLoopSwitchOfSwitch1 + 1 + ? + +GraphLoopSwitchOfSwitch1 + + +long + LoopSwitch__Index + +long + LoopSwitch__Min + +long + LoopSwitch__Max + + +long + EndOfLoopSwitch__Index + +long + EndOfLoopSwitch__Min + +long + EndOfLoopSwitch__Max + + + 1/10/2003 - 17:23:54 + 11/2/2005 - 12:16:50 + 1.05 + JR + ? + DefaultPorts of SwitchOdd and EndSwitchOdd are not connected but that link was not used + 0 + 0 + + +? + ? + LoopSwitch + 4 + EndOfLoopSwitch + +LoopSwitch + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +InitLoop + + + + +MoreLoop + + = Min : ]]> + + + + + +NextLoop + + + + 11/2/2005 - 12:10:26 + 11/2/2005 - 12:10:26 + 1.05 + ? + ? + Compute Node + 6 + 233 + +? + ? + EndOfLoopSwitch + 5 + LoopSwitch + +EndOfLoopSwitch + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +? + + 11/2/2005 - 12:10:26 + 11/2/2005 - 12:10:26 + 1.05 + ? + ? + Compute Node + 1268 + 210 + +? + ? + IsEven + 3 + ? + +IsEven + + +long + a + + +long + a + + + +IsEven + + + + + + 11/2/2005 - 12:10:26 + 11/2/2005 - 12:10:26 + 2.0 + ? + ? + Compute Node + 437 + 520 + +? + ? + Switch + 6 + EndOfSwitch + +Switch + + +long + a + + +long + Odd + +int + a + +boolean + Even + + + +Switch + + + + + + + 11/2/2005 - 12:10:26 + 11/2/2005 - 12:10:26 + 2.0 + ? + ? + Compute Node + 201 + 233 + +? + ? + EndOfSwitch + 7 + Switch + +EndOfSwitch + + +long + a + + +long + a + + + +EndSwitch_1 + + 11/2/2005 - 12:10:26 + 11/2/2005 - 12:10:26 + 2.0 + ? + ? + Compute Node + 1075 + 210 + +? + ? + SwitchOdd + 6 + EndOfSwitchOdd + +SwitchOdd + + +long + a + + +boolean + POne + +boolean + PThree + +boolean + PFive + +long + n + + + +SwitchOdd + + + + + + + + + + + + + + 11/2/2005 - 12:10:26 + 11/2/2005 - 12:10:26 + 2.0 + ? + ? + Compute Node + 412 + 169 + +? + ? + EndOfSwitchOdd + 7 + SwitchOdd + +EndOfSwitchOdd + + +long + n + + +long + n + + + +EndSwitch + + 11/2/2005 - 12:10:26 + 11/2/2005 - 12:10:26 + 2.0 + ? + ? + Compute Node + 851 + 210 + +? + ? + PseudoPOne + 3 + ? + +PseudoPOne + + +long + POne + + +long + a + + + +PseudoPOne + + + + + 11/2/2005 - 12:10:26 + 11/2/2005 - 12:10:26 + 2.0 + ? + ? + Compute Node + 612 + 5 + +? + ? + PseudoPThree + 3 + ? + +PseudoPThree + + +long + PThree + + +long + a + + + +PseudoPThree_1 + + + + + 11/2/2005 - 12:10:26 + 11/2/2005 - 12:10:26 + 2.0 + ? + ? + Compute Node + 620 + 149 + +? + ? + PseudoPFive + 3 + ? + +PseudoPFive + + +long + PFive + + +long + a + + + +PseudoPFive + + + + + 11/2/2005 - 12:10:26 + 11/2/2005 - 12:10:26 + 2.0 + ? + ? + Compute Node + 625 + 343 + + +LoopSwitch + DoLoop + EndOfLoopSwitch + DoLoop + + +LoopSwitch + Index + Switch + a + + +LoopSwitch + Min + EndOfLoopSwitch + Min + + +LoopSwitch + Max + EndOfLoopSwitch + Max + + +EndOfLoopSwitch + DoLoop + LoopSwitch + DoLoop + + +IsEven + a + EndOfSwitch + a + + +719 + 591 + +Switch + Odd + SwitchOdd + Gate + + +Switch + a + IsEven + a + + +Switch + a + SwitchOdd + a + + +Switch + Even + IsEven + Gate + + +Switch + Default + EndOfSwitch + Default + + +1057 + 267 + +1079 + 669 + +383 + 666 + +EndOfSwitch + a + EndOfLoopSwitch + Index + + +SwitchOdd + POne + PseudoPOne + Gate + + +SwitchOdd + PThree + PseudoPThree + Gate + + +SwitchOdd + PFive + PseudoPFive + Gate + + +SwitchOdd + n + PseudoPOne + POne + + +SwitchOdd + n + PseudoPThree + PThree + + +SwitchOdd + n + PseudoPFive + PFive + + +EndOfSwitchOdd + n + EndOfSwitch + a + + +PseudoPOne + a + EndOfSwitchOdd + n + + +PseudoPThree + a + EndOfSwitchOdd + n + + +PseudoPFive + a + EndOfSwitchOdd + n + + + +GraphLoopSwitchOfSwitch1 + LoopSwitch__Index + LoopSwitch + Index + +3 + 0 + + +GraphLoopSwitchOfSwitch1 + LoopSwitch__Min + LoopSwitch + Min + +3 + -5 + + +GraphLoopSwitchOfSwitch1 + LoopSwitch__Max + LoopSwitch + Max + +3 + 65 + diff --git a/examples/GraphLoopSwitchOfSwitchAborted.py b/examples/GraphLoopSwitchOfSwitchAborted.py new file mode 100644 index 0000000..93381b1 --- /dev/null +++ b/examples/GraphLoopSwitchOfSwitchAborted.py @@ -0,0 +1,244 @@ + +# Generated python file of Graph GraphLoopSwitchOfSwitchAborted + +from SuperV import * + +# Graph creation of GraphLoopSwitchOfSwitchAborted +def DefGraphLoopSwitchOfSwitchAborted() : + GraphLoopSwitchOfSwitchAborted = Graph( 'GraphLoopSwitchOfSwitchAborted' ) + GraphLoopSwitchOfSwitchAborted.SetName( 'GraphLoopSwitchOfSwitchAborted' ) + GraphLoopSwitchOfSwitchAborted.SetAuthor( 'JR' ) + GraphLoopSwitchOfSwitchAborted.SetComment( 'DefaultPorts of SwitchOdd and EndSwitchOdd are not connected but that link was not used. DefaultPorts of Switch and EndSwitch are not linked ==> ABORT' ) + GraphLoopSwitchOfSwitchAborted.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsEven = [] + PyIsEven.append( 'from time import * ' ) + PyIsEven.append( 'def IsEven(a) : ' ) + PyIsEven.append( ' print a,"IsEven (GraphSwitch)" ' ) + PyIsEven.append( ' sleep( 1 ) ' ) + PyIsEven.append( ' return a ' ) + IsEven = GraphLoopSwitchOfSwitchAborted.INode( 'IsEven' , PyIsEven ) + IsEven.SetName( 'IsEven' ) + IsEven.SetAuthor( '' ) + IsEven.SetComment( 'Compute Node' ) + IsEven.Coords( 437 , 520 ) + IIsEvena = IsEven.InPort( 'a' , 'long' ) + IIsEvenGate = IsEven.GetInPort( 'Gate' ) + OIsEvena = IsEven.OutPort( 'a' , 'long' ) + OIsEvenGate = IsEven.GetOutPort( 'Gate' ) + + PyPseudoPOne = [] + PyPseudoPOne.append( 'from time import * ' ) + PyPseudoPOne.append( 'def PseudoPOne(POne) : ' ) + PyPseudoPOne.append( ' sleep(1) ' ) + PyPseudoPOne.append( ' return 6*POne+1 ' ) + PseudoPOne = GraphLoopSwitchOfSwitchAborted.INode( 'PseudoPOne' , PyPseudoPOne ) + PseudoPOne.SetName( 'PseudoPOne' ) + PseudoPOne.SetAuthor( '' ) + PseudoPOne.SetComment( 'Compute Node' ) + PseudoPOne.Coords( 612 , 5 ) + IPseudoPOnePOne = PseudoPOne.InPort( 'POne' , 'long' ) + IPseudoPOneGate = PseudoPOne.GetInPort( 'Gate' ) + OPseudoPOnea = PseudoPOne.OutPort( 'a' , 'long' ) + OPseudoPOneGate = PseudoPOne.GetOutPort( 'Gate' ) + + PyPseudoPThree = [] + PyPseudoPThree.append( 'from time import * ' ) + PyPseudoPThree.append( 'def PseudoPThree_1(PThree) : ' ) + PyPseudoPThree.append( ' sleep(1) ' ) + PyPseudoPThree.append( ' return 6*PThree+3 ' ) + PseudoPThree = GraphLoopSwitchOfSwitchAborted.INode( 'PseudoPThree_1' , PyPseudoPThree ) + PseudoPThree.SetName( 'PseudoPThree' ) + PseudoPThree.SetAuthor( '' ) + PseudoPThree.SetComment( 'Compute Node' ) + PseudoPThree.Coords( 620 , 149 ) + IPseudoPThreePThree = PseudoPThree.InPort( 'PThree' , 'long' ) + IPseudoPThreeGate = PseudoPThree.GetInPort( 'Gate' ) + OPseudoPThreea = PseudoPThree.OutPort( 'a' , 'long' ) + OPseudoPThreeGate = PseudoPThree.GetOutPort( 'Gate' ) + + PyPseudoPFive = [] + PyPseudoPFive.append( 'from time import * ' ) + PyPseudoPFive.append( 'def PseudoPFive(PFive) : ' ) + PyPseudoPFive.append( ' sleep(1) ' ) + PyPseudoPFive.append( ' return 6*PFive+5 ' ) + PseudoPFive = GraphLoopSwitchOfSwitchAborted.INode( 'PseudoPFive' , PyPseudoPFive ) + PseudoPFive.SetName( 'PseudoPFive' ) + PseudoPFive.SetAuthor( '' ) + PseudoPFive.SetComment( 'Compute Node' ) + PseudoPFive.Coords( 625 , 343 ) + IPseudoPFivePFive = PseudoPFive.InPort( 'PFive' , 'long' ) + IPseudoPFiveGate = PseudoPFive.GetInPort( 'Gate' ) + OPseudoPFivea = PseudoPFive.OutPort( 'a' , 'long' ) + OPseudoPFiveGate = PseudoPFive.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyLoopSwitch = [] + PyLoopSwitch.append( 'def InitLoop(Index,Min,Max) : ' ) + PyLoopSwitch.append( ' Index = Max ' ) + PyLoopSwitch.append( ' return Index,Min,Max ' ) + PyMoreLoopSwitch = [] + PyMoreLoopSwitch.append( 'def MoreLoop(Index,Min,Max) : ' ) + PyMoreLoopSwitch.append( ' if Index >= Min : ' ) + PyMoreLoopSwitch.append( ' DoLoop = 1 ' ) + PyMoreLoopSwitch.append( ' else : ' ) + PyMoreLoopSwitch.append( ' DoLoop = 0 ' ) + PyMoreLoopSwitch.append( ' return DoLoop,Index,Min,Max ' ) + PyNextLoopSwitch = [] + PyNextLoopSwitch.append( 'def NextLoop(Index,Min,Max) : ' ) + PyNextLoopSwitch.append( ' Index = Index - 1 ' ) + PyNextLoopSwitch.append( ' return Index,Min,Max ' ) + LoopSwitch,EndOfLoopSwitch = GraphLoopSwitchOfSwitchAborted.LNode( 'InitLoop' , PyLoopSwitch , 'MoreLoop' , PyMoreLoopSwitch , 'NextLoop' , PyNextLoopSwitch ) + EndOfLoopSwitch.SetName( 'EndOfLoopSwitch' ) + EndOfLoopSwitch.SetAuthor( '' ) + EndOfLoopSwitch.SetComment( 'Compute Node' ) + EndOfLoopSwitch.Coords( 1268 , 210 ) + PyEndOfLoopSwitch = [] + EndOfLoopSwitch.SetPyFunction( '' , PyEndOfLoopSwitch ) + ILoopSwitchDoLoop = LoopSwitch.GetInPort( 'DoLoop' ) + ILoopSwitchIndex = LoopSwitch.InPort( 'Index' , 'long' ) + ILoopSwitchMin = LoopSwitch.InPort( 'Min' , 'long' ) + ILoopSwitchMax = LoopSwitch.InPort( 'Max' , 'long' ) + ILoopSwitchGate = LoopSwitch.GetInPort( 'Gate' ) + OLoopSwitchDoLoop = LoopSwitch.GetOutPort( 'DoLoop' ) + OLoopSwitchIndex = LoopSwitch.GetOutPort( 'Index' ) + OLoopSwitchMin = LoopSwitch.GetOutPort( 'Min' ) + OLoopSwitchMax = LoopSwitch.GetOutPort( 'Max' ) + IEndOfLoopSwitchDoLoop = EndOfLoopSwitch.GetInPort( 'DoLoop' ) + IEndOfLoopSwitchIndex = EndOfLoopSwitch.GetInPort( 'Index' ) + IEndOfLoopSwitchMin = EndOfLoopSwitch.GetInPort( 'Min' ) + IEndOfLoopSwitchMax = EndOfLoopSwitch.GetInPort( 'Max' ) + IEndOfLoopSwitchGate = EndOfLoopSwitch.GetInPort( 'Gate' ) + OEndOfLoopSwitchDoLoop = EndOfLoopSwitch.GetOutPort( 'DoLoop' ) + OEndOfLoopSwitchIndex = EndOfLoopSwitch.GetOutPort( 'Index' ) + OEndOfLoopSwitchMin = EndOfLoopSwitch.GetOutPort( 'Min' ) + OEndOfLoopSwitchMax = EndOfLoopSwitch.GetOutPort( 'Max' ) + OEndOfLoopSwitchGate = EndOfLoopSwitch.GetOutPort( 'Gate' ) + LoopSwitch.SetName( 'LoopSwitch' ) + LoopSwitch.SetAuthor( '' ) + LoopSwitch.SetComment( 'Compute Node' ) + LoopSwitch.Coords( 6 , 233 ) + + # Creation of Switch Nodes + PySwitch = [] + PySwitch.append( 'from time import * ' ) + PySwitch.append( 'def Switch(a) : ' ) + PySwitch.append( ' sleep(1) ' ) + PySwitch.append( ' if a <= 0 : ' ) + PySwitch.append( ' return 0,a,0 ' ) + PySwitch.append( ' return a & 1,a,1-(a&1) ' ) + Switch,EndOfSwitch = GraphLoopSwitchOfSwitchAborted.SNode( 'Switch' , PySwitch ) + EndOfSwitch.SetName( 'EndOfSwitch' ) + EndOfSwitch.SetAuthor( '' ) + EndOfSwitch.SetComment( 'Compute Node' ) + EndOfSwitch.Coords( 1075 , 210 ) + PyEndOfSwitch = [] + EndOfSwitch.SetPyFunction( 'EndSwitch_1' , PyEndOfSwitch ) + IEndOfSwitcha = EndOfSwitch.InPort( 'a' , 'long' ) + IEndOfSwitchDefault = EndOfSwitch.GetInPort( 'Default' ) + OEndOfSwitcha = EndOfSwitch.OutPort( 'a' , 'long' ) + OEndOfSwitchGate = EndOfSwitch.GetOutPort( 'Gate' ) + Switch.SetName( 'Switch' ) + Switch.SetAuthor( '' ) + Switch.SetComment( 'Compute Node' ) + Switch.Coords( 201 , 233 ) + ISwitcha = Switch.InPort( 'a' , 'long' ) + ISwitchGate = Switch.GetInPort( 'Gate' ) + OSwitchOdd = Switch.OutPort( 'Odd' , 'long' ) + OSwitcha = Switch.OutPort( 'a' , 'int' ) + OSwitchEven = Switch.OutPort( 'Even' , 'boolean' ) + OSwitchDefault = Switch.GetOutPort( 'Default' ) + + PySwitchOdd = [] + PySwitchOdd.append( 'def SwitchOdd(a) : ' ) + PySwitchOdd.append( ' n = a/6 ' ) + PySwitchOdd.append( ' r = a%6 ' ) + PySwitchOdd.append( ' POne = 0 ' ) + PySwitchOdd.append( ' PThree = 0 ' ) + PySwitchOdd.append( ' PFive = 0 ' ) + PySwitchOdd.append( ' if r == 1 : ' ) + PySwitchOdd.append( ' POne = 1 ' ) + PySwitchOdd.append( ' if r == 3 : ' ) + PySwitchOdd.append( ' PThree = 1 ' ) + PySwitchOdd.append( ' if r == 5 : ' ) + PySwitchOdd.append( ' PFive = 1 ' ) + PySwitchOdd.append( ' return POne,PThree,PFive,n ' ) + SwitchOdd,EndOfSwitchOdd = GraphLoopSwitchOfSwitchAborted.SNode( 'SwitchOdd' , PySwitchOdd ) + EndOfSwitchOdd.SetName( 'EndOfSwitchOdd' ) + EndOfSwitchOdd.SetAuthor( '' ) + EndOfSwitchOdd.SetComment( 'Compute Node' ) + EndOfSwitchOdd.Coords( 851 , 210 ) + PyEndOfSwitchOdd = [] + EndOfSwitchOdd.SetPyFunction( 'EndSwitch' , PyEndOfSwitchOdd ) + IEndOfSwitchOddn = EndOfSwitchOdd.InPort( 'n' , 'long' ) + IEndOfSwitchOddDefault = EndOfSwitchOdd.GetInPort( 'Default' ) + OEndOfSwitchOddn = EndOfSwitchOdd.OutPort( 'n' , 'long' ) + OEndOfSwitchOddGate = EndOfSwitchOdd.GetOutPort( 'Gate' ) + SwitchOdd.SetName( 'SwitchOdd' ) + SwitchOdd.SetAuthor( '' ) + SwitchOdd.SetComment( 'Compute Node' ) + SwitchOdd.Coords( 412 , 169 ) + ISwitchOdda = SwitchOdd.InPort( 'a' , 'long' ) + ISwitchOddGate = SwitchOdd.GetInPort( 'Gate' ) + OSwitchOddPOne = SwitchOdd.OutPort( 'POne' , 'boolean' ) + OSwitchOddPThree = SwitchOdd.OutPort( 'PThree' , 'boolean' ) + OSwitchOddPFive = SwitchOdd.OutPort( 'PFive' , 'boolean' ) + OSwitchOddn = SwitchOdd.OutPort( 'n' , 'long' ) + OSwitchOddDefault = SwitchOdd.GetOutPort( 'Default' ) + + # Creation of Links + LLoopSwitchIndexSwitcha = GraphLoopSwitchOfSwitchAborted.Link( OLoopSwitchIndex , ISwitcha ) + + LLoopSwitchMinEndOfLoopSwitchMin = GraphLoopSwitchOfSwitchAborted.Link( OLoopSwitchMin , IEndOfLoopSwitchMin ) + + LLoopSwitchMaxEndOfLoopSwitchMax = GraphLoopSwitchOfSwitchAborted.Link( OLoopSwitchMax , IEndOfLoopSwitchMax ) + + LIsEvenaEndOfSwitcha = GraphLoopSwitchOfSwitchAborted.Link( OIsEvena , IEndOfSwitcha ) + LIsEvenaEndOfSwitcha.AddCoord( 1 , 719 , 591 ) + + LSwitchOddSwitchOddGate = GraphLoopSwitchOfSwitchAborted.Link( OSwitchOdd , ISwitchOddGate ) + + LSwitchaIsEvena = GraphLoopSwitchOfSwitchAborted.Link( OSwitcha , IIsEvena ) + + LSwitchaSwitchOdda = GraphLoopSwitchOfSwitchAborted.Link( OSwitcha , ISwitchOdda ) + + LSwitchEvenIsEvenGate = GraphLoopSwitchOfSwitchAborted.Link( OSwitchEven , IIsEvenGate ) + + LEndOfSwitchaEndOfLoopSwitchIndex = GraphLoopSwitchOfSwitchAborted.Link( OEndOfSwitcha , IEndOfLoopSwitchIndex ) + + LSwitchOddPOnePseudoPOneGate = GraphLoopSwitchOfSwitchAborted.Link( OSwitchOddPOne , IPseudoPOneGate ) + + LSwitchOddPThreePseudoPThreeGate = GraphLoopSwitchOfSwitchAborted.Link( OSwitchOddPThree , IPseudoPThreeGate ) + + LSwitchOddPFivePseudoPFiveGate = GraphLoopSwitchOfSwitchAborted.Link( OSwitchOddPFive , IPseudoPFiveGate ) + + LSwitchOddnPseudoPOnePOne = GraphLoopSwitchOfSwitchAborted.Link( OSwitchOddn , IPseudoPOnePOne ) + + LSwitchOddnPseudoPThreePThree = GraphLoopSwitchOfSwitchAborted.Link( OSwitchOddn , IPseudoPThreePThree ) + + LSwitchOddnPseudoPFivePFive = GraphLoopSwitchOfSwitchAborted.Link( OSwitchOddn , IPseudoPFivePFive ) + + LEndOfSwitchOddnEndOfSwitcha = GraphLoopSwitchOfSwitchAborted.Link( OEndOfSwitchOddn , IEndOfSwitcha ) + + LPseudoPOneaEndOfSwitchOddn = GraphLoopSwitchOfSwitchAborted.Link( OPseudoPOnea , IEndOfSwitchOddn ) + + LPseudoPThreeaEndOfSwitchOddn = GraphLoopSwitchOfSwitchAborted.Link( OPseudoPThreea , IEndOfSwitchOddn ) + + LPseudoPFiveaEndOfSwitchOddn = GraphLoopSwitchOfSwitchAborted.Link( OPseudoPFivea , IEndOfSwitchOddn ) + + # Input datas + ILoopSwitchIndex.Input( 0 ) + ILoopSwitchMin.Input( -5 ) + ILoopSwitchMax.Input( 65 ) + + # Output Ports of the graph + #OEndOfLoopSwitchIndex = EndOfLoopSwitch.GetOutPort( 'Index' ) + #OEndOfLoopSwitchMin = EndOfLoopSwitch.GetOutPort( 'Min' ) + #OEndOfLoopSwitchMax = EndOfLoopSwitch.GetOutPort( 'Max' ) + return GraphLoopSwitchOfSwitchAborted + + +GraphLoopSwitchOfSwitchAborted = DefGraphLoopSwitchOfSwitchAborted() diff --git a/examples/GraphLoopSwitchOfSwitchAborted.xml b/examples/GraphLoopSwitchOfSwitchAborted.xml new file mode 100644 index 0000000..0c8debb --- /dev/null +++ b/examples/GraphLoopSwitchOfSwitchAborted.xml @@ -0,0 +1,575 @@ + + + + + +? + ? + GraphLoopSwitchOfSwitchAborted + 1 + ? + +GraphLoopSwitchOfSwitchAborted + + +long + LoopSwitch__Index + +long + LoopSwitch__Min + +long + LoopSwitch__Max + + +long + EndOfLoopSwitch__Index + +long + EndOfLoopSwitch__Min + +long + EndOfLoopSwitch__Max + + + 1/10/2003 - 17:23:54 + 11/2/2005 - 12:21:6 + 1.05 + JR + ? + DefaultPorts of SwitchOdd and EndSwitchOdd are not connected but that link was not used. DefaultPorts of Switch and EndSwitch are not linked ==> ABORT + 0 + 0 + + +? + ? + LoopSwitch + 4 + EndOfLoopSwitch + +LoopSwitch + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +InitLoop + + + + +MoreLoop + + = Min : ]]> + + + + + +NextLoop + + + + 11/2/2005 - 12:10:26 + 11/2/2005 - 12:10:26 + 1.05 + ? + ? + Compute Node + 6 + 233 + +? + ? + EndOfLoopSwitch + 5 + LoopSwitch + +EndOfLoopSwitch + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +? + + 11/2/2005 - 12:10:26 + 11/2/2005 - 12:10:26 + 1.05 + ? + ? + Compute Node + 1268 + 210 + +? + ? + IsEven + 3 + ? + +IsEven + + +long + a + + +long + a + + + +IsEven + + + + + + 11/2/2005 - 12:10:26 + 11/2/2005 - 12:10:26 + 2.0 + ? + ? + Compute Node + 437 + 520 + +? + ? + Switch + 6 + EndOfSwitch + +Switch + + +long + a + + +long + Odd + +int + a + +boolean + Even + + + +Switch + + + + + + + 11/2/2005 - 12:10:26 + 11/2/2005 - 12:10:26 + 2.0 + ? + ? + Compute Node + 201 + 233 + +? + ? + EndOfSwitch + 7 + Switch + +EndOfSwitch + + +long + a + + +long + a + + + +EndSwitch_1 + + 11/2/2005 - 12:10:26 + 11/2/2005 - 12:10:26 + 2.0 + ? + ? + Compute Node + 1075 + 210 + +? + ? + SwitchOdd + 6 + EndOfSwitchOdd + +SwitchOdd + + +long + a + + +boolean + POne + +boolean + PThree + +boolean + PFive + +long + n + + + +SwitchOdd + + + + + + + + + + + + + + 11/2/2005 - 12:10:26 + 11/2/2005 - 12:10:26 + 2.0 + ? + ? + Compute Node + 412 + 169 + +? + ? + EndOfSwitchOdd + 7 + SwitchOdd + +EndOfSwitchOdd + + +long + n + + +long + n + + + +EndSwitch + + 11/2/2005 - 12:10:26 + 11/2/2005 - 12:10:26 + 2.0 + ? + ? + Compute Node + 851 + 210 + +? + ? + PseudoPOne + 3 + ? + +PseudoPOne + + +long + POne + + +long + a + + + +PseudoPOne + + + + + 11/2/2005 - 12:10:26 + 11/2/2005 - 12:10:26 + 2.0 + ? + ? + Compute Node + 612 + 5 + +? + ? + PseudoPThree + 3 + ? + +PseudoPThree + + +long + PThree + + +long + a + + + +PseudoPThree_1 + + + + + 11/2/2005 - 12:10:26 + 11/2/2005 - 12:10:26 + 2.0 + ? + ? + Compute Node + 620 + 149 + +? + ? + PseudoPFive + 3 + ? + +PseudoPFive + + +long + PFive + + +long + a + + + +PseudoPFive + + + + + 11/2/2005 - 12:10:26 + 11/2/2005 - 12:10:26 + 2.0 + ? + ? + Compute Node + 625 + 343 + + +LoopSwitch + DoLoop + EndOfLoopSwitch + DoLoop + + +LoopSwitch + Index + Switch + a + + +LoopSwitch + Min + EndOfLoopSwitch + Min + + +LoopSwitch + Max + EndOfLoopSwitch + Max + + +EndOfLoopSwitch + DoLoop + LoopSwitch + DoLoop + + +IsEven + a + EndOfSwitch + a + + +719 + 591 + +Switch + Odd + SwitchOdd + Gate + + +Switch + a + IsEven + a + + +Switch + a + SwitchOdd + a + + +Switch + Even + IsEven + Gate + + +EndOfSwitch + a + EndOfLoopSwitch + Index + + +SwitchOdd + POne + PseudoPOne + Gate + + +SwitchOdd + PThree + PseudoPThree + Gate + + +SwitchOdd + PFive + PseudoPFive + Gate + + +SwitchOdd + n + PseudoPOne + POne + + +SwitchOdd + n + PseudoPThree + PThree + + +SwitchOdd + n + PseudoPFive + PFive + + +EndOfSwitchOdd + n + EndOfSwitch + a + + +PseudoPOne + a + EndOfSwitchOdd + n + + +PseudoPThree + a + EndOfSwitchOdd + n + + +PseudoPFive + a + EndOfSwitchOdd + n + + + +GraphLoopSwitchOfSwitchAborted + LoopSwitch__Index + LoopSwitch + Index + +3 + 0 + + +GraphLoopSwitchOfSwitchAborted + LoopSwitch__Min + LoopSwitch + Min + +3 + -5 + + +GraphLoopSwitchOfSwitchAborted + LoopSwitch__Max + LoopSwitch + Max + +3 + 65 + diff --git a/examples/GraphLoopSwitchsAborted.py b/examples/GraphLoopSwitchsAborted.py new file mode 100644 index 0000000..c34b09f --- /dev/null +++ b/examples/GraphLoopSwitchsAborted.py @@ -0,0 +1,231 @@ + +# Generated python file of Graph GraphLoopSwitchsAborted + +from SuperV import * + +# Graph creation of GraphLoopSwitchsAborted +def DefGraphLoopSwitchsAborted() : + GraphLoopSwitchsAborted = Graph( 'GraphLoopSwitchsAborted' ) + GraphLoopSwitchsAborted.SetName( 'GraphLoopSwitchsAborted' ) + GraphLoopSwitchsAborted.SetAuthor( 'JR' ) + GraphLoopSwitchsAborted.SetComment( 'Default links are missing' ) + GraphLoopSwitchsAborted.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsOdd = [] + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd(a) : ' ) + PyIsOdd.append( ' print a,"IsOdd" ' ) + PyIsOdd.append( ' sleep( 1 ) ' ) + PyIsOdd.append( ' return a,1 ' ) + IsOdd = GraphLoopSwitchsAborted.INode( 'IsOdd' , PyIsOdd ) + IsOdd.SetName( 'IsOdd' ) + IsOdd.SetAuthor( '' ) + IsOdd.SetComment( 'Python function' ) + IsOdd.Coords( 476 , 50 ) + IIsOdda = IsOdd.InPort( 'a' , 'long' ) + IIsOddGate = IsOdd.GetInPort( 'Gate' ) + OIsOdda = IsOdd.OutPort( 'a' , 'long' ) + OIsOddOdd = IsOdd.OutPort( 'Odd' , 'long' ) + OIsOddGate = IsOdd.GetOutPort( 'Gate' ) + + PyIsEven = [] + PyIsEven.append( 'from time import * ' ) + PyIsEven.append( 'def IsEven(a) : ' ) + PyIsEven.append( ' print a,"IsEven" ' ) + PyIsEven.append( ' sleep( 1 ) ' ) + PyIsEven.append( ' return a,1 ' ) + IsEven = GraphLoopSwitchsAborted.INode( 'IsEven' , PyIsEven ) + IsEven.SetName( 'IsEven' ) + IsEven.SetAuthor( '' ) + IsEven.SetComment( 'Python function' ) + IsEven.Coords( 482 , 292 ) + IIsEvena = IsEven.InPort( 'a' , 'long' ) + IIsEvenGate = IsEven.GetInPort( 'Gate' ) + OIsEvena = IsEven.OutPort( 'a' , 'long' ) + OIsEvenEven = IsEven.OutPort( 'Even' , 'long' ) + OIsEvenGate = IsEven.GetOutPort( 'Gate' ) + + PySwitchsCompare = [] + PySwitchsCompare.append( 'from time import * ' ) + PySwitchsCompare.append( 'def SwitchsCompare(aOdd,Odd,aEven,Even) : ' ) + PySwitchsCompare.append( ' sleep(1) ' ) + PySwitchsCompare.append( ' return aOdd ' ) + SwitchsCompare = GraphLoopSwitchsAborted.INode( 'SwitchsCompare' , PySwitchsCompare ) + SwitchsCompare.SetName( 'SwitchsCompare' ) + SwitchsCompare.SetAuthor( '' ) + SwitchsCompare.SetComment( 'Compute Node' ) + SwitchsCompare.Coords( 919 , 242 ) + ISwitchsCompareaOdd = SwitchsCompare.InPort( 'aOdd' , 'long' ) + ISwitchsCompareOdd = SwitchsCompare.InPort( 'Odd' , 'boolean' ) + ISwitchsCompareaEven = SwitchsCompare.InPort( 'aEven' , 'long' ) + ISwitchsCompareEven = SwitchsCompare.InPort( 'Even' , 'boolean' ) + ISwitchsCompareGate = SwitchsCompare.GetInPort( 'Gate' ) + OSwitchsComparea = SwitchsCompare.OutPort( 'a' , 'long' ) + OSwitchsCompareGate = SwitchsCompare.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyLoop = [] + PyLoop.append( 'def InitLoop(Index,Min,Max) : ' ) + PyLoop.append( ' return Index,Min,Max ' ) + PyMoreLoop = [] + PyMoreLoop.append( 'def MoreLoop(Index,Min,Max) : ' ) + PyMoreLoop.append( ' if Index <= Max : ' ) + PyMoreLoop.append( ' DoLoop = 1 ' ) + PyMoreLoop.append( ' else : ' ) + PyMoreLoop.append( ' DoLoop = 0 ' ) + PyMoreLoop.append( ' return DoLoop,Index,Min,Max ' ) + PyNextLoop = [] + PyNextLoop.append( 'def NextLoop(Index,Min,Max) : ' ) + PyNextLoop.append( ' Index = Index + 1 ' ) + PyNextLoop.append( ' return Index,Min,Max ' ) + Loop,EndOfLoop = GraphLoopSwitchsAborted.LNode( 'InitLoop' , PyLoop , 'MoreLoop' , PyMoreLoop , 'NextLoop' , PyNextLoop ) + EndOfLoop.SetName( 'EndOfLoop' ) + EndOfLoop.SetAuthor( '' ) + EndOfLoop.SetComment( 'Compute Node' ) + EndOfLoop.Coords( 1102 , 282 ) + PyEndOfLoop = [] + EndOfLoop.SetPyFunction( '' , PyEndOfLoop ) + ILoopDoLoop = Loop.GetInPort( 'DoLoop' ) + ILoopIndex = Loop.InPort( 'Index' , 'long' ) + ILoopMin = Loop.InPort( 'Min' , 'long' ) + ILoopMax = Loop.InPort( 'Max' , 'long' ) + ILoopGate = Loop.GetInPort( 'Gate' ) + OLoopDoLoop = Loop.GetOutPort( 'DoLoop' ) + OLoopIndex = Loop.GetOutPort( 'Index' ) + OLoopMin = Loop.GetOutPort( 'Min' ) + OLoopMax = Loop.GetOutPort( 'Max' ) + IEndOfLoopDoLoop = EndOfLoop.GetInPort( 'DoLoop' ) + IEndOfLoopIndex = EndOfLoop.GetInPort( 'Index' ) + IEndOfLoopMin = EndOfLoop.GetInPort( 'Min' ) + IEndOfLoopMax = EndOfLoop.GetInPort( 'Max' ) + IEndOfLoopGate = EndOfLoop.GetInPort( 'Gate' ) + OEndOfLoopDoLoop = EndOfLoop.GetOutPort( 'DoLoop' ) + OEndOfLoopIndex = EndOfLoop.GetOutPort( 'Index' ) + OEndOfLoopMin = EndOfLoop.GetOutPort( 'Min' ) + OEndOfLoopMax = EndOfLoop.GetOutPort( 'Max' ) + OEndOfLoopGate = EndOfLoop.GetOutPort( 'Gate' ) + Loop.SetName( 'Loop' ) + Loop.SetAuthor( '' ) + Loop.SetComment( 'Compute Node' ) + Loop.Coords( 12 , 276 ) + + # Creation of Switch Nodes + PySwitchOdd = [] + PySwitchOdd.append( 'from time import * ' ) + PySwitchOdd.append( 'def Switch(a) : ' ) + PySwitchOdd.append( ' sleep(1) ' ) + PySwitchOdd.append( ' return a & 1,1-(a&1),a ' ) + SwitchOdd,EndOfSwitchOdd = GraphLoopSwitchsAborted.SNode( 'Switch' , PySwitchOdd ) + EndOfSwitchOdd.SetName( 'EndOfSwitchOdd' ) + EndOfSwitchOdd.SetAuthor( '' ) + EndOfSwitchOdd.SetComment( 'Compute Node' ) + EndOfSwitchOdd.Coords( 711 , 161 ) + PyEndOfSwitchOdd = [] + PyEndOfSwitchOdd.append( 'from time import * ' ) + PyEndOfSwitchOdd.append( 'def EndOfSwitchOdd(a,Odd) : ' ) + PyEndOfSwitchOdd.append( ' sleep(1) ' ) + PyEndOfSwitchOdd.append( ' return a,Odd ' ) + EndOfSwitchOdd.SetPyFunction( 'EndOfSwitchOdd' , PyEndOfSwitchOdd ) + IEndOfSwitchOdda = EndOfSwitchOdd.InPort( 'a' , 'long' ) + IEndOfSwitchOddOdd = EndOfSwitchOdd.InPort( 'Odd' , 'boolean' ) + IEndOfSwitchOddDefault = EndOfSwitchOdd.GetInPort( 'Default' ) + OEndOfSwitchOdda = EndOfSwitchOdd.OutPort( 'a' , 'long' ) + OEndOfSwitchOddOdd = EndOfSwitchOdd.OutPort( 'Odd' , 'boolean' ) + OEndOfSwitchOddGate = EndOfSwitchOdd.GetOutPort( 'Gate' ) + SwitchOdd.SetName( 'SwitchOdd' ) + SwitchOdd.SetAuthor( '' ) + SwitchOdd.SetComment( 'Compute Node' ) + SwitchOdd.Coords( 240 , 141 ) + ISwitchOdda = SwitchOdd.InPort( 'a' , 'long' ) + ISwitchOddGate = SwitchOdd.GetInPort( 'Gate' ) + OSwitchOddOdd = SwitchOdd.OutPort( 'Odd' , 'long' ) + OSwitchOddEven = SwitchOdd.OutPort( 'Even' , 'int' ) + OSwitchOdda = SwitchOdd.OutPort( 'a' , 'int' ) + OSwitchOddDefault = SwitchOdd.GetOutPort( 'Default' ) + + PySwitchEven = [] + PySwitchEven.append( 'from time import * ' ) + PySwitchEven.append( 'def Switch(a) : ' ) + PySwitchEven.append( ' sleep(1) ' ) + PySwitchEven.append( ' return a & 1,1-(a&1),a ' ) + SwitchEven,EndOfSwitchEven = GraphLoopSwitchsAborted.SNode( 'Switch' , PySwitchEven ) + EndOfSwitchEven.SetName( 'EndOfSwitchEven' ) + EndOfSwitchEven.SetAuthor( '' ) + EndOfSwitchEven.SetComment( 'Compute Node' ) + EndOfSwitchEven.Coords( 718 , 361 ) + PyEndOfSwitchEven = [] + PyEndOfSwitchEven.append( 'from time import * ' ) + PyEndOfSwitchEven.append( 'def EndOfSwitchEven(a,Even) : ' ) + PyEndOfSwitchEven.append( ' sleep(1) ' ) + PyEndOfSwitchEven.append( ' return a,Even ' ) + EndOfSwitchEven.SetPyFunction( 'EndOfSwitchEven' , PyEndOfSwitchEven ) + IEndOfSwitchEvena = EndOfSwitchEven.InPort( 'a' , 'long' ) + IEndOfSwitchEvenEven = EndOfSwitchEven.InPort( 'Even' , 'boolean' ) + IEndOfSwitchEvenDefault = EndOfSwitchEven.GetInPort( 'Default' ) + OEndOfSwitchEvena = EndOfSwitchEven.OutPort( 'a' , 'long' ) + OEndOfSwitchEvenEven = EndOfSwitchEven.OutPort( 'Even' , 'boolean' ) + OEndOfSwitchEvenGate = EndOfSwitchEven.GetOutPort( 'Gate' ) + SwitchEven.SetName( 'SwitchEven' ) + SwitchEven.SetAuthor( '' ) + SwitchEven.SetComment( 'Compute Node' ) + SwitchEven.Coords( 235 , 386 ) + ISwitchEvena = SwitchEven.InPort( 'a' , 'long' ) + ISwitchEvenGate = SwitchEven.GetInPort( 'Gate' ) + OSwitchEvenOdd = SwitchEven.OutPort( 'Odd' , 'long' ) + OSwitchEvenEven = SwitchEven.OutPort( 'Even' , 'int' ) + OSwitchEvena = SwitchEven.OutPort( 'a' , 'int' ) + OSwitchEvenDefault = SwitchEven.GetOutPort( 'Default' ) + + # Creation of Links + LIsOddaEndOfSwitchOdda = GraphLoopSwitchsAborted.Link( OIsOdda , IEndOfSwitchOdda ) + + LIsOddOddEndOfSwitchOddOdd = GraphLoopSwitchsAborted.Link( OIsOddOdd , IEndOfSwitchOddOdd ) + + LSwitchOddOddIsOddGate = GraphLoopSwitchsAborted.Link( OSwitchOddOdd , IIsOddGate ) + + LSwitchOddaIsOdda = GraphLoopSwitchsAborted.Link( OSwitchOdda , IIsOdda ) + + LEndOfSwitchOddaSwitchsCompareaOdd = GraphLoopSwitchsAborted.Link( OEndOfSwitchOdda , ISwitchsCompareaOdd ) + + LEndOfSwitchOddOddSwitchsCompareOdd = GraphLoopSwitchsAborted.Link( OEndOfSwitchOddOdd , ISwitchsCompareOdd ) + + LIsEvenaEndOfSwitchEvena = GraphLoopSwitchsAborted.Link( OIsEvena , IEndOfSwitchEvena ) + + LIsEvenEvenEndOfSwitchEvenEven = GraphLoopSwitchsAborted.Link( OIsEvenEven , IEndOfSwitchEvenEven ) + + LLoopIndexSwitchEvena = GraphLoopSwitchsAborted.Link( OLoopIndex , ISwitchEvena ) + + LLoopIndexSwitchOdda = GraphLoopSwitchsAborted.Link( OLoopIndex , ISwitchOdda ) + + LLoopMinEndOfLoopMin = GraphLoopSwitchsAborted.Link( OLoopMin , IEndOfLoopMin ) + + LLoopMaxEndOfLoopMax = GraphLoopSwitchsAborted.Link( OLoopMax , IEndOfLoopMax ) + + LSwitchEvenEvenIsEvenGate = GraphLoopSwitchsAborted.Link( OSwitchEvenEven , IIsEvenGate ) + + LSwitchEvenaIsEvena = GraphLoopSwitchsAborted.Link( OSwitchEvena , IIsEvena ) + + LEndOfSwitchEvenaSwitchsCompareaEven = GraphLoopSwitchsAborted.Link( OEndOfSwitchEvena , ISwitchsCompareaEven ) + + LEndOfSwitchEvenEvenSwitchsCompareEven = GraphLoopSwitchsAborted.Link( OEndOfSwitchEvenEven , ISwitchsCompareEven ) + + LSwitchsCompareaEndOfLoopIndex = GraphLoopSwitchsAborted.Link( OSwitchsComparea , IEndOfLoopIndex ) + + # Input datas + ILoopIndex.Input( 0 ) + ILoopMin.Input( 0 ) + ILoopMax.Input( 23 ) + + # Output Ports of the graph + #OSwitchOddEven = SwitchOdd.GetOutPort( 'Even' ) + #OEndOfLoopIndex = EndOfLoop.GetOutPort( 'Index' ) + #OEndOfLoopMin = EndOfLoop.GetOutPort( 'Min' ) + #OEndOfLoopMax = EndOfLoop.GetOutPort( 'Max' ) + #OSwitchEvenOdd = SwitchEven.GetOutPort( 'Odd' ) + return GraphLoopSwitchsAborted + + +GraphLoopSwitchsAborted = DefGraphLoopSwitchsAborted() diff --git a/examples/GraphLoopSwitchsAborted.xml b/examples/GraphLoopSwitchsAborted.xml new file mode 100644 index 0000000..0529923 --- /dev/null +++ b/examples/GraphLoopSwitchsAborted.xml @@ -0,0 +1,553 @@ + + + + + +? + ? + GraphLoopSwitchsAborted + 1 + ? + +GraphLoopSwitchs_1 + + +long + Loop__Index + +long + Loop__Min + +long + Loop__Max + + +int + SwitchOdd__Even + +long + EndOfLoop__Index + +long + EndOfLoop__Min + +long + EndOfLoop__Max + +long + SwitchEven__Odd + + + 14/10/2003 - 10:29:4 + 14/2/2005 - 16:59:13 + 1.05 + JR + ? + Default links are missing + 0 + 0 + + +? + ? + IsOdd + 3 + ? + +IsOdd + + +long + a + + +long + a + +long + Odd + + + +IsOdd + + + + + + 14/2/2005 - 16:59:13 + 14/2/2005 - 16:59:13 + 1.05 + ? + ? + Python function + 476 + 50 + +? + ? + SwitchOdd + 6 + EndOfSwitchOdd + +SwitchOdd + + +long + a + + +long + Odd + +int + Even + +int + a + + + +Switch + + + + + 14/2/2005 - 16:59:13 + 14/2/2005 - 16:59:13 + 1.05 + ? + ? + Compute Node + 240 + 141 + +? + ? + EndOfSwitchOdd + 7 + SwitchOdd + +EndOfSwitchOdd + + +long + a + +boolean + Odd + + +long + a + +boolean + Odd + + + +EndOfSwitchOdd + + + + + 14/2/2005 - 16:59:13 + 14/2/2005 - 16:59:13 + 1.05 + ? + ? + Compute Node + 711 + 161 + +? + ? + IsEven + 3 + ? + +IsEven + + +long + a + + +long + a + +long + Even + + + +IsEven + + + + + + 14/2/2005 - 16:59:13 + 14/2/2005 - 16:59:13 + 1.05 + ? + ? + Python function + 482 + 292 + +? + ? + Loop + 4 + EndOfLoop + +Loop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +InitLoop + + + +MoreLoop + + + + + + + +NextLoop + + + + 14/2/2005 - 16:59:13 + 14/2/2005 - 16:59:13 + 1.05 + ? + ? + Compute Node + 12 + 276 + +? + ? + EndOfLoop + 5 + Loop + +EndOfLoop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +? + + 14/2/2005 - 16:59:13 + 14/2/2005 - 16:59:13 + 1.05 + ? + ? + Compute Node + 1102 + 282 + +? + ? + SwitchEven + 6 + EndOfSwitchEven + +SwitchEven + + +long + a + + +long + Odd + +int + Even + +int + a + + + +Switch + + + + + 14/2/2005 - 16:59:13 + 14/2/2005 - 16:59:13 + 1.05 + ? + ? + Compute Node + 235 + 386 + +? + ? + EndOfSwitchEven + 7 + SwitchEven + +EndOfSwitchEven + + +long + a + +boolean + Even + + +long + a + +boolean + Even + + + +EndOfSwitchEven + + + + + 14/2/2005 - 16:59:13 + 14/2/2005 - 16:59:13 + 1.05 + ? + ? + Compute Node + 718 + 361 + +? + ? + SwitchsCompare + 3 + ? + +SwitchsCompare + + +long + aOdd + +boolean + Odd + +long + aEven + +boolean + Even + + +long + a + + + +SwitchsCompare + + + + + 14/2/2005 - 16:59:13 + 14/2/2005 - 16:59:13 + 2.0 + ? + ? + Compute Node + 919 + 242 + + +IsOdd + a + EndOfSwitchOdd + a + + +IsOdd + Odd + EndOfSwitchOdd + Odd + + +SwitchOdd + Odd + IsOdd + Gate + + +SwitchOdd + a + IsOdd + a + + +EndOfSwitchOdd + a + SwitchsCompare + aOdd + + +EndOfSwitchOdd + Odd + SwitchsCompare + Odd + + +IsEven + a + EndOfSwitchEven + a + + +IsEven + Even + EndOfSwitchEven + Even + + +Loop + DoLoop + EndOfLoop + DoLoop + + +Loop + Index + SwitchEven + a + + +Loop + Index + SwitchOdd + a + + +Loop + Min + EndOfLoop + Min + + +Loop + Max + EndOfLoop + Max + + +EndOfLoop + DoLoop + Loop + DoLoop + + +SwitchEven + Even + IsEven + Gate + + +SwitchEven + a + IsEven + a + + +EndOfSwitchEven + a + SwitchsCompare + aEven + + +EndOfSwitchEven + Even + SwitchsCompare + Even + + +SwitchsCompare + a + EndOfLoop + Index + + + +GraphLoopSwitchsAborted + Loop__Index + Loop + Index + +3 + 0 + + +GraphLoopSwitchsAborted + Loop__Min + Loop + Min + +3 + 0 + + +GraphLoopSwitchsAborted + Loop__Max + Loop + Max + +3 + 23 + diff --git a/examples/GraphLoopSwitchsBranches.py b/examples/GraphLoopSwitchsBranches.py new file mode 100644 index 0000000..40b474c --- /dev/null +++ b/examples/GraphLoopSwitchsBranches.py @@ -0,0 +1,290 @@ + +# Generated python file of Graph GraphLoopSwitchsBranches_1 + +from SuperV import * + +# Graph creation of GraphLoopSwitchsBranches_1 +def DefGraphLoopSwitchsBranches_1() : + GraphLoopSwitchsBranches_1 = Graph( 'GraphLoopSwitchsBranches_1' ) + GraphLoopSwitchsBranches_1.SetName( 'GraphLoopSwitchsBranches_1' ) + GraphLoopSwitchsBranches_1.SetAuthor( 'JR' ) + GraphLoopSwitchsBranches_1.SetComment( '' ) + GraphLoopSwitchsBranches_1.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsOdd = [] + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd(a) : ' ) + PyIsOdd.append( ' print a,"IsOdd" ' ) + PyIsOdd.append( ' sleep( 1 ) ' ) + PyIsOdd.append( ' return a,1 ' ) + IsOdd = GraphLoopSwitchsBranches_1.INode( 'IsOdd' , PyIsOdd ) + IsOdd.SetName( 'IsOdd' ) + IsOdd.SetAuthor( '' ) + IsOdd.SetComment( 'Python function' ) + IsOdd.Coords( 476 , 2 ) + IIsOdda = IsOdd.InPort( 'a' , 'long' ) + IIsOddGate = IsOdd.GetInPort( 'Gate' ) + OIsOdda = IsOdd.OutPort( 'a' , 'long' ) + OIsOddOdd = IsOdd.OutPort( 'Odd' , 'long' ) + OIsOddGate = IsOdd.GetOutPort( 'Gate' ) + + PyIsEven = [] + PyIsEven.append( 'from time import * ' ) + PyIsEven.append( 'def IsEven(a) : ' ) + PyIsEven.append( ' print a,"IsEven" ' ) + PyIsEven.append( ' sleep( 1 ) ' ) + PyIsEven.append( ' return a,1 ' ) + IsEven = GraphLoopSwitchsBranches_1.INode( 'IsEven' , PyIsEven ) + IsEven.SetName( 'IsEven' ) + IsEven.SetAuthor( '' ) + IsEven.SetComment( 'Python function' ) + IsEven.Coords( 472 , 724 ) + IIsEvena = IsEven.InPort( 'a' , 'long' ) + IIsEvenGate = IsEven.GetInPort( 'Gate' ) + OIsEvena = IsEven.OutPort( 'a' , 'long' ) + OIsEvenEven = IsEven.OutPort( 'Even' , 'long' ) + OIsEvenGate = IsEven.GetOutPort( 'Gate' ) + + PySwitchsCompare = [] + PySwitchsCompare.append( 'from time import * ' ) + PySwitchsCompare.append( 'def SwitchsCompare(aOdd,Odd,aEven,Even,Index) : ' ) + PySwitchsCompare.append( ' sleep(1) ' ) + PySwitchsCompare.append( ' return Index ' ) + SwitchsCompare = GraphLoopSwitchsBranches_1.INode( 'SwitchsCompare' , PySwitchsCompare ) + SwitchsCompare.SetName( 'SwitchsCompare' ) + SwitchsCompare.SetAuthor( '' ) + SwitchsCompare.SetComment( 'Compute Node' ) + SwitchsCompare.Coords( 918 , 221 ) + ISwitchsCompareaOdd = SwitchsCompare.InPort( 'aOdd' , 'long' ) + ISwitchsCompareOdd = SwitchsCompare.InPort( 'Odd' , 'boolean' ) + ISwitchsCompareaEven = SwitchsCompare.InPort( 'aEven' , 'long' ) + ISwitchsCompareEven = SwitchsCompare.InPort( 'Even' , 'boolean' ) + ISwitchsCompareIndex = SwitchsCompare.InPort( 'Index' , 'long' ) + ISwitchsCompareGate = SwitchsCompare.GetInPort( 'Gate' ) + OSwitchsCompareIndex = SwitchsCompare.OutPort( 'Index' , 'long' ) + OSwitchsCompareGate = SwitchsCompare.GetOutPort( 'Gate' ) + + PyIsNotOdd = [] + PyIsNotOdd.append( 'from time import * ' ) + PyIsNotOdd.append( 'def IsNotOdd(Even) : ' ) + PyIsNotOdd.append( ' sleep(1) ' ) + PyIsNotOdd.append( ' return Even ' ) + IsNotOdd = GraphLoopSwitchsBranches_1.INode( 'IsNotOdd' , PyIsNotOdd ) + IsNotOdd.SetName( 'IsNotOdd' ) + IsNotOdd.SetAuthor( '' ) + IsNotOdd.SetComment( 'Compute Node' ) + IsNotOdd.Coords( 477 , 145 ) + IIsNotOddEven = IsNotOdd.InPort( 'Even' , 'long' ) + IIsNotOddGate = IsNotOdd.GetInPort( 'Gate' ) + OIsNotOddEven = IsNotOdd.OutPort( 'Even' , 'long' ) + OIsNotOddGate = IsNotOdd.GetOutPort( 'Gate' ) + + PyIsNotEven = [] + PyIsNotEven.append( 'from time import * ' ) + PyIsNotEven.append( 'def IsNotEven(Odd) : ' ) + PyIsNotEven.append( ' sleep(1) ' ) + PyIsNotEven.append( ' return Odd ' ) + IsNotEven = GraphLoopSwitchsBranches_1.INode( 'IsNotEven' , PyIsNotEven ) + IsNotEven.SetName( 'IsNotEven' ) + IsNotEven.SetAuthor( '' ) + IsNotEven.SetComment( 'Compute Node' ) + IsNotEven.Coords( 477 , 570 ) + IIsNotEvenOdd = IsNotEven.InPort( 'Odd' , 'long' ) + IIsNotEvenGate = IsNotEven.GetInPort( 'Gate' ) + OIsNotEvenOdd = IsNotEven.OutPort( 'Odd' , 'long' ) + OIsNotEvenGate = IsNotEven.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyLoop = [] + PyLoop.append( 'def InitLoop(Index,Min,Max) : ' ) + PyLoop.append( ' return Index,Min,Max ' ) + PyMoreLoop = [] + PyMoreLoop.append( 'def MoreLoop(Index,Min,Max) : ' ) + PyMoreLoop.append( ' if Index <= Max : ' ) + PyMoreLoop.append( ' DoLoop = 1 ' ) + PyMoreLoop.append( ' else : ' ) + PyMoreLoop.append( ' DoLoop = 0 ' ) + PyMoreLoop.append( ' return DoLoop,Index,Min,Max ' ) + PyNextLoop = [] + PyNextLoop.append( 'def NextLoop(Index,Min,Max) : ' ) + PyNextLoop.append( ' Index = Index + 1 ' ) + PyNextLoop.append( ' return Index,Min,Max ' ) + Loop,EndOfLoop = GraphLoopSwitchsBranches_1.LNode( 'InitLoop' , PyLoop , 'MoreLoop' , PyMoreLoop , 'NextLoop' , PyNextLoop ) + EndOfLoop.SetName( 'EndOfLoop' ) + EndOfLoop.SetAuthor( '' ) + EndOfLoop.SetComment( 'Compute Node' ) + EndOfLoop.Coords( 1099 , 261 ) + PyEndOfLoop = [] + EndOfLoop.SetPyFunction( '' , PyEndOfLoop ) + ILoopDoLoop = Loop.GetInPort( 'DoLoop' ) + ILoopIndex = Loop.InPort( 'Index' , 'long' ) + ILoopMin = Loop.InPort( 'Min' , 'long' ) + ILoopMax = Loop.InPort( 'Max' , 'long' ) + ILoopGate = Loop.GetInPort( 'Gate' ) + OLoopDoLoop = Loop.GetOutPort( 'DoLoop' ) + OLoopIndex = Loop.GetOutPort( 'Index' ) + OLoopMin = Loop.GetOutPort( 'Min' ) + OLoopMax = Loop.GetOutPort( 'Max' ) + IEndOfLoopDoLoop = EndOfLoop.GetInPort( 'DoLoop' ) + IEndOfLoopIndex = EndOfLoop.GetInPort( 'Index' ) + IEndOfLoopMin = EndOfLoop.GetInPort( 'Min' ) + IEndOfLoopMax = EndOfLoop.GetInPort( 'Max' ) + IEndOfLoopGate = EndOfLoop.GetInPort( 'Gate' ) + OEndOfLoopDoLoop = EndOfLoop.GetOutPort( 'DoLoop' ) + OEndOfLoopIndex = EndOfLoop.GetOutPort( 'Index' ) + OEndOfLoopMin = EndOfLoop.GetOutPort( 'Min' ) + OEndOfLoopMax = EndOfLoop.GetOutPort( 'Max' ) + OEndOfLoopGate = EndOfLoop.GetOutPort( 'Gate' ) + Loop.SetName( 'Loop' ) + Loop.SetAuthor( '' ) + Loop.SetComment( 'Compute Node' ) + Loop.Coords( 19 , 341 ) + + # Creation of Switch Nodes + PySwitchOdd = [] + PySwitchOdd.append( 'from time import * ' ) + PySwitchOdd.append( 'def SwitchOdd(a) : ' ) + PySwitchOdd.append( ' sleep(1) ' ) + PySwitchOdd.append( ' OddEven = 'Odd' ' ) + PySwitchOdd.append( ' if (a&1) == 0 : ' ) + PySwitchOdd.append( ' OddEven = 'Even' ' ) + PySwitchOdd.append( ' return a & 1,1-(a&1),a,OddEven ' ) + SwitchOdd,EndOfSwitchOdd = GraphLoopSwitchsBranches_1.SNode( 'SwitchOdd' , PySwitchOdd ) + EndOfSwitchOdd.SetName( 'EndOfSwitchOdd' ) + EndOfSwitchOdd.SetAuthor( '' ) + EndOfSwitchOdd.SetComment( 'Compute Node' ) + EndOfSwitchOdd.Coords( 715 , 208 ) + PyEndOfSwitchOdd = [] + PyEndOfSwitchOdd.append( 'from time import * ' ) + PyEndOfSwitchOdd.append( 'def EndOfSwitchOdd(a,Odd,Even,OddEven) : ' ) + PyEndOfSwitchOdd.append( ' sleep(1) ' ) + PyEndOfSwitchOdd.append( ' return a,Odd ' ) + EndOfSwitchOdd.SetPyFunction( 'EndOfSwitchOdd' , PyEndOfSwitchOdd ) + IEndOfSwitchOdda = EndOfSwitchOdd.InPort( 'a' , 'long' ) + IEndOfSwitchOddOdd = EndOfSwitchOdd.InPort( 'Odd' , 'boolean' ) + IEndOfSwitchOddEven = EndOfSwitchOdd.InPort( 'Even' , 'long' ) + IEndOfSwitchOddOddEven = EndOfSwitchOdd.InPort( 'OddEven' , 'boolean' ) + IEndOfSwitchOddDefault = EndOfSwitchOdd.GetInPort( 'Default' ) + OEndOfSwitchOdda = EndOfSwitchOdd.OutPort( 'a' , 'long' ) + OEndOfSwitchOddOdd = EndOfSwitchOdd.OutPort( 'Odd' , 'boolean' ) + OEndOfSwitchOddGate = EndOfSwitchOdd.GetOutPort( 'Gate' ) + SwitchOdd.SetName( 'SwitchOdd' ) + SwitchOdd.SetAuthor( '' ) + SwitchOdd.SetComment( 'Compute Node' ) + SwitchOdd.Coords( 241 , 208 ) + ISwitchOdda = SwitchOdd.InPort( 'a' , 'long' ) + ISwitchOddGate = SwitchOdd.GetInPort( 'Gate' ) + OSwitchOddOdd = SwitchOdd.OutPort( 'Odd' , 'long' ) + OSwitchOddEven = SwitchOdd.OutPort( 'Even' , 'int' ) + OSwitchOdda = SwitchOdd.OutPort( 'a' , 'int' ) + OSwitchOddOddEven = SwitchOdd.OutPort( 'OddEven' , 'string' ) + OSwitchOddDefault = SwitchOdd.GetOutPort( 'Default' ) + + PySwitchEven = [] + PySwitchEven.append( 'from time import * ' ) + PySwitchEven.append( 'def SwitchEven(a) : ' ) + PySwitchEven.append( ' sleep(1) ' ) + PySwitchEven.append( ' OddEven = 'Even' ' ) + PySwitchEven.append( ' if (a&1) != 0 : ' ) + PySwitchEven.append( ' OddEven = 'Odd' ' ) + PySwitchEven.append( ' return a & 1,1-(a&1),a,OddEven ' ) + SwitchEven,EndOfSwitchEven = GraphLoopSwitchsBranches_1.SNode( 'SwitchEven' , PySwitchEven ) + EndOfSwitchEven.SetName( 'EndOfSwitchEven' ) + EndOfSwitchEven.SetAuthor( '' ) + EndOfSwitchEven.SetComment( 'Compute Node' ) + EndOfSwitchEven.Coords( 722 , 425 ) + PyEndOfSwitchEven = [] + PyEndOfSwitchEven.append( 'from time import * ' ) + PyEndOfSwitchEven.append( 'def EndOfSwitchEven(a,Even,Odd,OddEven) : ' ) + PyEndOfSwitchEven.append( ' sleep(1) ' ) + PyEndOfSwitchEven.append( ' return a,Even ' ) + EndOfSwitchEven.SetPyFunction( 'EndOfSwitchEven' , PyEndOfSwitchEven ) + IEndOfSwitchEvena = EndOfSwitchEven.InPort( 'a' , 'long' ) + IEndOfSwitchEvenEven = EndOfSwitchEven.InPort( 'Even' , 'boolean' ) + IEndOfSwitchEvenOdd = EndOfSwitchEven.InPort( 'Odd' , 'long' ) + IEndOfSwitchEvenOddEven = EndOfSwitchEven.InPort( 'OddEven' , 'string' ) + IEndOfSwitchEvenDefault = EndOfSwitchEven.GetInPort( 'Default' ) + OEndOfSwitchEvena = EndOfSwitchEven.OutPort( 'a' , 'long' ) + OEndOfSwitchEvenEven = EndOfSwitchEven.OutPort( 'Even' , 'boolean' ) + OEndOfSwitchEvenGate = EndOfSwitchEven.GetOutPort( 'Gate' ) + SwitchEven.SetName( 'SwitchEven' ) + SwitchEven.SetAuthor( '' ) + SwitchEven.SetComment( 'Compute Node' ) + SwitchEven.Coords( 228 , 425 ) + ISwitchEvena = SwitchEven.InPort( 'a' , 'long' ) + ISwitchEvenGate = SwitchEven.GetInPort( 'Gate' ) + OSwitchEvenOdd = SwitchEven.OutPort( 'Odd' , 'long' ) + OSwitchEvenEven = SwitchEven.OutPort( 'Even' , 'int' ) + OSwitchEvena = SwitchEven.OutPort( 'a' , 'int' ) + OSwitchEvenOddEven = SwitchEven.OutPort( 'OddEven' , 'string' ) + OSwitchEvenDefault = SwitchEven.GetOutPort( 'Default' ) + + # Creation of Links + LIsOddaEndOfSwitchOdda = GraphLoopSwitchsBranches_1.Link( OIsOdda , IEndOfSwitchOdda ) + + LIsOddOddEndOfSwitchOddOdd = GraphLoopSwitchsBranches_1.Link( OIsOddOdd , IEndOfSwitchOddOdd ) + + LSwitchOddOddIsOddGate = GraphLoopSwitchsBranches_1.Link( OSwitchOddOdd , IIsOddGate ) + + LSwitchOddEvenIsNotOddEven = GraphLoopSwitchsBranches_1.Link( OSwitchOddEven , IIsNotOddEven ) + + LSwitchOddaIsOdda = GraphLoopSwitchsBranches_1.Link( OSwitchOdda , IIsOdda ) + + LSwitchOddOddEvenEndOfSwitchOddOddEven = GraphLoopSwitchsBranches_1.Link( OSwitchOddOddEven , IEndOfSwitchOddOddEven ) + + LSwitchOddDefaultEndOfSwitchOddDefault = GraphLoopSwitchsBranches_1.Link( OSwitchOddDefault , IEndOfSwitchOddDefault ) + + LEndOfSwitchOddaSwitchsCompareaOdd = GraphLoopSwitchsBranches_1.Link( OEndOfSwitchOdda , ISwitchsCompareaOdd ) + + LEndOfSwitchOddOddSwitchsCompareOdd = GraphLoopSwitchsBranches_1.Link( OEndOfSwitchOddOdd , ISwitchsCompareOdd ) + + LIsEvenaEndOfSwitchEvena = GraphLoopSwitchsBranches_1.Link( OIsEvena , IEndOfSwitchEvena ) + + LIsEvenEvenEndOfSwitchEvenEven = GraphLoopSwitchsBranches_1.Link( OIsEvenEven , IEndOfSwitchEvenEven ) + + LLoopIndexSwitchOdda = GraphLoopSwitchsBranches_1.Link( OLoopIndex , ISwitchOdda ) + + LLoopIndexSwitchEvena = GraphLoopSwitchsBranches_1.Link( OLoopIndex , ISwitchEvena ) + + LLoopIndexSwitchsCompareIndex = GraphLoopSwitchsBranches_1.Link( OLoopIndex , ISwitchsCompareIndex ) + + LLoopMinEndOfLoopMin = GraphLoopSwitchsBranches_1.Link( OLoopMin , IEndOfLoopMin ) + + LLoopMaxEndOfLoopMax = GraphLoopSwitchsBranches_1.Link( OLoopMax , IEndOfLoopMax ) + + LSwitchEvenOddIsNotEvenOdd = GraphLoopSwitchsBranches_1.Link( OSwitchEvenOdd , IIsNotEvenOdd ) + + LSwitchEvenEvenIsEvenGate = GraphLoopSwitchsBranches_1.Link( OSwitchEvenEven , IIsEvenGate ) + + LSwitchEvenaIsEvena = GraphLoopSwitchsBranches_1.Link( OSwitchEvena , IIsEvena ) + + LSwitchEvenOddEvenEndOfSwitchEvenOddEven = GraphLoopSwitchsBranches_1.Link( OSwitchEvenOddEven , IEndOfSwitchEvenOddEven ) + + LSwitchEvenDefaultEndOfSwitchEvenDefault = GraphLoopSwitchsBranches_1.Link( OSwitchEvenDefault , IEndOfSwitchEvenDefault ) + + LEndOfSwitchEvenaSwitchsCompareaEven = GraphLoopSwitchsBranches_1.Link( OEndOfSwitchEvena , ISwitchsCompareaEven ) + + LEndOfSwitchEvenEvenSwitchsCompareEven = GraphLoopSwitchsBranches_1.Link( OEndOfSwitchEvenEven , ISwitchsCompareEven ) + + LSwitchsCompareIndexEndOfLoopIndex = GraphLoopSwitchsBranches_1.Link( OSwitchsCompareIndex , IEndOfLoopIndex ) + + LIsNotOddEvenEndOfSwitchOddEven = GraphLoopSwitchsBranches_1.Link( OIsNotOddEven , IEndOfSwitchOddEven ) + + LIsNotEvenOddEndOfSwitchEvenOdd = GraphLoopSwitchsBranches_1.Link( OIsNotEvenOdd , IEndOfSwitchEvenOdd ) + + # Input datas + ILoopIndex.Input( 0 ) + ILoopMin.Input( 0 ) + ILoopMax.Input( 23 ) + + # Output Ports of the graph + #OEndOfLoopIndex = EndOfLoop.GetOutPort( 'Index' ) + #OEndOfLoopMin = EndOfLoop.GetOutPort( 'Min' ) + #OEndOfLoopMax = EndOfLoop.GetOutPort( 'Max' ) + return GraphLoopSwitchsBranches_1 + + +GraphLoopSwitchsBranches_1 = DefGraphLoopSwitchsBranches_1() diff --git a/examples/GraphLoopSwitchsBranches.xml b/examples/GraphLoopSwitchsBranches.xml new file mode 100644 index 0000000..293e2cd --- /dev/null +++ b/examples/GraphLoopSwitchsBranches.xml @@ -0,0 +1,692 @@ + + + + + +? + ? + GraphLoopSwitchsBranches_1 + 1 + ? + +GraphLoopSwitchsBranches_1 + + +long + Loop__Index + +long + Loop__Min + +long + Loop__Max + + +long + EndOfLoop__Index + +long + EndOfLoop__Min + +long + EndOfLoop__Max + + + 14/10/2003 - 10:29:4 + 11/2/2005 - 17:27:23 + 1.05 + JR + ? + ? + 0 + 0 + + +? + ? + IsOdd + 3 + ? + +IsOdd + + +long + a + + +long + a + +long + Odd + + + +IsOdd + + + + + + 11/2/2005 - 17:27:23 + 11/2/2005 - 17:27:23 + 1.05 + ? + ? + Python function + 476 + 2 + +? + ? + SwitchOdd + 6 + EndOfSwitchOdd + +SwitchOdd + + +long + a + + +long + Odd + +int + Even + +int + a + +string + OddEven + + + +SwitchOdd + + + + + + + + 11/2/2005 - 17:27:23 + 11/2/2005 - 17:27:23 + 1.05 + ? + ? + Compute Node + 241 + 208 + +? + ? + EndOfSwitchOdd + 7 + SwitchOdd + +EndOfSwitchOdd + + +long + a + +boolean + Odd + +long + Even + +boolean + OddEven + + +long + a + +boolean + Odd + + + +EndOfSwitchOdd + + + + + 11/2/2005 - 17:27:23 + 11/2/2005 - 17:27:23 + 1.05 + ? + ? + Compute Node + 715 + 208 + +? + ? + IsEven + 3 + ? + +IsEven + + +long + a + + +long + a + +long + Even + + + +IsEven + + + + + + 11/2/2005 - 17:27:23 + 11/2/2005 - 17:27:23 + 1.05 + ? + ? + Python function + 472 + 724 + +? + ? + Loop + 4 + EndOfLoop + +Loop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +InitLoop + + + +MoreLoop + + + + + + + +NextLoop + + + + 11/2/2005 - 17:27:23 + 11/2/2005 - 17:27:23 + 1.05 + ? + ? + Compute Node + 19 + 341 + +? + ? + EndOfLoop + 5 + Loop + +EndOfLoop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +? + + 11/2/2005 - 17:27:23 + 11/2/2005 - 17:27:23 + 1.05 + ? + ? + Compute Node + 1099 + 261 + +? + ? + SwitchEven + 6 + EndOfSwitchEven + +SwitchEven + + +long + a + + +long + Odd + +int + Even + +int + a + +string + OddEven + + + +SwitchEven + + + + + + + + 11/2/2005 - 17:27:23 + 11/2/2005 - 17:27:23 + 1.05 + ? + ? + Compute Node + 228 + 425 + +? + ? + EndOfSwitchEven + 7 + SwitchEven + +EndOfSwitchEven + + +long + a + +boolean + Even + +long + Odd + +string + OddEven + + +long + a + +boolean + Even + + + +EndOfSwitchEven + + + + + 11/2/2005 - 17:27:23 + 11/2/2005 - 17:27:23 + 1.05 + ? + ? + Compute Node + 722 + 425 + +? + ? + SwitchsCompare + 3 + ? + +SwitchsCompare + + +long + aOdd + +boolean + Odd + +long + aEven + +boolean + Even + +long + Index + + +long + Index + + + +SwitchsCompare + + + + + 11/2/2005 - 17:27:23 + 11/2/2005 - 17:27:23 + 2.0 + ? + ? + Compute Node + 918 + 221 + +? + ? + IsNotOdd + 3 + ? + +IsNotOdd + + +long + Even + + +long + Even + + + +IsNotOdd + + + + + 11/2/2005 - 17:27:23 + 11/2/2005 - 17:27:23 + 2.0 + ? + ? + Compute Node + 477 + 145 + +? + ? + IsNotEven + 3 + ? + +IsNotEven + + +long + Odd + + +long + Odd + + + +IsNotEven + + + + + 11/2/2005 - 17:27:23 + 11/2/2005 - 17:27:23 + 2.0 + ? + ? + Compute Node + 477 + 570 + + +IsOdd + a + EndOfSwitchOdd + a + + +IsOdd + Odd + EndOfSwitchOdd + Odd + + +SwitchOdd + Odd + IsOdd + Gate + + +SwitchOdd + Even + IsNotOdd + Even + + +SwitchOdd + a + IsOdd + a + + +SwitchOdd + OddEven + EndOfSwitchOdd + OddEven + + +SwitchOdd + Default + EndOfSwitchOdd + Default + + +EndOfSwitchOdd + a + SwitchsCompare + aOdd + + +EndOfSwitchOdd + Odd + SwitchsCompare + Odd + + +IsEven + a + EndOfSwitchEven + a + + +IsEven + Even + EndOfSwitchEven + Even + + +Loop + DoLoop + EndOfLoop + DoLoop + + +Loop + Index + SwitchOdd + a + + +Loop + Index + SwitchEven + a + + +Loop + Index + SwitchsCompare + Index + + +Loop + Min + EndOfLoop + Min + + +Loop + Max + EndOfLoop + Max + + +EndOfLoop + DoLoop + Loop + DoLoop + + +SwitchEven + Odd + IsNotEven + Odd + + +SwitchEven + Even + IsEven + Gate + + +SwitchEven + a + IsEven + a + + +SwitchEven + OddEven + EndOfSwitchEven + OddEven + + +SwitchEven + Default + EndOfSwitchEven + Default + + +EndOfSwitchEven + a + SwitchsCompare + aEven + + +EndOfSwitchEven + Even + SwitchsCompare + Even + + +SwitchsCompare + Index + EndOfLoop + Index + + +IsNotOdd + Even + EndOfSwitchOdd + Even + + +IsNotEven + Odd + EndOfSwitchEven + Odd + + + +GraphLoopSwitchsBranches_1 + Loop__Index + Loop + Index + +3 + 0 + + +GraphLoopSwitchsBranches_1 + Loop__Min + Loop + Min + +3 + 0 + + +GraphLoopSwitchsBranches_1 + Loop__Max + Loop + Max + +3 + 23 + diff --git a/examples/GraphLoopSwitchsBranchesDefaultAborted.py b/examples/GraphLoopSwitchsBranchesDefaultAborted.py new file mode 100644 index 0000000..8591848 --- /dev/null +++ b/examples/GraphLoopSwitchsBranchesDefaultAborted.py @@ -0,0 +1,346 @@ + +# Generated python file of Graph GraphLoopSwitchsBranchesdefaultAborted + +from SuperV import * + +# Graph creation of GraphLoopSwitchsBranchesdefaultAborted +def DefGraphLoopSwitchsBranchesdefaultAborted() : + GraphLoopSwitchsBranchesdefaultAborted = Graph( 'GraphLoopSwitchsBranchesdefaultAborted' ) + GraphLoopSwitchsBranchesdefaultAborted.SetName( 'GraphLoopSwitchsBranchesdefaultAborted' ) + GraphLoopSwitchsBranchesdefaultAborted.SetAuthor( 'JR' ) + GraphLoopSwitchsBranchesdefaultAborted.SetComment( '' ) + GraphLoopSwitchsBranchesdefaultAborted.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsOdd = [] + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd(a) : ' ) + PyIsOdd.append( ' print a,"IsOdd" ' ) + PyIsOdd.append( ' sleep( 1 ) ' ) + PyIsOdd.append( ' return a,1 ' ) + IsOdd = GraphLoopSwitchsBranchesdefaultAborted.INode( 'IsOdd' , PyIsOdd ) + IsOdd.SetName( 'IsOdd' ) + IsOdd.SetAuthor( '' ) + IsOdd.SetComment( 'Python function' ) + IsOdd.Coords( 476 , 2 ) + IIsOdda = IsOdd.InPort( 'a' , 'long' ) + IIsOddGate = IsOdd.GetInPort( 'Gate' ) + OIsOdda = IsOdd.OutPort( 'a' , 'long' ) + OIsOddOdd = IsOdd.OutPort( 'Odd' , 'long' ) + OIsOddGate = IsOdd.GetOutPort( 'Gate' ) + + PyIsEven = [] + PyIsEven.append( 'from time import * ' ) + PyIsEven.append( 'def IsEven(a) : ' ) + PyIsEven.append( ' print a,"IsEven" ' ) + PyIsEven.append( ' sleep( 1 ) ' ) + PyIsEven.append( ' return a,1 ' ) + IsEven = GraphLoopSwitchsBranchesdefaultAborted.INode( 'IsEven' , PyIsEven ) + IsEven.SetName( 'IsEven' ) + IsEven.SetAuthor( '' ) + IsEven.SetComment( 'Python function' ) + IsEven.Coords( 472 , 724 ) + IIsEvena = IsEven.InPort( 'a' , 'long' ) + IIsEvenGate = IsEven.GetInPort( 'Gate' ) + OIsEvena = IsEven.OutPort( 'a' , 'long' ) + OIsEvenEven = IsEven.OutPort( 'Even' , 'long' ) + OIsEvenGate = IsEven.GetOutPort( 'Gate' ) + + PySwitchsCompare = [] + PySwitchsCompare.append( 'from time import * ' ) + PySwitchsCompare.append( 'def SwitchsCompare(aOdd,Odd,aEven,Even,Index) : ' ) + PySwitchsCompare.append( ' sleep(1) ' ) + PySwitchsCompare.append( ' return Index ' ) + SwitchsCompare = GraphLoopSwitchsBranchesdefaultAborted.INode( 'SwitchsCompare' , PySwitchsCompare ) + SwitchsCompare.SetName( 'SwitchsCompare' ) + SwitchsCompare.SetAuthor( '' ) + SwitchsCompare.SetComment( 'Compute Node' ) + SwitchsCompare.Coords( 916 , 269 ) + ISwitchsCompareaOdd = SwitchsCompare.InPort( 'aOdd' , 'long' ) + ISwitchsCompareOdd = SwitchsCompare.InPort( 'Odd' , 'boolean' ) + ISwitchsCompareaEven = SwitchsCompare.InPort( 'aEven' , 'long' ) + ISwitchsCompareEven = SwitchsCompare.InPort( 'Even' , 'boolean' ) + ISwitchsCompareIndex = SwitchsCompare.InPort( 'Index' , 'long' ) + ISwitchsCompareGate = SwitchsCompare.GetInPort( 'Gate' ) + OSwitchsCompareIndex = SwitchsCompare.OutPort( 'Index' , 'long' ) + OSwitchsCompareGate = SwitchsCompare.GetOutPort( 'Gate' ) + + PyIsNotOdd = [] + PyIsNotOdd.append( 'from time import * ' ) + PyIsNotOdd.append( 'def IsNotOdd(Even) : ' ) + PyIsNotOdd.append( ' sleep(1) ' ) + PyIsNotOdd.append( ' return Even ' ) + IsNotOdd = GraphLoopSwitchsBranchesdefaultAborted.INode( 'IsNotOdd' , PyIsNotOdd ) + IsNotOdd.SetName( 'IsNotOdd' ) + IsNotOdd.SetAuthor( '' ) + IsNotOdd.SetComment( 'Compute Node' ) + IsNotOdd.Coords( 477 , 137 ) + IIsNotOddEven = IsNotOdd.InPort( 'Even' , 'long' ) + IIsNotOddGate = IsNotOdd.GetInPort( 'Gate' ) + OIsNotOddEven = IsNotOdd.OutPort( 'Even' , 'long' ) + OIsNotOddGate = IsNotOdd.GetOutPort( 'Gate' ) + + PyIsNotEven = [] + PyIsNotEven.append( 'from time import * ' ) + PyIsNotEven.append( 'def IsNotEven(Odd) : ' ) + PyIsNotEven.append( ' sleep(1) ' ) + PyIsNotEven.append( ' return Odd ' ) + IsNotEven = GraphLoopSwitchsBranchesdefaultAborted.INode( 'IsNotEven' , PyIsNotEven ) + IsNotEven.SetName( 'IsNotEven' ) + IsNotEven.SetAuthor( '' ) + IsNotEven.SetComment( 'Compute Node' ) + IsNotEven.Coords( 475 , 601 ) + IIsNotEvenOdd = IsNotEven.InPort( 'Odd' , 'long' ) + IIsNotEvenGate = IsNotEven.GetInPort( 'Gate' ) + OIsNotEvenOdd = IsNotEven.OutPort( 'Odd' , 'long' ) + OIsNotEvenGate = IsNotEven.GetOutPort( 'Gate' ) + + PyIsOdddefault = [] + PyIsOdddefault.append( 'from time import * ' ) + PyIsOdddefault.append( 'def IsOdddefault(a) : ' ) + PyIsOdddefault.append( ' sleep(1) ' ) + PyIsOdddefault.append( ' return a,0 ' ) + PyIsOdddefault.append( '' ) + IsOdddefault = GraphLoopSwitchsBranchesdefaultAborted.INode( 'IsOdddefault' , PyIsOdddefault ) + IsOdddefault.SetName( 'IsOdddefault' ) + IsOdddefault.SetAuthor( '' ) + IsOdddefault.SetComment( 'Compute Node' ) + IsOdddefault.Coords( 477 , 285 ) + IIsOdddefaulta = IsOdddefault.InPort( 'a' , 'long' ) + IIsOdddefaultGate = IsOdddefault.GetInPort( 'Gate' ) + OIsOdddefaulta = IsOdddefault.OutPort( 'a' , 'long' ) + OIsOdddefaultOdd = IsOdddefault.OutPort( 'Odd' , 'long' ) + OIsOdddefaultGate = IsOdddefault.GetOutPort( 'Gate' ) + + PyIsEvendefault = [] + PyIsEvendefault.append( 'from time import * ' ) + PyIsEvendefault.append( 'def IsEvendefault(a) : ' ) + PyIsEvendefault.append( ' sleep(1) ' ) + PyIsEvendefault.append( ' return a,0 ' ) + PyIsEvendefault.append( '' ) + IsEvendefault = GraphLoopSwitchsBranchesdefaultAborted.INode( 'IsEvendefault' , PyIsEvendefault ) + IsEvendefault.SetName( 'IsEvendefault' ) + IsEvendefault.SetAuthor( '' ) + IsEvendefault.SetComment( 'Compute Node' ) + IsEvendefault.Coords( 478 , 434 ) + IIsEvendefaulta = IsEvendefault.InPort( 'a' , 'long' ) + IIsEvendefaultGate = IsEvendefault.GetInPort( 'Gate' ) + OIsEvendefaulta = IsEvendefault.OutPort( 'a' , 'long' ) + OIsEvendefaultEven = IsEvendefault.OutPort( 'Even' , 'long' ) + OIsEvendefaultGate = IsEvendefault.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyLoop = [] + PyLoop.append( 'def InitLoop(Index,Min,Max) : ' ) + PyLoop.append( ' Index = Max ' ) + PyLoop.append( ' return Index,Min,Max ' ) + PyMoreLoop = [] + PyMoreLoop.append( 'def MoreLoop(Index,Min,Max) : ' ) + PyMoreLoop.append( ' if Index >= Min : ' ) + PyMoreLoop.append( ' DoLoop = 1 ' ) + PyMoreLoop.append( ' else : ' ) + PyMoreLoop.append( ' DoLoop = 0 ' ) + PyMoreLoop.append( ' return DoLoop,Index,Min,Max ' ) + PyNextLoop = [] + PyNextLoop.append( 'def NextLoop(Index,Min,Max) : ' ) + PyNextLoop.append( ' Index = Index - 1 ' ) + PyNextLoop.append( ' return Index,Min,Max ' ) + Loop,EndOfLoop = GraphLoopSwitchsBranchesdefaultAborted.LNode( 'InitLoop' , PyLoop , 'MoreLoop' , PyMoreLoop , 'NextLoop' , PyNextLoop ) + EndOfLoop.SetName( 'EndOfLoop' ) + EndOfLoop.SetAuthor( '' ) + EndOfLoop.SetComment( 'Compute Node' ) + EndOfLoop.Coords( 1097 , 309 ) + PyEndOfLoop = [] + EndOfLoop.SetPyFunction( '' , PyEndOfLoop ) + ILoopDoLoop = Loop.GetInPort( 'DoLoop' ) + ILoopIndex = Loop.InPort( 'Index' , 'long' ) + ILoopMin = Loop.InPort( 'Min' , 'long' ) + ILoopMax = Loop.InPort( 'Max' , 'long' ) + ILoopGate = Loop.GetInPort( 'Gate' ) + OLoopDoLoop = Loop.GetOutPort( 'DoLoop' ) + OLoopIndex = Loop.GetOutPort( 'Index' ) + OLoopMin = Loop.GetOutPort( 'Min' ) + OLoopMax = Loop.GetOutPort( 'Max' ) + IEndOfLoopDoLoop = EndOfLoop.GetInPort( 'DoLoop' ) + IEndOfLoopIndex = EndOfLoop.GetInPort( 'Index' ) + IEndOfLoopMin = EndOfLoop.GetInPort( 'Min' ) + IEndOfLoopMax = EndOfLoop.GetInPort( 'Max' ) + IEndOfLoopGate = EndOfLoop.GetInPort( 'Gate' ) + OEndOfLoopDoLoop = EndOfLoop.GetOutPort( 'DoLoop' ) + OEndOfLoopIndex = EndOfLoop.GetOutPort( 'Index' ) + OEndOfLoopMin = EndOfLoop.GetOutPort( 'Min' ) + OEndOfLoopMax = EndOfLoop.GetOutPort( 'Max' ) + OEndOfLoopGate = EndOfLoop.GetOutPort( 'Gate' ) + Loop.SetName( 'Loop' ) + Loop.SetAuthor( '' ) + Loop.SetComment( 'Compute Node' ) + Loop.Coords( 18 , 389 ) + + # Creation of Switch Nodes + PySwitchOdd = [] + PySwitchOdd.append( 'from time import * ' ) + PySwitchOdd.append( 'def SwitchOdd(a) : ' ) + PySwitchOdd.append( ' sleep(1) ' ) + PySwitchOdd.append( ' if a <= 0 : ' ) + PySwitchOdd.append( ' OddEven = '<=0' ' ) + PySwitchOdd.append( ' return 0,0,0,a,OddEven ' ) + PySwitchOdd.append( ' OddEven = 'Odd' ' ) + PySwitchOdd.append( ' if (a&1) == 0 : ' ) + PySwitchOdd.append( ' OddEven = 'Even' ' ) + PySwitchOdd.append( ' return a & 1,1-(a&1),1-(a&1),a,OddEven ' ) + SwitchOdd,EndOfSwitchOdd = GraphLoopSwitchsBranchesdefaultAborted.SNode( 'SwitchOdd' , PySwitchOdd ) + EndOfSwitchOdd.SetName( 'EndOfSwitchOdd' ) + EndOfSwitchOdd.SetAuthor( '' ) + EndOfSwitchOdd.SetComment( 'Compute Node' ) + EndOfSwitchOdd.Coords( 718 , 162 ) + PyEndOfSwitchOdd = [] + PyEndOfSwitchOdd.append( 'from time import * ' ) + PyEndOfSwitchOdd.append( 'def EndOfSwitchOdd(a,Odd,Even,OddEven) : ' ) + PyEndOfSwitchOdd.append( ' sleep(1) ' ) + PyEndOfSwitchOdd.append( ' return a,Odd ' ) + EndOfSwitchOdd.SetPyFunction( 'EndOfSwitchOdd' , PyEndOfSwitchOdd ) + IEndOfSwitchOdda = EndOfSwitchOdd.InPort( 'a' , 'long' ) + IEndOfSwitchOddOdd = EndOfSwitchOdd.InPort( 'Odd' , 'boolean' ) + IEndOfSwitchOddEven = EndOfSwitchOdd.InPort( 'Even' , 'long' ) + IEndOfSwitchOddOddEven = EndOfSwitchOdd.InPort( 'OddEven' , 'boolean' ) + IEndOfSwitchOddDefault = EndOfSwitchOdd.GetInPort( 'Default' ) + OEndOfSwitchOdda = EndOfSwitchOdd.OutPort( 'a' , 'long' ) + OEndOfSwitchOddOdd = EndOfSwitchOdd.OutPort( 'Odd' , 'boolean' ) + OEndOfSwitchOddGate = EndOfSwitchOdd.GetOutPort( 'Gate' ) + SwitchOdd.SetName( 'SwitchOdd' ) + SwitchOdd.SetAuthor( '' ) + SwitchOdd.SetComment( 'Compute Node' ) + SwitchOdd.Coords( 240 , 142 ) + ISwitchOdda = SwitchOdd.InPort( 'a' , 'long' ) + ISwitchOddGate = SwitchOdd.GetInPort( 'Gate' ) + OSwitchOddOdd = SwitchOdd.OutPort( 'Odd' , 'long' ) + OSwitchOddEven = SwitchOdd.OutPort( 'Even' , 'int' ) + OSwitchOdddefault = SwitchOdd.OutPort( 'default' , 'long' ) + OSwitchOdda = SwitchOdd.OutPort( 'a' , 'long' ) + OSwitchOddOddEven = SwitchOdd.OutPort( 'OddEven' , 'string' ) + OSwitchOddDefault = SwitchOdd.GetOutPort( 'Default' ) + + PySwitchEven = [] + PySwitchEven.append( 'from time import * ' ) + PySwitchEven.append( 'def SwitchEven(a) : ' ) + PySwitchEven.append( ' sleep(1) ' ) + PySwitchEven.append( ' if a <= 0 : ' ) + PySwitchEven.append( ' OddEven = '<=0' ' ) + PySwitchEven.append( ' return 0,0,0,a,OddEven ' ) + PySwitchEven.append( ' OddEven = 'Even' ' ) + PySwitchEven.append( ' if (a&1) != 0 : ' ) + PySwitchEven.append( ' OddEven = 'Odd' ' ) + PySwitchEven.append( ' print (a&1),1-(a&1),(a&1),a,OddEven ' ) + PySwitchEven.append( ' return (a&1),1-(a&1),(a&1),a,OddEven ' ) + SwitchEven,EndOfSwitchEven = GraphLoopSwitchsBranchesdefaultAborted.SNode( 'SwitchEven' , PySwitchEven ) + EndOfSwitchEven.SetName( 'EndOfSwitchEven' ) + EndOfSwitchEven.SetAuthor( '' ) + EndOfSwitchEven.SetComment( 'Compute Node' ) + EndOfSwitchEven.Coords( 721 , 477 ) + PyEndOfSwitchEven = [] + PyEndOfSwitchEven.append( 'from time import * ' ) + PyEndOfSwitchEven.append( 'def EndOfSwitchEven(a,Even,Odd,OddEven) : ' ) + PyEndOfSwitchEven.append( ' sleep(1) ' ) + PyEndOfSwitchEven.append( ' return a,Even ' ) + EndOfSwitchEven.SetPyFunction( 'EndOfSwitchEven' , PyEndOfSwitchEven ) + IEndOfSwitchEvena = EndOfSwitchEven.InPort( 'a' , 'long' ) + IEndOfSwitchEvenEven = EndOfSwitchEven.InPort( 'Even' , 'boolean' ) + IEndOfSwitchEvenOdd = EndOfSwitchEven.InPort( 'Odd' , 'long' ) + IEndOfSwitchEvenOddEven = EndOfSwitchEven.InPort( 'OddEven' , 'string' ) + IEndOfSwitchEvenDefault = EndOfSwitchEven.GetInPort( 'Default' ) + OEndOfSwitchEvena = EndOfSwitchEven.OutPort( 'a' , 'long' ) + OEndOfSwitchEvenEven = EndOfSwitchEven.OutPort( 'Even' , 'boolean' ) + OEndOfSwitchEvenGate = EndOfSwitchEven.GetOutPort( 'Gate' ) + SwitchEven.SetName( 'SwitchEven' ) + SwitchEven.SetAuthor( '' ) + SwitchEven.SetComment( 'Compute Node' ) + SwitchEven.Coords( 230 , 457 ) + ISwitchEvena = SwitchEven.InPort( 'a' , 'long' ) + ISwitchEvenGate = SwitchEven.GetInPort( 'Gate' ) + OSwitchEvenOdd = SwitchEven.OutPort( 'Odd' , 'long' ) + OSwitchEvenEven = SwitchEven.OutPort( 'Even' , 'int' ) + OSwitchEvendefault = SwitchEven.OutPort( 'default' , 'long' ) + OSwitchEvena = SwitchEven.OutPort( 'a' , 'int' ) + OSwitchEvenOddEven = SwitchEven.OutPort( 'OddEven' , 'string' ) + OSwitchEvenDefault = SwitchEven.GetOutPort( 'Default' ) + + # Creation of Links + LIsOddaEndOfSwitchOdda = GraphLoopSwitchsBranchesdefaultAborted.Link( OIsOdda , IEndOfSwitchOdda ) + + LIsOddOddEndOfSwitchOddOdd = GraphLoopSwitchsBranchesdefaultAborted.Link( OIsOddOdd , IEndOfSwitchOddOdd ) + + LSwitchOddOddIsOddGate = GraphLoopSwitchsBranchesdefaultAborted.Link( OSwitchOddOdd , IIsOddGate ) + + LSwitchOddEvenIsNotOddEven = GraphLoopSwitchsBranchesdefaultAborted.Link( OSwitchOddEven , IIsNotOddEven ) + + LSwitchOdddefaultIsOdddefaultGate = GraphLoopSwitchsBranchesdefaultAborted.Link( OSwitchOdddefault , IIsOdddefaultGate ) + + LSwitchOddaIsOdddefaulta = GraphLoopSwitchsBranchesdefaultAborted.Link( OSwitchOdda , IIsOdddefaulta ) + + LSwitchOddaIsOdda = GraphLoopSwitchsBranchesdefaultAborted.Link( OSwitchOdda , IIsOdda ) + + LSwitchOddOddEvenEndOfSwitchOddOddEven = GraphLoopSwitchsBranchesdefaultAborted.Link( OSwitchOddOddEven , IEndOfSwitchOddOddEven ) + + LEndOfSwitchOddaSwitchsCompareaOdd = GraphLoopSwitchsBranchesdefaultAborted.Link( OEndOfSwitchOdda , ISwitchsCompareaOdd ) + + LEndOfSwitchOddOddSwitchsCompareOdd = GraphLoopSwitchsBranchesdefaultAborted.Link( OEndOfSwitchOddOdd , ISwitchsCompareOdd ) + + LIsEvenaEndOfSwitchEvena = GraphLoopSwitchsBranchesdefaultAborted.Link( OIsEvena , IEndOfSwitchEvena ) + + LIsEvenEvenEndOfSwitchEvenEven = GraphLoopSwitchsBranchesdefaultAborted.Link( OIsEvenEven , IEndOfSwitchEvenEven ) + + LLoopIndexSwitchsCompareIndex = GraphLoopSwitchsBranchesdefaultAborted.Link( OLoopIndex , ISwitchsCompareIndex ) + + LLoopIndexSwitchOdda = GraphLoopSwitchsBranchesdefaultAborted.Link( OLoopIndex , ISwitchOdda ) + + LLoopIndexSwitchEvena = GraphLoopSwitchsBranchesdefaultAborted.Link( OLoopIndex , ISwitchEvena ) + + LLoopMinEndOfLoopMin = GraphLoopSwitchsBranchesdefaultAborted.Link( OLoopMin , IEndOfLoopMin ) + + LLoopMaxEndOfLoopMax = GraphLoopSwitchsBranchesdefaultAborted.Link( OLoopMax , IEndOfLoopMax ) + + LSwitchEvenOddIsNotEvenOdd = GraphLoopSwitchsBranchesdefaultAborted.Link( OSwitchEvenOdd , IIsNotEvenOdd ) + + LSwitchEvenEvenIsEvenGate = GraphLoopSwitchsBranchesdefaultAborted.Link( OSwitchEvenEven , IIsEvenGate ) + + LSwitchEvendefaultIsEvendefaultGate = GraphLoopSwitchsBranchesdefaultAborted.Link( OSwitchEvendefault , IIsEvendefaultGate ) + + LSwitchEvenaIsEvena = GraphLoopSwitchsBranchesdefaultAborted.Link( OSwitchEvena , IIsEvena ) + + LSwitchEvenaIsEvendefaulta = GraphLoopSwitchsBranchesdefaultAborted.Link( OSwitchEvena , IIsEvendefaulta ) + + LSwitchEvenOddEvenEndOfSwitchEvenOddEven = GraphLoopSwitchsBranchesdefaultAborted.Link( OSwitchEvenOddEven , IEndOfSwitchEvenOddEven ) + + LEndOfSwitchEvenaSwitchsCompareaEven = GraphLoopSwitchsBranchesdefaultAborted.Link( OEndOfSwitchEvena , ISwitchsCompareaEven ) + + LEndOfSwitchEvenEvenSwitchsCompareEven = GraphLoopSwitchsBranchesdefaultAborted.Link( OEndOfSwitchEvenEven , ISwitchsCompareEven ) + + LSwitchsCompareIndexEndOfLoopIndex = GraphLoopSwitchsBranchesdefaultAborted.Link( OSwitchsCompareIndex , IEndOfLoopIndex ) + + LIsNotOddEvenEndOfSwitchOddEven = GraphLoopSwitchsBranchesdefaultAborted.Link( OIsNotOddEven , IEndOfSwitchOddEven ) + + LIsNotEvenOddEndOfSwitchEvenOdd = GraphLoopSwitchsBranchesdefaultAborted.Link( OIsNotEvenOdd , IEndOfSwitchEvenOdd ) + + LIsOdddefaultaEndOfSwitchOdda = GraphLoopSwitchsBranchesdefaultAborted.Link( OIsOdddefaulta , IEndOfSwitchOdda ) + + LIsOdddefaultOddEndOfSwitchOddOdd = GraphLoopSwitchsBranchesdefaultAborted.Link( OIsOdddefaultOdd , IEndOfSwitchOddOdd ) + + LIsEvendefaultaEndOfSwitchEvena = GraphLoopSwitchsBranchesdefaultAborted.Link( OIsEvendefaulta , IEndOfSwitchEvena ) + + LIsEvendefaultEvenEndOfSwitchEvenEven = GraphLoopSwitchsBranchesdefaultAborted.Link( OIsEvendefaultEven , IEndOfSwitchEvenEven ) + + # Input datas + ILoopIndex.Input( 0 ) + ILoopMin.Input( -5 ) + ILoopMax.Input( 11 ) + + # Output Ports of the graph + #OEndOfLoopIndex = EndOfLoop.GetOutPort( 'Index' ) + #OEndOfLoopMin = EndOfLoop.GetOutPort( 'Min' ) + #OEndOfLoopMax = EndOfLoop.GetOutPort( 'Max' ) + return GraphLoopSwitchsBranchesdefaultAborted + + +GraphLoopSwitchsBranchesdefaultAborted = DefGraphLoopSwitchsBranchesdefaultAborted() diff --git a/examples/GraphLoopSwitchsBranchesDefaultAborted.xml b/examples/GraphLoopSwitchsBranchesDefaultAborted.xml new file mode 100644 index 0000000..ee1f2b3 --- /dev/null +++ b/examples/GraphLoopSwitchsBranchesDefaultAborted.xml @@ -0,0 +1,814 @@ + + + + + +? + ? + GraphLoopSwitchsBranchesdefaultAborted + 1 + ? + +GraphLoopSwitchsBranchesdefault + + +long + Loop__Index + +long + Loop__Min + +long + Loop__Max + + +long + EndOfLoop__Index + +long + EndOfLoop__Min + +long + EndOfLoop__Max + + + 14/10/2003 - 10:29:4 + 14/2/2005 - 17:10:5 + 1.05 + JR + ? + ? + 0 + 0 + + +? + ? + IsOdd + 3 + ? + +IsOdd + + +long + a + + +long + a + +long + Odd + + + +IsOdd + + + + + + 14/2/2005 - 17:10:5 + 14/2/2005 - 17:10:5 + 1.05 + ? + ? + Python function + 476 + 2 + +? + ? + SwitchOdd + 6 + EndOfSwitchOdd + +SwitchOdd + + +long + a + + +long + Odd + +int + Even + +long + default + +long + a + +string + OddEven + + + +SwitchOdd + + + + + + + + + + + 14/2/2005 - 17:10:5 + 14/2/2005 - 17:10:5 + 1.05 + ? + ? + Compute Node + 240 + 142 + +? + ? + EndOfSwitchOdd + 7 + SwitchOdd + +EndOfSwitchOdd + + +long + a + +boolean + Odd + +long + Even + +boolean + OddEven + + +long + a + +boolean + Odd + + + +EndOfSwitchOdd + + + + + 14/2/2005 - 17:10:5 + 14/2/2005 - 17:10:5 + 1.05 + ? + ? + Compute Node + 718 + 162 + +? + ? + IsEven + 3 + ? + +IsEven + + +long + a + + +long + a + +long + Even + + + +IsEven + + + + + + 14/2/2005 - 17:10:5 + 14/2/2005 - 17:10:5 + 1.05 + ? + ? + Python function + 472 + 724 + +? + ? + Loop + 4 + EndOfLoop + +Loop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +InitLoop + + + + +MoreLoop + + = Min : ]]> + + + + + +NextLoop + + + + 14/2/2005 - 17:10:5 + 14/2/2005 - 17:10:5 + 1.05 + ? + ? + Compute Node + 18 + 389 + +? + ? + EndOfLoop + 5 + Loop + +EndOfLoop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +? + + 14/2/2005 - 17:10:5 + 14/2/2005 - 17:10:5 + 1.05 + ? + ? + Compute Node + 1097 + 309 + +? + ? + SwitchEven + 6 + EndOfSwitchEven + +SwitchEven + + +long + a + + +long + Odd + +int + Even + +long + default + +int + a + +string + OddEven + + + +SwitchEven + + + + + + + + + + + + 14/2/2005 - 17:10:5 + 14/2/2005 - 17:10:5 + 1.05 + ? + ? + Compute Node + 230 + 457 + +? + ? + EndOfSwitchEven + 7 + SwitchEven + +EndOfSwitchEven + + +long + a + +boolean + Even + +long + Odd + +string + OddEven + + +long + a + +boolean + Even + + + +EndOfSwitchEven + + + + + 14/2/2005 - 17:10:5 + 14/2/2005 - 17:10:5 + 1.05 + ? + ? + Compute Node + 721 + 477 + +? + ? + SwitchsCompare + 3 + ? + +SwitchsCompare + + +long + aOdd + +boolean + Odd + +long + aEven + +boolean + Even + +long + Index + + +long + Index + + + +SwitchsCompare + + + + + 14/2/2005 - 17:10:5 + 14/2/2005 - 17:10:5 + 2.0 + ? + ? + Compute Node + 916 + 269 + +? + ? + IsNotOdd + 3 + ? + +IsNotOdd + + +long + Even + + +long + Even + + + +IsNotOdd + + + + + 14/2/2005 - 17:10:5 + 14/2/2005 - 17:10:5 + 2.0 + ? + ? + Compute Node + 477 + 137 + +? + ? + IsNotEven + 3 + ? + +IsNotEven + + +long + Odd + + +long + Odd + + + +IsNotEven + + + + + 14/2/2005 - 17:10:5 + 14/2/2005 - 17:10:5 + 2.0 + ? + ? + Compute Node + 475 + 601 + +? + ? + IsOdddefault + 3 + ? + +IsOdddefault + + +long + a + + +long + a + +long + Odd + + + +IsOdddefault + + + + + + 14/2/2005 - 17:10:5 + 14/2/2005 - 17:10:5 + 2.0 + ? + ? + Compute Node + 477 + 285 + +? + ? + IsEvendefault + 3 + ? + +IsEvendefault + + +long + a + + +long + a + +long + Even + + + +IsEvendefault + + + + + + 14/2/2005 - 17:10:5 + 14/2/2005 - 17:10:5 + 2.0 + ? + ? + Compute Node + 478 + 434 + + +IsOdd + a + EndOfSwitchOdd + a + + +IsOdd + Odd + EndOfSwitchOdd + Odd + + +SwitchOdd + Odd + IsOdd + Gate + + +SwitchOdd + Even + IsNotOdd + Even + + +SwitchOdd + default + IsOdddefault + Gate + + +SwitchOdd + a + IsOdddefault + a + + +SwitchOdd + a + IsOdd + a + + +SwitchOdd + OddEven + EndOfSwitchOdd + OddEven + + +EndOfSwitchOdd + a + SwitchsCompare + aOdd + + +EndOfSwitchOdd + Odd + SwitchsCompare + Odd + + +IsEven + a + EndOfSwitchEven + a + + +IsEven + Even + EndOfSwitchEven + Even + + +Loop + DoLoop + EndOfLoop + DoLoop + + +Loop + Index + SwitchsCompare + Index + + +Loop + Index + SwitchOdd + a + + +Loop + Index + SwitchEven + a + + +Loop + Min + EndOfLoop + Min + + +Loop + Max + EndOfLoop + Max + + +EndOfLoop + DoLoop + Loop + DoLoop + + +SwitchEven + Odd + IsNotEven + Odd + + +SwitchEven + Even + IsEven + Gate + + +SwitchEven + default + IsEvendefault + Gate + + +SwitchEven + a + IsEven + a + + +SwitchEven + a + IsEvendefault + a + + +SwitchEven + OddEven + EndOfSwitchEven + OddEven + + +EndOfSwitchEven + a + SwitchsCompare + aEven + + +EndOfSwitchEven + Even + SwitchsCompare + Even + + +SwitchsCompare + Index + EndOfLoop + Index + + +IsNotOdd + Even + EndOfSwitchOdd + Even + + +IsNotEven + Odd + EndOfSwitchEven + Odd + + +IsOdddefault + a + EndOfSwitchOdd + a + + +IsOdddefault + Odd + EndOfSwitchOdd + Odd + + +IsEvendefault + a + EndOfSwitchEven + a + + +IsEvendefault + Even + EndOfSwitchEven + Even + + + +GraphLoopSwitchsBranchesdefaultAborted + Loop__Index + Loop + Index + +3 + 0 + + +GraphLoopSwitchsBranchesdefaultAborted + Loop__Min + Loop + Min + +3 + -5 + + +GraphLoopSwitchsBranchesdefaultAborted + Loop__Max + Loop + Max + +3 + 11 + diff --git a/examples/GraphLoopSwitchsBranchesdefault.py b/examples/GraphLoopSwitchsBranchesdefault.py new file mode 100644 index 0000000..1af8dd7 --- /dev/null +++ b/examples/GraphLoopSwitchsBranchesdefault.py @@ -0,0 +1,350 @@ + +# Generated python file of Graph GraphLoopSwitchsBranchesdefault + +from SuperV import * + +# Graph creation of GraphLoopSwitchsBranchesdefault +def DefGraphLoopSwitchsBranchesdefault() : + GraphLoopSwitchsBranchesdefault = Graph( 'GraphLoopSwitchsBranchesdefault' ) + GraphLoopSwitchsBranchesdefault.SetName( 'GraphLoopSwitchsBranchesdefault' ) + GraphLoopSwitchsBranchesdefault.SetAuthor( 'JR' ) + GraphLoopSwitchsBranchesdefault.SetComment( '' ) + GraphLoopSwitchsBranchesdefault.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsOdd = [] + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd(a) : ' ) + PyIsOdd.append( ' print a,"IsOdd" ' ) + PyIsOdd.append( ' sleep( 1 ) ' ) + PyIsOdd.append( ' return a,1 ' ) + IsOdd = GraphLoopSwitchsBranchesdefault.INode( 'IsOdd' , PyIsOdd ) + IsOdd.SetName( 'IsOdd' ) + IsOdd.SetAuthor( '' ) + IsOdd.SetComment( 'Python function' ) + IsOdd.Coords( 476 , 2 ) + IIsOdda = IsOdd.InPort( 'a' , 'long' ) + IIsOddGate = IsOdd.GetInPort( 'Gate' ) + OIsOdda = IsOdd.OutPort( 'a' , 'long' ) + OIsOddOdd = IsOdd.OutPort( 'Odd' , 'long' ) + OIsOddGate = IsOdd.GetOutPort( 'Gate' ) + + PyIsEven = [] + PyIsEven.append( 'from time import * ' ) + PyIsEven.append( 'def IsEven(a) : ' ) + PyIsEven.append( ' print a,"IsEven" ' ) + PyIsEven.append( ' sleep( 1 ) ' ) + PyIsEven.append( ' return a,1 ' ) + IsEven = GraphLoopSwitchsBranchesdefault.INode( 'IsEven' , PyIsEven ) + IsEven.SetName( 'IsEven' ) + IsEven.SetAuthor( '' ) + IsEven.SetComment( 'Python function' ) + IsEven.Coords( 472 , 724 ) + IIsEvena = IsEven.InPort( 'a' , 'long' ) + IIsEvenGate = IsEven.GetInPort( 'Gate' ) + OIsEvena = IsEven.OutPort( 'a' , 'long' ) + OIsEvenEven = IsEven.OutPort( 'Even' , 'long' ) + OIsEvenGate = IsEven.GetOutPort( 'Gate' ) + + PySwitchsCompare = [] + PySwitchsCompare.append( 'from time import * ' ) + PySwitchsCompare.append( 'def SwitchsCompare(aOdd,Odd,aEven,Even,Index) : ' ) + PySwitchsCompare.append( ' sleep(1) ' ) + PySwitchsCompare.append( ' return Index ' ) + SwitchsCompare = GraphLoopSwitchsBranchesdefault.INode( 'SwitchsCompare' , PySwitchsCompare ) + SwitchsCompare.SetName( 'SwitchsCompare' ) + SwitchsCompare.SetAuthor( '' ) + SwitchsCompare.SetComment( 'Compute Node' ) + SwitchsCompare.Coords( 916 , 269 ) + ISwitchsCompareaOdd = SwitchsCompare.InPort( 'aOdd' , 'long' ) + ISwitchsCompareOdd = SwitchsCompare.InPort( 'Odd' , 'boolean' ) + ISwitchsCompareaEven = SwitchsCompare.InPort( 'aEven' , 'long' ) + ISwitchsCompareEven = SwitchsCompare.InPort( 'Even' , 'boolean' ) + ISwitchsCompareIndex = SwitchsCompare.InPort( 'Index' , 'long' ) + ISwitchsCompareGate = SwitchsCompare.GetInPort( 'Gate' ) + OSwitchsCompareIndex = SwitchsCompare.OutPort( 'Index' , 'long' ) + OSwitchsCompareGate = SwitchsCompare.GetOutPort( 'Gate' ) + + PyIsNotOdd = [] + PyIsNotOdd.append( 'from time import * ' ) + PyIsNotOdd.append( 'def IsNotOdd(Even) : ' ) + PyIsNotOdd.append( ' sleep(1) ' ) + PyIsNotOdd.append( ' return Even ' ) + IsNotOdd = GraphLoopSwitchsBranchesdefault.INode( 'IsNotOdd' , PyIsNotOdd ) + IsNotOdd.SetName( 'IsNotOdd' ) + IsNotOdd.SetAuthor( '' ) + IsNotOdd.SetComment( 'Compute Node' ) + IsNotOdd.Coords( 477 , 137 ) + IIsNotOddEven = IsNotOdd.InPort( 'Even' , 'long' ) + IIsNotOddGate = IsNotOdd.GetInPort( 'Gate' ) + OIsNotOddEven = IsNotOdd.OutPort( 'Even' , 'long' ) + OIsNotOddGate = IsNotOdd.GetOutPort( 'Gate' ) + + PyIsNotEven = [] + PyIsNotEven.append( 'from time import * ' ) + PyIsNotEven.append( 'def IsNotEven(Odd) : ' ) + PyIsNotEven.append( ' sleep(1) ' ) + PyIsNotEven.append( ' return Odd ' ) + IsNotEven = GraphLoopSwitchsBranchesdefault.INode( 'IsNotEven' , PyIsNotEven ) + IsNotEven.SetName( 'IsNotEven' ) + IsNotEven.SetAuthor( '' ) + IsNotEven.SetComment( 'Compute Node' ) + IsNotEven.Coords( 475 , 601 ) + IIsNotEvenOdd = IsNotEven.InPort( 'Odd' , 'long' ) + IIsNotEvenGate = IsNotEven.GetInPort( 'Gate' ) + OIsNotEvenOdd = IsNotEven.OutPort( 'Odd' , 'long' ) + OIsNotEvenGate = IsNotEven.GetOutPort( 'Gate' ) + + PyIsOdddefault = [] + PyIsOdddefault.append( 'from time import * ' ) + PyIsOdddefault.append( 'def IsOdddefault(a) : ' ) + PyIsOdddefault.append( ' sleep(1) ' ) + PyIsOdddefault.append( ' return a,0 ' ) + PyIsOdddefault.append( ' ' ) + IsOdddefault = GraphLoopSwitchsBranchesdefault.INode( 'IsOdddefault' , PyIsOdddefault ) + IsOdddefault.SetName( 'IsOdddefault' ) + IsOdddefault.SetAuthor( '' ) + IsOdddefault.SetComment( 'Compute Node' ) + IsOdddefault.Coords( 477 , 285 ) + IIsOdddefaulta = IsOdddefault.InPort( 'a' , 'long' ) + IIsOdddefaultGate = IsOdddefault.GetInPort( 'Gate' ) + OIsOdddefaulta = IsOdddefault.OutPort( 'a' , 'long' ) + OIsOdddefaultOdd = IsOdddefault.OutPort( 'Odd' , 'long' ) + OIsOdddefaultGate = IsOdddefault.GetOutPort( 'Gate' ) + + PyIsEvendefault = [] + PyIsEvendefault.append( 'from time import * ' ) + PyIsEvendefault.append( 'def IsEvendefault(a) : ' ) + PyIsEvendefault.append( ' sleep(1) ' ) + PyIsEvendefault.append( ' return a,0 ' ) + PyIsEvendefault.append( ' ' ) + IsEvendefault = GraphLoopSwitchsBranchesdefault.INode( 'IsEvendefault' , PyIsEvendefault ) + IsEvendefault.SetName( 'IsEvendefault' ) + IsEvendefault.SetAuthor( '' ) + IsEvendefault.SetComment( 'Compute Node' ) + IsEvendefault.Coords( 478 , 434 ) + IIsEvendefaulta = IsEvendefault.InPort( 'a' , 'long' ) + IIsEvendefaultGate = IsEvendefault.GetInPort( 'Gate' ) + OIsEvendefaulta = IsEvendefault.OutPort( 'a' , 'long' ) + OIsEvendefaultEven = IsEvendefault.OutPort( 'Even' , 'long' ) + OIsEvendefaultGate = IsEvendefault.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyLoop = [] + PyLoop.append( 'def InitLoop(Index,Min,Max) : ' ) + PyLoop.append( ' Index = Max ' ) + PyLoop.append( ' return Index,Min,Max ' ) + PyMoreLoop = [] + PyMoreLoop.append( 'def MoreLoop(Index,Min,Max) : ' ) + PyMoreLoop.append( ' if Index >= Min : ' ) + PyMoreLoop.append( ' DoLoop = 1 ' ) + PyMoreLoop.append( ' else : ' ) + PyMoreLoop.append( ' DoLoop = 0 ' ) + PyMoreLoop.append( ' return DoLoop,Index,Min,Max ' ) + PyNextLoop = [] + PyNextLoop.append( 'def NextLoop(Index,Min,Max) : ' ) + PyNextLoop.append( ' Index = Index - 1 ' ) + PyNextLoop.append( ' return Index,Min,Max ' ) + Loop,EndOfLoop = GraphLoopSwitchsBranchesdefault.LNode( 'InitLoop' , PyLoop , 'MoreLoop' , PyMoreLoop , 'NextLoop' , PyNextLoop ) + EndOfLoop.SetName( 'EndOfLoop' ) + EndOfLoop.SetAuthor( '' ) + EndOfLoop.SetComment( 'Compute Node' ) + EndOfLoop.Coords( 1097 , 309 ) + PyEndOfLoop = [] + EndOfLoop.SetPyFunction( '' , PyEndOfLoop ) + ILoopDoLoop = Loop.GetInPort( 'DoLoop' ) + ILoopIndex = Loop.InPort( 'Index' , 'long' ) + ILoopMin = Loop.InPort( 'Min' , 'long' ) + ILoopMax = Loop.InPort( 'Max' , 'long' ) + ILoopGate = Loop.GetInPort( 'Gate' ) + OLoopDoLoop = Loop.GetOutPort( 'DoLoop' ) + OLoopIndex = Loop.GetOutPort( 'Index' ) + OLoopMin = Loop.GetOutPort( 'Min' ) + OLoopMax = Loop.GetOutPort( 'Max' ) + IEndOfLoopDoLoop = EndOfLoop.GetInPort( 'DoLoop' ) + IEndOfLoopIndex = EndOfLoop.GetInPort( 'Index' ) + IEndOfLoopMin = EndOfLoop.GetInPort( 'Min' ) + IEndOfLoopMax = EndOfLoop.GetInPort( 'Max' ) + IEndOfLoopGate = EndOfLoop.GetInPort( 'Gate' ) + OEndOfLoopDoLoop = EndOfLoop.GetOutPort( 'DoLoop' ) + OEndOfLoopIndex = EndOfLoop.GetOutPort( 'Index' ) + OEndOfLoopMin = EndOfLoop.GetOutPort( 'Min' ) + OEndOfLoopMax = EndOfLoop.GetOutPort( 'Max' ) + OEndOfLoopGate = EndOfLoop.GetOutPort( 'Gate' ) + Loop.SetName( 'Loop' ) + Loop.SetAuthor( '' ) + Loop.SetComment( 'Compute Node' ) + Loop.Coords( 18 , 389 ) + + # Creation of Switch Nodes + PySwitchOdd = [] + PySwitchOdd.append( 'from time import * ' ) + PySwitchOdd.append( 'def SwitchOdd(a) : ' ) + PySwitchOdd.append( ' sleep(1) ' ) + PySwitchOdd.append( ' if a <= 0 : ' ) + PySwitchOdd.append( ' OddEven = '<=0' ' ) + PySwitchOdd.append( ' return 0,0,0,a,OddEven ' ) + PySwitchOdd.append( ' OddEven = 'Odd' ' ) + PySwitchOdd.append( ' if (a&1) == 0 : ' ) + PySwitchOdd.append( ' OddEven = 'Even' ' ) + PySwitchOdd.append( ' return a & 1,1-(a&1),1-(a&1),a,OddEven ' ) + SwitchOdd,EndOfSwitchOdd = GraphLoopSwitchsBranchesdefault.SNode( 'SwitchOdd' , PySwitchOdd ) + EndOfSwitchOdd.SetName( 'EndOfSwitchOdd' ) + EndOfSwitchOdd.SetAuthor( '' ) + EndOfSwitchOdd.SetComment( 'Compute Node' ) + EndOfSwitchOdd.Coords( 718 , 162 ) + PyEndOfSwitchOdd = [] + PyEndOfSwitchOdd.append( 'from time import * ' ) + PyEndOfSwitchOdd.append( 'def EndOfSwitchOdd(a,Odd,Even,OddEven) : ' ) + PyEndOfSwitchOdd.append( ' sleep(1) ' ) + PyEndOfSwitchOdd.append( ' return a,Odd ' ) + EndOfSwitchOdd.SetPyFunction( 'EndOfSwitchOdd' , PyEndOfSwitchOdd ) + IEndOfSwitchOdda = EndOfSwitchOdd.InPort( 'a' , 'long' ) + IEndOfSwitchOddOdd = EndOfSwitchOdd.InPort( 'Odd' , 'boolean' ) + IEndOfSwitchOddEven = EndOfSwitchOdd.InPort( 'Even' , 'long' ) + IEndOfSwitchOddOddEven = EndOfSwitchOdd.InPort( 'OddEven' , 'boolean' ) + IEndOfSwitchOddDefault = EndOfSwitchOdd.GetInPort( 'Default' ) + OEndOfSwitchOdda = EndOfSwitchOdd.OutPort( 'a' , 'long' ) + OEndOfSwitchOddOdd = EndOfSwitchOdd.OutPort( 'Odd' , 'boolean' ) + OEndOfSwitchOddGate = EndOfSwitchOdd.GetOutPort( 'Gate' ) + SwitchOdd.SetName( 'SwitchOdd' ) + SwitchOdd.SetAuthor( '' ) + SwitchOdd.SetComment( 'Compute Node' ) + SwitchOdd.Coords( 240 , 142 ) + ISwitchOdda = SwitchOdd.InPort( 'a' , 'long' ) + ISwitchOddGate = SwitchOdd.GetInPort( 'Gate' ) + OSwitchOddOdd = SwitchOdd.OutPort( 'Odd' , 'long' ) + OSwitchOddEven = SwitchOdd.OutPort( 'Even' , 'int' ) + OSwitchOdddefault = SwitchOdd.OutPort( 'default' , 'long' ) + OSwitchOdda = SwitchOdd.OutPort( 'a' , 'long' ) + OSwitchOddOddEven = SwitchOdd.OutPort( 'OddEven' , 'string' ) + OSwitchOddDefault = SwitchOdd.GetOutPort( 'Default' ) + + PySwitchEven = [] + PySwitchEven.append( 'from time import * ' ) + PySwitchEven.append( 'def SwitchEven(a) : ' ) + PySwitchEven.append( ' sleep(1) ' ) + PySwitchEven.append( ' if a <= 0 : ' ) + PySwitchEven.append( ' OddEven = '<=0' ' ) + PySwitchEven.append( ' return 0,0,0,a,OddEven ' ) + PySwitchEven.append( ' OddEven = 'Even' ' ) + PySwitchEven.append( ' if (a&1) != 0 : ' ) + PySwitchEven.append( ' OddEven = 'Odd' ' ) + PySwitchEven.append( ' print (a&1),1-(a&1),(a&1),a,OddEven ' ) + PySwitchEven.append( ' return (a&1),1-(a&1),(a&1),a,OddEven ' ) + SwitchEven,EndOfSwitchEven = GraphLoopSwitchsBranchesdefault.SNode( 'SwitchEven' , PySwitchEven ) + EndOfSwitchEven.SetName( 'EndOfSwitchEven' ) + EndOfSwitchEven.SetAuthor( '' ) + EndOfSwitchEven.SetComment( 'Compute Node' ) + EndOfSwitchEven.Coords( 721 , 477 ) + PyEndOfSwitchEven = [] + PyEndOfSwitchEven.append( 'from time import * ' ) + PyEndOfSwitchEven.append( 'def EndOfSwitchEven(a,Even,Odd,OddEven) : ' ) + PyEndOfSwitchEven.append( ' sleep(1) ' ) + PyEndOfSwitchEven.append( ' return a,Even ' ) + EndOfSwitchEven.SetPyFunction( 'EndOfSwitchEven' , PyEndOfSwitchEven ) + IEndOfSwitchEvena = EndOfSwitchEven.InPort( 'a' , 'long' ) + IEndOfSwitchEvenEven = EndOfSwitchEven.InPort( 'Even' , 'boolean' ) + IEndOfSwitchEvenOdd = EndOfSwitchEven.InPort( 'Odd' , 'long' ) + IEndOfSwitchEvenOddEven = EndOfSwitchEven.InPort( 'OddEven' , 'string' ) + IEndOfSwitchEvenDefault = EndOfSwitchEven.GetInPort( 'Default' ) + OEndOfSwitchEvena = EndOfSwitchEven.OutPort( 'a' , 'long' ) + OEndOfSwitchEvenEven = EndOfSwitchEven.OutPort( 'Even' , 'boolean' ) + OEndOfSwitchEvenGate = EndOfSwitchEven.GetOutPort( 'Gate' ) + SwitchEven.SetName( 'SwitchEven' ) + SwitchEven.SetAuthor( '' ) + SwitchEven.SetComment( 'Compute Node' ) + SwitchEven.Coords( 230 , 457 ) + ISwitchEvena = SwitchEven.InPort( 'a' , 'long' ) + ISwitchEvenGate = SwitchEven.GetInPort( 'Gate' ) + OSwitchEvenOdd = SwitchEven.OutPort( 'Odd' , 'long' ) + OSwitchEvenEven = SwitchEven.OutPort( 'Even' , 'int' ) + OSwitchEvendefault = SwitchEven.OutPort( 'default' , 'long' ) + OSwitchEvena = SwitchEven.OutPort( 'a' , 'int' ) + OSwitchEvenOddEven = SwitchEven.OutPort( 'OddEven' , 'string' ) + OSwitchEvenDefault = SwitchEven.GetOutPort( 'Default' ) + + # Creation of Links + LIsOddaEndOfSwitchOdda = GraphLoopSwitchsBranchesdefault.Link( OIsOdda , IEndOfSwitchOdda ) + + LIsOddOddEndOfSwitchOddOdd = GraphLoopSwitchsBranchesdefault.Link( OIsOddOdd , IEndOfSwitchOddOdd ) + + LSwitchOddOddIsOddGate = GraphLoopSwitchsBranchesdefault.Link( OSwitchOddOdd , IIsOddGate ) + + LSwitchOddEvenIsNotOddEven = GraphLoopSwitchsBranchesdefault.Link( OSwitchOddEven , IIsNotOddEven ) + + LSwitchOdddefaultIsOdddefaultGate = GraphLoopSwitchsBranchesdefault.Link( OSwitchOdddefault , IIsOdddefaultGate ) + + LSwitchOddaIsOdddefaulta = GraphLoopSwitchsBranchesdefault.Link( OSwitchOdda , IIsOdddefaulta ) + + LSwitchOddaIsOdda = GraphLoopSwitchsBranchesdefault.Link( OSwitchOdda , IIsOdda ) + + LSwitchOddOddEvenEndOfSwitchOddOddEven = GraphLoopSwitchsBranchesdefault.Link( OSwitchOddOddEven , IEndOfSwitchOddOddEven ) + + LSwitchOddDefaultEndOfSwitchOddDefault = GraphLoopSwitchsBranchesdefault.Link( OSwitchOddDefault , IEndOfSwitchOddDefault ) + + LEndOfSwitchOddaSwitchsCompareaOdd = GraphLoopSwitchsBranchesdefault.Link( OEndOfSwitchOdda , ISwitchsCompareaOdd ) + + LEndOfSwitchOddOddSwitchsCompareOdd = GraphLoopSwitchsBranchesdefault.Link( OEndOfSwitchOddOdd , ISwitchsCompareOdd ) + + LIsEvenaEndOfSwitchEvena = GraphLoopSwitchsBranchesdefault.Link( OIsEvena , IEndOfSwitchEvena ) + + LIsEvenEvenEndOfSwitchEvenEven = GraphLoopSwitchsBranchesdefault.Link( OIsEvenEven , IEndOfSwitchEvenEven ) + + LLoopIndexSwitchsCompareIndex = GraphLoopSwitchsBranchesdefault.Link( OLoopIndex , ISwitchsCompareIndex ) + + LLoopIndexSwitchOdda = GraphLoopSwitchsBranchesdefault.Link( OLoopIndex , ISwitchOdda ) + + LLoopIndexSwitchEvena = GraphLoopSwitchsBranchesdefault.Link( OLoopIndex , ISwitchEvena ) + + LLoopMinEndOfLoopMin = GraphLoopSwitchsBranchesdefault.Link( OLoopMin , IEndOfLoopMin ) + + LLoopMaxEndOfLoopMax = GraphLoopSwitchsBranchesdefault.Link( OLoopMax , IEndOfLoopMax ) + + LSwitchEvenOddIsNotEvenOdd = GraphLoopSwitchsBranchesdefault.Link( OSwitchEvenOdd , IIsNotEvenOdd ) + + LSwitchEvenEvenIsEvenGate = GraphLoopSwitchsBranchesdefault.Link( OSwitchEvenEven , IIsEvenGate ) + + LSwitchEvendefaultIsEvendefaultGate = GraphLoopSwitchsBranchesdefault.Link( OSwitchEvendefault , IIsEvendefaultGate ) + + LSwitchEvenaIsEvena = GraphLoopSwitchsBranchesdefault.Link( OSwitchEvena , IIsEvena ) + + LSwitchEvenaIsEvendefaulta = GraphLoopSwitchsBranchesdefault.Link( OSwitchEvena , IIsEvendefaulta ) + + LSwitchEvenOddEvenEndOfSwitchEvenOddEven = GraphLoopSwitchsBranchesdefault.Link( OSwitchEvenOddEven , IEndOfSwitchEvenOddEven ) + + LSwitchEvenDefaultEndOfSwitchEvenDefault = GraphLoopSwitchsBranchesdefault.Link( OSwitchEvenDefault , IEndOfSwitchEvenDefault ) + + LEndOfSwitchEvenaSwitchsCompareaEven = GraphLoopSwitchsBranchesdefault.Link( OEndOfSwitchEvena , ISwitchsCompareaEven ) + + LEndOfSwitchEvenEvenSwitchsCompareEven = GraphLoopSwitchsBranchesdefault.Link( OEndOfSwitchEvenEven , ISwitchsCompareEven ) + + LSwitchsCompareIndexEndOfLoopIndex = GraphLoopSwitchsBranchesdefault.Link( OSwitchsCompareIndex , IEndOfLoopIndex ) + + LIsNotOddEvenEndOfSwitchOddEven = GraphLoopSwitchsBranchesdefault.Link( OIsNotOddEven , IEndOfSwitchOddEven ) + + LIsNotEvenOddEndOfSwitchEvenOdd = GraphLoopSwitchsBranchesdefault.Link( OIsNotEvenOdd , IEndOfSwitchEvenOdd ) + + LIsOdddefaultaEndOfSwitchOdda = GraphLoopSwitchsBranchesdefault.Link( OIsOdddefaulta , IEndOfSwitchOdda ) + + LIsOdddefaultOddEndOfSwitchOddOdd = GraphLoopSwitchsBranchesdefault.Link( OIsOdddefaultOdd , IEndOfSwitchOddOdd ) + + LIsEvendefaultaEndOfSwitchEvena = GraphLoopSwitchsBranchesdefault.Link( OIsEvendefaulta , IEndOfSwitchEvena ) + + LIsEvendefaultEvenEndOfSwitchEvenEven = GraphLoopSwitchsBranchesdefault.Link( OIsEvendefaultEven , IEndOfSwitchEvenEven ) + + # Input datas + ILoopIndex.Input( 0 ) + ILoopMin.Input( -5 ) + ILoopMax.Input( 23 ) + + # Output Ports of the graph + #OEndOfLoopIndex = EndOfLoop.GetOutPort( 'Index' ) + #OEndOfLoopMin = EndOfLoop.GetOutPort( 'Min' ) + #OEndOfLoopMax = EndOfLoop.GetOutPort( 'Max' ) + return GraphLoopSwitchsBranchesdefault + + +GraphLoopSwitchsBranchesdefault = DefGraphLoopSwitchsBranchesdefault() diff --git a/examples/GraphLoopSwitchsBranchesdefault.xml b/examples/GraphLoopSwitchsBranchesdefault.xml new file mode 100644 index 0000000..29a71f6 --- /dev/null +++ b/examples/GraphLoopSwitchsBranchesdefault.xml @@ -0,0 +1,826 @@ + + + + + +? + ? + GraphLoopSwitchsBranchesdefault + 1 + ? + +GraphLoopSwitchsBranchesdefault + + +long + Loop__Index + +long + Loop__Min + +long + Loop__Max + + +long + EndOfLoop__Index + +long + EndOfLoop__Min + +long + EndOfLoop__Max + + + 14/10/2003 - 10:29:4 + 11/2/2005 - 17:25:28 + 1.05 + JR + ? + ? + 0 + 0 + + +? + ? + IsOdd + 3 + ? + +IsOdd + + +long + a + + +long + a + +long + Odd + + + +IsOdd + + + + + + 11/2/2005 - 17:9:54 + 11/2/2005 - 17:9:54 + 1.05 + ? + ? + Python function + 476 + 2 + +? + ? + SwitchOdd + 6 + EndOfSwitchOdd + +SwitchOdd + + +long + a + + +long + Odd + +int + Even + +long + default + +long + a + +string + OddEven + + + +SwitchOdd + + + + + + + + + + + 11/2/2005 - 17:9:54 + 11/2/2005 - 17:9:54 + 1.05 + ? + ? + Compute Node + 240 + 142 + +? + ? + EndOfSwitchOdd + 7 + SwitchOdd + +EndOfSwitchOdd + + +long + a + +boolean + Odd + +long + Even + +boolean + OddEven + + +long + a + +boolean + Odd + + + +EndOfSwitchOdd + + + + + 11/2/2005 - 17:9:54 + 11/2/2005 - 17:9:54 + 1.05 + ? + ? + Compute Node + 718 + 162 + +? + ? + IsEven + 3 + ? + +IsEven + + +long + a + + +long + a + +long + Even + + + +IsEven + + + + + + 11/2/2005 - 17:9:54 + 11/2/2005 - 17:9:54 + 1.05 + ? + ? + Python function + 472 + 724 + +? + ? + Loop + 4 + EndOfLoop + +Loop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +InitLoop + + + + +MoreLoop + + = Min : ]]> + + + + + +NextLoop + + + + 11/2/2005 - 17:9:54 + 11/2/2005 - 17:9:54 + 1.05 + ? + ? + Compute Node + 18 + 389 + +? + ? + EndOfLoop + 5 + Loop + +EndOfLoop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +? + + 11/2/2005 - 17:9:54 + 11/2/2005 - 17:9:54 + 1.05 + ? + ? + Compute Node + 1097 + 309 + +? + ? + SwitchEven + 6 + EndOfSwitchEven + +SwitchEven + + +long + a + + +long + Odd + +int + Even + +long + default + +int + a + +string + OddEven + + + +SwitchEven + + + + + + + + + + + + 11/2/2005 - 17:9:54 + 11/2/2005 - 17:9:54 + 1.05 + ? + ? + Compute Node + 230 + 457 + +? + ? + EndOfSwitchEven + 7 + SwitchEven + +EndOfSwitchEven + + +long + a + +boolean + Even + +long + Odd + +string + OddEven + + +long + a + +boolean + Even + + + +EndOfSwitchEven + + + + + 11/2/2005 - 17:9:54 + 11/2/2005 - 17:9:54 + 1.05 + ? + ? + Compute Node + 721 + 477 + +? + ? + SwitchsCompare + 3 + ? + +SwitchsCompare + + +long + aOdd + +boolean + Odd + +long + aEven + +boolean + Even + +long + Index + + +long + Index + + + +SwitchsCompare + + + + + 11/2/2005 - 17:9:54 + 11/2/2005 - 17:9:54 + 2.0 + ? + ? + Compute Node + 916 + 269 + +? + ? + IsNotOdd + 3 + ? + +IsNotOdd + + +long + Even + + +long + Even + + + +IsNotOdd + + + + + 11/2/2005 - 17:9:54 + 11/2/2005 - 17:9:54 + 2.0 + ? + ? + Compute Node + 477 + 137 + +? + ? + IsNotEven + 3 + ? + +IsNotEven + + +long + Odd + + +long + Odd + + + +IsNotEven + + + + + 11/2/2005 - 17:9:54 + 11/2/2005 - 17:9:54 + 2.0 + ? + ? + Compute Node + 475 + 601 + +? + ? + IsOdddefault + 3 + ? + +IsOdddefault + + +long + a + + +long + a + +long + Odd + + + +IsOdddefault + + + + + + 11/2/2005 - 17:16:6 + 11/2/2005 - 17:16:6 + 2.0 + ? + ? + Compute Node + 477 + 285 + +? + ? + IsEvendefault + 3 + ? + +IsOdddefault_1 + + +long + a + + +long + a + +long + Even + + + +IsEvendefault + + + + + + 11/2/2005 - 17:23:32 + 11/2/2005 - 17:23:32 + 2.0 + ? + ? + Compute Node + 478 + 434 + + +IsOdd + a + EndOfSwitchOdd + a + + +IsOdd + Odd + EndOfSwitchOdd + Odd + + +SwitchOdd + Odd + IsOdd + Gate + + +SwitchOdd + Even + IsNotOdd + Even + + +SwitchOdd + default + IsOdddefault + Gate + + +SwitchOdd + a + IsOdddefault + a + + +SwitchOdd + a + IsOdd + a + + +SwitchOdd + OddEven + EndOfSwitchOdd + OddEven + + +SwitchOdd + Default + EndOfSwitchOdd + Default + + +EndOfSwitchOdd + a + SwitchsCompare + aOdd + + +EndOfSwitchOdd + Odd + SwitchsCompare + Odd + + +IsEven + a + EndOfSwitchEven + a + + +IsEven + Even + EndOfSwitchEven + Even + + +Loop + DoLoop + EndOfLoop + DoLoop + + +Loop + Index + SwitchsCompare + Index + + +Loop + Index + SwitchOdd + a + + +Loop + Index + SwitchEven + a + + +Loop + Min + EndOfLoop + Min + + +Loop + Max + EndOfLoop + Max + + +EndOfLoop + DoLoop + Loop + DoLoop + + +SwitchEven + Odd + IsNotEven + Odd + + +SwitchEven + Even + IsEven + Gate + + +SwitchEven + default + IsEvendefault + Gate + + +SwitchEven + a + IsEven + a + + +SwitchEven + a + IsEvendefault + a + + +SwitchEven + OddEven + EndOfSwitchEven + OddEven + + +SwitchEven + Default + EndOfSwitchEven + Default + + +EndOfSwitchEven + a + SwitchsCompare + aEven + + +EndOfSwitchEven + Even + SwitchsCompare + Even + + +SwitchsCompare + Index + EndOfLoop + Index + + +IsNotOdd + Even + EndOfSwitchOdd + Even + + +IsNotEven + Odd + EndOfSwitchEven + Odd + + +IsOdddefault + a + EndOfSwitchOdd + a + + +IsOdddefault + Odd + EndOfSwitchOdd + Odd + + +IsEvendefault + a + EndOfSwitchEven + a + + +IsEvendefault + Even + EndOfSwitchEven + Even + + + +GraphLoopSwitchsBranchesdefault + Loop__Index + Loop + Index + +3 + 0 + + +GraphLoopSwitchsBranchesdefault + Loop__Min + Loop + Min + +3 + -5 + + +GraphLoopSwitchsBranchesdefault + Loop__Max + Loop + Max + +3 + 23 + diff --git a/examples/GraphLoopSwitchsNOTValid.py b/examples/GraphLoopSwitchsNOTValid.py new file mode 100644 index 0000000..09b9a00 --- /dev/null +++ b/examples/GraphLoopSwitchsNOTValid.py @@ -0,0 +1,229 @@ + +# Generated python file of Graph GraphLoopSwitchsNOTValid + +from SuperV import * + +# Graph creation of GraphLoopSwitchsNOTValid +def DefGraphLoopSwitchsNOTValid() : + GraphLoopSwitchsNOTValid = Graph( 'GraphLoopSwitchsNOTValid' ) + GraphLoopSwitchsNOTValid.SetName( 'GraphLoopSwitchsNOTValid' ) + GraphLoopSwitchsNOTValid.SetAuthor( 'JR' ) + GraphLoopSwitchsNOTValid.SetComment( '' ) + GraphLoopSwitchsNOTValid.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsOdd = [] + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd(a) : ' ) + PyIsOdd.append( ' print a,"IsOdd" ' ) + PyIsOdd.append( ' sleep( 1 ) ' ) + PyIsOdd.append( ' return a ' ) + IsOdd = GraphLoopSwitchsNOTValid.INode( 'IsOdd' , PyIsOdd ) + IsOdd.SetName( 'IsOdd' ) + IsOdd.SetAuthor( '' ) + IsOdd.SetComment( 'Python function' ) + IsOdd.Coords( 476 , 50 ) + IIsOdda = IsOdd.InPort( 'a' , 'long' ) + IIsOddGate = IsOdd.GetInPort( 'Gate' ) + OIsOdda = IsOdd.OutPort( 'a' , 'long' ) + OIsOddGate = IsOdd.GetOutPort( 'Gate' ) + + PyIsEven = [] + PyIsEven.append( 'from time import * ' ) + PyIsEven.append( 'def IsEven(a) : ' ) + PyIsEven.append( ' print a,"IsEven" ' ) + PyIsEven.append( ' sleep( 1 ) ' ) + PyIsEven.append( ' return a ' ) + IsEven = GraphLoopSwitchsNOTValid.INode( 'IsEven' , PyIsEven ) + IsEven.SetName( 'IsEven' ) + IsEven.SetAuthor( '' ) + IsEven.SetComment( 'Python function' ) + IsEven.Coords( 479 , 311 ) + IIsEvena = IsEven.InPort( 'a' , 'long' ) + IIsEvenGate = IsEven.GetInPort( 'Gate' ) + OIsEvena = IsEven.OutPort( 'a' , 'long' ) + OIsEvenGate = IsEven.GetOutPort( 'Gate' ) + + PySwitchsCompare = [] + PySwitchsCompare.append( 'def SwitchsCompare(aOdd,Odd,aEven,Even) : ' ) + PySwitchsCompare.append( ' return a ' ) + SwitchsCompare = GraphLoopSwitchsNOTValid.INode( 'SwitchsCompare' , PySwitchsCompare ) + SwitchsCompare.SetName( 'SwitchsCompare' ) + SwitchsCompare.SetAuthor( '' ) + SwitchsCompare.SetComment( 'Compute Node' ) + SwitchsCompare.Coords( 919 , 242 ) + ISwitchsCompareaOdd = SwitchsCompare.InPort( 'aOdd' , 'long' ) + ISwitchsCompareOdd = SwitchsCompare.InPort( 'Odd' , 'boolean' ) + ISwitchsCompareaEven = SwitchsCompare.InPort( 'aEven' , 'long' ) + ISwitchsCompareEven = SwitchsCompare.InPort( 'Even' , 'boolean' ) + ISwitchsCompareGate = SwitchsCompare.GetInPort( 'Gate' ) + OSwitchsComparea = SwitchsCompare.OutPort( 'a' , 'long' ) + OSwitchsCompareGate = SwitchsCompare.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyLoop = [] + PyLoop.append( 'def InitLoop(Index,Min,Max) : ' ) + PyLoop.append( ' return Index,Min,Max ' ) + PyMoreLoop = [] + PyMoreLoop.append( 'def MoreLoop(Index,Min,Max) : ' ) + PyMoreLoop.append( ' if Index <= Max : ' ) + PyMoreLoop.append( ' DoLoop = 1 ' ) + PyMoreLoop.append( ' else : ' ) + PyMoreLoop.append( ' DoLoop = 0 ' ) + PyMoreLoop.append( ' return DoLoop,Index,Min,Max ' ) + PyNextLoop = [] + PyNextLoop.append( 'def NextLoop(Index,Min,Max) : ' ) + PyNextLoop.append( ' Index = Index + 1 ' ) + PyNextLoop.append( ' return Index,Min,Max ' ) + Loop,EndOfLoop = GraphLoopSwitchsNOTValid.LNode( 'InitLoop' , PyLoop , 'MoreLoop' , PyMoreLoop , 'NextLoop' , PyNextLoop ) + EndOfLoop.SetName( 'EndOfLoop' ) + EndOfLoop.SetAuthor( '' ) + EndOfLoop.SetComment( 'Compute Node' ) + EndOfLoop.Coords( 1102 , 282 ) + PyEndOfLoop = [] + EndOfLoop.SetPyFunction( '' , PyEndOfLoop ) + ILoopDoLoop = Loop.GetInPort( 'DoLoop' ) + ILoopIndex = Loop.InPort( 'Index' , 'long' ) + ILoopMin = Loop.InPort( 'Min' , 'long' ) + ILoopMax = Loop.InPort( 'Max' , 'long' ) + ILoopGate = Loop.GetInPort( 'Gate' ) + OLoopDoLoop = Loop.GetOutPort( 'DoLoop' ) + OLoopIndex = Loop.GetOutPort( 'Index' ) + OLoopMin = Loop.GetOutPort( 'Min' ) + OLoopMax = Loop.GetOutPort( 'Max' ) + IEndOfLoopDoLoop = EndOfLoop.GetInPort( 'DoLoop' ) + IEndOfLoopIndex = EndOfLoop.GetInPort( 'Index' ) + IEndOfLoopMin = EndOfLoop.GetInPort( 'Min' ) + IEndOfLoopMax = EndOfLoop.GetInPort( 'Max' ) + IEndOfLoopGate = EndOfLoop.GetInPort( 'Gate' ) + OEndOfLoopDoLoop = EndOfLoop.GetOutPort( 'DoLoop' ) + OEndOfLoopIndex = EndOfLoop.GetOutPort( 'Index' ) + OEndOfLoopMin = EndOfLoop.GetOutPort( 'Min' ) + OEndOfLoopMax = EndOfLoop.GetOutPort( 'Max' ) + OEndOfLoopGate = EndOfLoop.GetOutPort( 'Gate' ) + Loop.SetName( 'Loop' ) + Loop.SetAuthor( '' ) + Loop.SetComment( 'Compute Node' ) + Loop.Coords( 12 , 276 ) + + # Creation of Switch Nodes + PySwitchOdd = [] + PySwitchOdd.append( 'from time import * ' ) + PySwitchOdd.append( 'def Switch(a) : ' ) + PySwitchOdd.append( ' if ( a & 1 ) == 0 : ' ) + PySwitchOdd.append( ' sleep(1) ' ) + PySwitchOdd.append( ' return a & 1,1-(a&1),a ' ) + SwitchOdd,EndOfSwitchOdd = GraphLoopSwitchsNOTValid.SNode( 'Switch' , PySwitchOdd ) + EndOfSwitchOdd.SetName( 'EndOfSwitchOdd' ) + EndOfSwitchOdd.SetAuthor( '' ) + EndOfSwitchOdd.SetComment( 'Compute Node' ) + EndOfSwitchOdd.Coords( 711 , 161 ) + PyEndOfSwitchOdd = [] + EndOfSwitchOdd.SetPyFunction( '' , PyEndOfSwitchOdd ) + IEndOfSwitchOdda = EndOfSwitchOdd.InPort( 'a' , 'long' ) + IEndOfSwitchOddOdd = EndOfSwitchOdd.InPort( 'Odd' , 'boolean' ) + IEndOfSwitchOddDefault = EndOfSwitchOdd.GetInPort( 'Default' ) + OEndOfSwitchOdda = EndOfSwitchOdd.OutPort( 'a' , 'long' ) + OEndOfSwitchOddOdd = EndOfSwitchOdd.OutPort( 'Odd' , 'boolean' ) + OEndOfSwitchOddGate = EndOfSwitchOdd.GetOutPort( 'Gate' ) + SwitchOdd.SetName( 'SwitchOdd' ) + SwitchOdd.SetAuthor( '' ) + SwitchOdd.SetComment( 'Compute Node' ) + SwitchOdd.Coords( 240 , 141 ) + ISwitchOdda = SwitchOdd.InPort( 'a' , 'long' ) + ISwitchOddGate = SwitchOdd.GetInPort( 'Gate' ) + OSwitchOddOdd = SwitchOdd.OutPort( 'Odd' , 'long' ) + OSwitchOddEven = SwitchOdd.OutPort( 'Even' , 'int' ) + OSwitchOdda = SwitchOdd.OutPort( 'a' , 'int' ) + OSwitchOddDefault = SwitchOdd.GetOutPort( 'Default' ) + + PySwitchEven = [] + PySwitchEven.append( 'from time import * ' ) + PySwitchEven.append( 'def Switch(a) : ' ) + PySwitchEven.append( ' if ( a & 1 ) == 0 : ' ) + PySwitchEven.append( ' sleep(1) ' ) + PySwitchEven.append( ' return a & 1,1-(a&1),a ' ) + SwitchEven,EndOfSwitchEven = GraphLoopSwitchsNOTValid.SNode( 'Switch' , PySwitchEven ) + EndOfSwitchEven.SetName( 'EndOfSwitchEven' ) + EndOfSwitchEven.SetAuthor( '' ) + EndOfSwitchEven.SetComment( 'Compute Node' ) + EndOfSwitchEven.Coords( 718 , 361 ) + PyEndOfSwitchEven = [] + EndOfSwitchEven.SetPyFunction( '' , PyEndOfSwitchEven ) + IEndOfSwitchEvena = EndOfSwitchEven.InPort( 'a' , 'long' ) + IEndOfSwitchEvenEven = EndOfSwitchEven.InPort( 'Even' , 'boolean' ) + IEndOfSwitchEvenDefault = EndOfSwitchEven.GetInPort( 'Default' ) + OEndOfSwitchEvena = EndOfSwitchEven.OutPort( 'a' , 'long' ) + OEndOfSwitchEvenEven = EndOfSwitchEven.OutPort( 'Even' , 'boolean' ) + OEndOfSwitchEvenGate = EndOfSwitchEven.GetOutPort( 'Gate' ) + SwitchEven.SetName( 'SwitchEven' ) + SwitchEven.SetAuthor( '' ) + SwitchEven.SetComment( 'Compute Node' ) + SwitchEven.Coords( 235 , 386 ) + ISwitchEvena = SwitchEven.InPort( 'a' , 'long' ) + ISwitchEvenGate = SwitchEven.GetInPort( 'Gate' ) + OSwitchEvenOdd = SwitchEven.OutPort( 'Odd' , 'long' ) + OSwitchEvenEven = SwitchEven.OutPort( 'Even' , 'int' ) + OSwitchEvena = SwitchEven.OutPort( 'a' , 'int' ) + OSwitchEvenDefault = SwitchEven.GetOutPort( 'Default' ) + + # Creation of Links + LIsOddaEndOfSwitchOdda = GraphLoopSwitchsNOTValid.Link( OIsOdda , IEndOfSwitchOdda ) + + LSwitchOddOddIsOddGate = GraphLoopSwitchsNOTValid.Link( OSwitchOddOdd , IIsOddGate ) + + LSwitchOddOddEndOfSwitchOddOdd = GraphLoopSwitchsNOTValid.Link( OSwitchOddOdd , IEndOfSwitchOddOdd ) + + LSwitchOddaIsOdda = GraphLoopSwitchsNOTValid.Link( OSwitchOdda , IIsOdda ) + LSwitchOddaIsOdda.AddCoord( 1 , 443 , 121 ) + LSwitchOddaIsOdda.AddCoord( 2 , 443 , 212 ) + + LSwitchOddDefaultEndOfSwitchOddDefault = GraphLoopSwitchsNOTValid.Link( OSwitchOddDefault , IEndOfSwitchOddDefault ) + + LEndOfSwitchOddaSwitchsCompareaOdd = GraphLoopSwitchsNOTValid.Link( OEndOfSwitchOdda , ISwitchsCompareaOdd ) + + LEndOfSwitchOddOddSwitchsCompareOdd = GraphLoopSwitchsNOTValid.Link( OEndOfSwitchOddOdd , ISwitchsCompareOdd ) + + LIsEvenaEndOfSwitchEvena = GraphLoopSwitchsNOTValid.Link( OIsEvena , IEndOfSwitchEvena ) + + LLoopIndexSwitchEvena = GraphLoopSwitchsNOTValid.Link( OLoopIndex , ISwitchEvena ) + + LLoopIndexSwitchOdda = GraphLoopSwitchsNOTValid.Link( OLoopIndex , ISwitchOdda ) + + LLoopMinEndOfLoopMin = GraphLoopSwitchsNOTValid.Link( OLoopMin , IEndOfLoopMin ) + + LLoopMaxEndOfLoopMax = GraphLoopSwitchsNOTValid.Link( OLoopMax , IEndOfLoopMax ) + + LSwitchEvenOddIsEvenGate = GraphLoopSwitchsNOTValid.Link( OSwitchEvenOdd , IIsEvenGate ) + + LSwitchEvenEvenEndOfSwitchEvenDefault = GraphLoopSwitchsNOTValid.Link( OSwitchEvenEven , IEndOfSwitchEvenDefault ) + + LSwitchEvenaIsEvena = GraphLoopSwitchsNOTValid.Link( OSwitchEvena , IIsEvena ) + LSwitchEvenaIsEvena.AddCoord( 1 , 434 , 382 ) + LSwitchEvenaIsEvena.AddCoord( 2 , 434 , 457 ) + + LEndOfSwitchEvenaSwitchsCompareaEven = GraphLoopSwitchsNOTValid.Link( OEndOfSwitchEvena , ISwitchsCompareaEven ) + + LEndOfSwitchEvenEvenSwitchsCompareEven = GraphLoopSwitchsNOTValid.Link( OEndOfSwitchEvenEven , ISwitchsCompareEven ) + + LSwitchsCompareaEndOfLoopIndex = GraphLoopSwitchsNOTValid.Link( OSwitchsComparea , IEndOfLoopIndex ) + + # Input datas + ILoopIndex.Input( 0 ) + ILoopMin.Input( 0 ) + ILoopMax.Input( 100 ) + + # Input Ports of the graph + #IEndOfSwitchEvenEven = EndOfSwitchEven.GetInPort( 'Even' ) + + # Output Ports of the graph + #OSwitchOddEven = SwitchOdd.GetOutPort( 'Even' ) + #OEndOfLoopIndex = EndOfLoop.GetOutPort( 'Index' ) + #OEndOfLoopMin = EndOfLoop.GetOutPort( 'Min' ) + #OEndOfLoopMax = EndOfLoop.GetOutPort( 'Max' ) + return GraphLoopSwitchsNOTValid + + +GraphLoopSwitchsNOTValid = DefGraphLoopSwitchsNOTValid() diff --git a/examples/GraphLoopSwitchsNOTValid.xml b/examples/GraphLoopSwitchsNOTValid.xml new file mode 100644 index 0000000..5ba6267 --- /dev/null +++ b/examples/GraphLoopSwitchsNOTValid.xml @@ -0,0 +1,559 @@ + + + + + +? + ? + GraphLoopSwitchsNOTValid + 1 + ? + +GraphLoopSwitchsNOTValid + + +long + Loop__Index + +long + Loop__Min + +long + Loop__Max + +boolean + EndOfSwitchEven__Even + + +int + SwitchOdd__Even + +long + EndOfLoop__Index + +long + EndOfLoop__Min + +long + EndOfLoop__Max + + + 14/10/2003 - 10:29:4 + 8/2/2005 - 11:26:57 + 1.05 + JR + ? + ? + 0 + 0 + + +? + ? + IsOdd + 3 + ? + +IsOdd + + +long + a + + +long + a + + + +IsOdd + + + + + + 8/2/2005 - 11:26:56 + 8/2/2005 - 11:26:56 + 1.05 + ? + ? + Python function + 476 + 50 + +? + ? + SwitchOdd + 6 + EndOfSwitchOdd + +SwitchOdd + + +long + a + + +long + Odd + +int + Even + +int + a + + + +Switch + + + + + + 8/2/2005 - 11:26:56 + 8/2/2005 - 11:26:56 + 1.05 + ? + ? + Compute Node + 240 + 141 + +? + ? + EndOfSwitchOdd + 7 + SwitchOdd + +EndOfSwitchOdd + + +long + a + +boolean + Odd + + +long + a + +boolean + Odd + + + +? + + 8/2/2005 - 11:26:56 + 8/2/2005 - 11:26:56 + 1.05 + ? + ? + Compute Node + 711 + 161 + +? + ? + IsEven + 3 + ? + +IsEven + + +long + a + + +long + a + + + +IsEven + + + + + + 8/2/2005 - 11:26:56 + 8/2/2005 - 11:26:56 + 1.05 + ? + ? + Python function + 479 + 311 + +? + ? + Loop + 4 + EndOfLoop + +Loop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +InitLoop + + + +MoreLoop + + + + + + + +NextLoop + + + + 8/2/2005 - 11:26:56 + 8/2/2005 - 11:26:56 + 1.05 + ? + ? + Compute Node + 12 + 276 + +? + ? + EndOfLoop + 5 + Loop + +EndOfLoop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +? + + 8/2/2005 - 11:26:56 + 8/2/2005 - 11:26:56 + 1.05 + ? + ? + Compute Node + 1102 + 282 + +? + ? + SwitchEven + 6 + EndOfSwitchEven + +SwitchEven + + +long + a + + +long + Odd + +int + Even + +int + a + + + +Switch + + + + + + 8/2/2005 - 11:26:56 + 8/2/2005 - 11:26:56 + 1.05 + ? + ? + Compute Node + 235 + 386 + +? + ? + EndOfSwitchEven + 7 + SwitchEven + +EndOfSwitchEven + + +long + a + +boolean + Even + + +long + a + +boolean + Even + + + +? + + 8/2/2005 - 11:26:56 + 8/2/2005 - 11:26:56 + 1.05 + ? + ? + Compute Node + 718 + 361 + +? + ? + SwitchsCompare + 3 + ? + +SwitchsCompare + + +long + aOdd + +boolean + Odd + +long + aEven + +boolean + Even + + +long + a + + + +SwitchsCompare + + + 8/2/2005 - 11:26:56 + 8/2/2005 - 11:26:56 + 2.0 + ? + ? + Compute Node + 919 + 242 + + +IsOdd + a + EndOfSwitchOdd + a + + +SwitchOdd + Odd + IsOdd + Gate + + +SwitchOdd + Odd + EndOfSwitchOdd + Odd + + +SwitchOdd + a + IsOdd + a + + +443 + 121 + +443 + 212 + +SwitchOdd + Default + EndOfSwitchOdd + Default + + +EndOfSwitchOdd + a + SwitchsCompare + aOdd + + +EndOfSwitchOdd + Odd + SwitchsCompare + Odd + + +IsEven + a + EndOfSwitchEven + a + + +Loop + DoLoop + EndOfLoop + DoLoop + + +Loop + Index + SwitchEven + a + + +Loop + Index + SwitchOdd + a + + +Loop + Min + EndOfLoop + Min + + +Loop + Max + EndOfLoop + Max + + +EndOfLoop + DoLoop + Loop + DoLoop + + +SwitchEven + Odd + IsEven + Gate + + +SwitchEven + Even + EndOfSwitchEven + Default + + +SwitchEven + a + IsEven + a + + +434 + 382 + +434 + 457 + +EndOfSwitchEven + a + SwitchsCompare + aEven + + +EndOfSwitchEven + Even + SwitchsCompare + Even + + +SwitchsCompare + a + EndOfLoop + Index + + + +GraphLoopSwitchsNOTValid + Loop__Index + Loop + Index + +3 + 0 + + +GraphLoopSwitchsNOTValid + Loop__Min + Loop + Min + +3 + 0 + + +GraphLoopSwitchsNOTValid + Loop__Max + Loop + Max + +3 + 100 + diff --git a/examples/GraphSwitchCheckBranch1NoDefault.py b/examples/GraphSwitchCheckBranch1NoDefault.py new file mode 100644 index 0000000..ad682c6 --- /dev/null +++ b/examples/GraphSwitchCheckBranch1NoDefault.py @@ -0,0 +1,231 @@ + +# Generated python file of Graph GraphSwitchCheckBranch1NoDefault + +from SuperV import * + +# Graph creation of GraphSwitchCheckBranch1NoDefault +def DefGraphSwitchCheckBranch1NoDefault() : + GraphSwitchCheckBranch1NoDefault = Graph( 'GraphSwitchCheckBranch1NoDefault' ) + GraphSwitchCheckBranch1NoDefault.SetName( 'GraphSwitchCheckBranch1NoDefault' ) + GraphSwitchCheckBranch1NoDefault.SetAuthor( 'JR' ) + GraphSwitchCheckBranch1NoDefault.SetComment( 'Switch with two SwitchBranches, One NotSwitchBranch and the DefaultBranch' ) + GraphSwitchCheckBranch1NoDefault.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsOdd = [] + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd(a) : ' ) + PyIsOdd.append( ' print a,"IsOdd (GraphSwitch)" ' ) + PyIsOdd.append( ' sleep( 1 ) ' ) + PyIsOdd.append( ' return a ' ) + IsOdd = GraphSwitchCheckBranch1NoDefault.INode( 'IsOdd' , PyIsOdd ) + IsOdd.SetName( 'IsOdd' ) + IsOdd.SetAuthor( '' ) + IsOdd.SetComment( 'Python function' ) + IsOdd.Coords( 415 , 7 ) + IIsOdda = IsOdd.InPort( 'a' , 'long' ) + IIsOddGate = IsOdd.GetInPort( 'Gate' ) + OIsOdda = IsOdd.OutPort( 'a' , 'long' ) + OIsOddGate = IsOdd.GetOutPort( 'Gate' ) + + PyIsEven = [] + PyIsEven.append( 'from time import * ' ) + PyIsEven.append( 'def IsEven(a) : ' ) + PyIsEven.append( ' print a,"IsEven (GraphSwitch)" ' ) + PyIsEven.append( ' sleep( 1 ) ' ) + PyIsEven.append( ' return a ' ) + IsEven = GraphSwitchCheckBranch1NoDefault.INode( 'IsEven' , PyIsEven ) + IsEven.SetName( 'IsEven' ) + IsEven.SetAuthor( '' ) + IsEven.SetComment( 'Compute Node' ) + IsEven.Coords( 421 , 438 ) + IIsEvena = IsEven.InPort( 'a' , 'long' ) + IIsEvenGate = IsEven.GetInPort( 'Gate' ) + OIsEvena = IsEven.OutPort( 'a' , 'long' ) + OIsEvenGate = IsEven.GetOutPort( 'Gate' ) + + PyBranchNode = [] + PyBranchNode.append( 'from time import * ' ) + PyBranchNode.append( 'def Print_1(Branch) : ' ) + PyBranchNode.append( ' print "Print ",Branch ' ) + PyBranchNode.append( ' sleep(1) ' ) + PyBranchNode.append( ' return Branch ' ) + BranchNode = GraphSwitchCheckBranch1NoDefault.INode( 'Print_1' , PyBranchNode ) + BranchNode.SetName( 'BranchNode' ) + BranchNode.SetAuthor( '' ) + BranchNode.SetComment( 'Compute Node' ) + BranchNode.Coords( 529 , 177 ) + IBranchNodeBranch = BranchNode.InPort( 'Branch' , 'string' ) + IBranchNodeGate = BranchNode.GetInPort( 'Gate' ) + OBranchNodeBranch = BranchNode.OutPort( 'Branch' , 'string' ) + OBranchNodeGate = BranchNode.GetOutPort( 'Gate' ) + + Pydefault = [] + Pydefault.append( 'from time import * ' ) + Pydefault.append( 'def default(a) : ' ) + Pydefault.append( ' sleep(1) ' ) + Pydefault.append( ' return a ' ) + default = GraphSwitchCheckBranch1NoDefault.INode( 'default' , Pydefault ) + default.SetName( 'default' ) + default.SetAuthor( '' ) + default.SetComment( 'Compute Node' ) + default.Coords( 428 , 308 ) + Idefaulta = default.InPort( 'a' , 'long' ) + IdefaultGate = default.GetInPort( 'Gate' ) + Odefaulta = default.OutPort( 'a' , 'long' ) + OdefaultGate = default.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyInitLoopSwitch = [] + PyInitLoopSwitch.append( 'def InitLoop(Index,Min,Max) : ' ) + PyInitLoopSwitch.append( ' Index = Max ' ) + PyInitLoopSwitch.append( ' return Index,Min,Max ' ) + PyMoreInitLoopSwitch = [] + PyMoreInitLoopSwitch.append( 'from time import * ' ) + PyMoreInitLoopSwitch.append( 'def MoreLoop(Index,Min,Max) : ' ) + PyMoreInitLoopSwitch.append( ' sleep(1) ' ) + PyMoreInitLoopSwitch.append( ' if Index >= Min : ' ) + PyMoreInitLoopSwitch.append( ' DoLoop = 1 ' ) + PyMoreInitLoopSwitch.append( ' else : ' ) + PyMoreInitLoopSwitch.append( ' DoLoop = 0 ' ) + PyMoreInitLoopSwitch.append( ' return DoLoop,Index,Min,Max ' ) + PyNextInitLoopSwitch = [] + PyNextInitLoopSwitch.append( 'def NextLoop(Index,Min,Max) : ' ) + PyNextInitLoopSwitch.append( ' Index = Index - 1 ' ) + PyNextInitLoopSwitch.append( ' return Index,Min,Max ' ) + InitLoopSwitch,EndOfInitLoopSwitch = GraphSwitchCheckBranch1NoDefault.LNode( 'InitLoop' , PyInitLoopSwitch , 'MoreLoop' , PyMoreInitLoopSwitch , 'NextLoop' , PyNextInitLoopSwitch ) + EndOfInitLoopSwitch.SetName( 'EndOfInitLoopSwitch' ) + EndOfInitLoopSwitch.SetAuthor( '' ) + EndOfInitLoopSwitch.SetComment( 'Compute Node' ) + EndOfInitLoopSwitch.Coords( 1073 , 216 ) + PyEndOfInitLoopSwitch = [] + PyEndOfInitLoopSwitch.append( 'from time import * ' ) + PyEndOfInitLoopSwitch.append( 'def EndOfInitLoopSwitch(DoLoop,Index,Min,Max) : ' ) + PyEndOfInitLoopSwitch.append( ' sleep(1) ' ) + PyEndOfInitLoopSwitch.append( ' return DoLoop,Index,Min,Max ' ) + EndOfInitLoopSwitch.SetPyFunction( 'EndOfInitLoopSwitch' , PyEndOfInitLoopSwitch ) + IInitLoopSwitchDoLoop = InitLoopSwitch.GetInPort( 'DoLoop' ) + IInitLoopSwitchIndex = InitLoopSwitch.InPort( 'Index' , 'long' ) + IInitLoopSwitchMin = InitLoopSwitch.InPort( 'Min' , 'long' ) + IInitLoopSwitchMax = InitLoopSwitch.InPort( 'Max' , 'long' ) + IInitLoopSwitchGate = InitLoopSwitch.GetInPort( 'Gate' ) + OInitLoopSwitchDoLoop = InitLoopSwitch.GetOutPort( 'DoLoop' ) + OInitLoopSwitchIndex = InitLoopSwitch.GetOutPort( 'Index' ) + OInitLoopSwitchMin = InitLoopSwitch.GetOutPort( 'Min' ) + OInitLoopSwitchMax = InitLoopSwitch.GetOutPort( 'Max' ) + IEndOfInitLoopSwitchDoLoop = EndOfInitLoopSwitch.GetInPort( 'DoLoop' ) + IEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetInPort( 'Index' ) + IEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetInPort( 'Min' ) + IEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetInPort( 'Max' ) + IEndOfInitLoopSwitchGate = EndOfInitLoopSwitch.GetInPort( 'Gate' ) + OEndOfInitLoopSwitchDoLoop = EndOfInitLoopSwitch.GetOutPort( 'DoLoop' ) + OEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetOutPort( 'Index' ) + OEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetOutPort( 'Min' ) + OEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetOutPort( 'Max' ) + OEndOfInitLoopSwitchGate = EndOfInitLoopSwitch.GetOutPort( 'Gate' ) + InitLoopSwitch.SetName( 'InitLoopSwitch' ) + InitLoopSwitch.SetAuthor( '' ) + InitLoopSwitch.SetComment( 'Compute Node' ) + InitLoopSwitch.Coords( 10 , 157 ) + + # Creation of Switch Nodes + PySwitch = [] + PySwitch.append( 'from time import * ' ) + PySwitch.append( 'def Switch(a) : ' ) + PySwitch.append( ' sleep(1) ' ) + PySwitch.append( ' Branch = "Negative or null" ' ) + PySwitch.append( ' if a <= 0 : ' ) + PySwitch.append( ' return 0,0,a,Branch,1 ' ) + PySwitch.append( ' if ( a & 1 ) == 0 : ' ) + PySwitch.append( ' Branch = "Even" ' ) + PySwitch.append( ' else : ' ) + PySwitch.append( ' Branch = "Odd" ' ) + PySwitch.append( ' return a & 1,1-(a&1),a,Branch,0 ' ) + Switch,EndOfSwitch = GraphSwitchCheckBranch1NoDefault.SNode( 'Switch' , PySwitch ) + EndOfSwitch.SetName( 'EndOfSwitch' ) + EndOfSwitch.SetAuthor( '' ) + EndOfSwitch.SetComment( 'Compute Node' ) + EndOfSwitch.Coords( 880 , 216 ) + PyEndOfSwitch = [] + PyEndOfSwitch.append( 'from time import * ' ) + PyEndOfSwitch.append( 'def EndOfSwitch(a,Branch) : ' ) + PyEndOfSwitch.append( ' sleep(1) ' ) + PyEndOfSwitch.append( ' return a ' ) + EndOfSwitch.SetPyFunction( 'EndOfSwitch' , PyEndOfSwitch ) + IEndOfSwitcha = EndOfSwitch.InPort( 'a' , 'long' ) + IEndOfSwitchBranch = EndOfSwitch.InPort( 'Branch' , 'string' ) + IEndOfSwitchDefault = EndOfSwitch.GetInPort( 'Default' ) + OEndOfSwitcha = EndOfSwitch.OutPort( 'a' , 'long' ) + OEndOfSwitchGate = EndOfSwitch.GetOutPort( 'Gate' ) + Switch.SetName( 'Switch' ) + Switch.SetAuthor( '' ) + Switch.SetComment( 'Compute Node' ) + Switch.Coords( 194 , 157 ) + ISwitcha = Switch.InPort( 'a' , 'long' ) + ISwitchGate = Switch.GetInPort( 'Gate' ) + OSwitchOdd = Switch.OutPort( 'Odd' , 'long' ) + OSwitchEven = Switch.OutPort( 'Even' , 'int' ) + OSwitcha = Switch.OutPort( 'a' , 'int' ) + OSwitchBranch = Switch.OutPort( 'Branch' , 'string' ) + OSwitchdefault = Switch.OutPort( 'default' , 'boolean' ) + OSwitchDefault = Switch.GetOutPort( 'Default' ) + + # Creation of Links + LIsOddaEndOfSwitcha = GraphSwitchCheckBranch1NoDefault.Link( OIsOdda , IEndOfSwitcha ) + + LIsEvenaEndOfSwitcha = GraphSwitchCheckBranch1NoDefault.Link( OIsEvena , IEndOfSwitcha ) + + LBranchNodeBranchEndOfSwitchBranch = GraphSwitchCheckBranch1NoDefault.Link( OBranchNodeBranch , IEndOfSwitchBranch ) + + LInitLoopSwitchIndexSwitcha = GraphSwitchCheckBranch1NoDefault.Link( OInitLoopSwitchIndex , ISwitcha ) + + LInitLoopSwitchMinEndOfInitLoopSwitchMin = GraphSwitchCheckBranch1NoDefault.Link( OInitLoopSwitchMin , IEndOfInitLoopSwitchMin ) + + LInitLoopSwitchMaxEndOfInitLoopSwitchMax = GraphSwitchCheckBranch1NoDefault.Link( OInitLoopSwitchMax , IEndOfInitLoopSwitchMax ) + + LSwitchOddIsOddGate = GraphSwitchCheckBranch1NoDefault.Link( OSwitchOdd , IIsOddGate ) + LSwitchOddIsOddGate.AddCoord( 1 , 401 , 101 ) + LSwitchOddIsOddGate.AddCoord( 2 , 401 , 188 ) + + LSwitchEvenIsEvenGate = GraphSwitchCheckBranch1NoDefault.Link( OSwitchEven , IIsEvenGate ) + LSwitchEvenIsEvenGate.AddCoord( 1 , 392 , 533 ) + LSwitchEvenIsEvenGate.AddCoord( 2 , 392 , 208 ) + + LSwitchaIsOdda = GraphSwitchCheckBranch1NoDefault.Link( OSwitcha , IIsOdda ) + LSwitchaIsOdda.AddCoord( 1 , 382 , 78 ) + LSwitchaIsOdda.AddCoord( 2 , 382 , 229 ) + + LSwitchaIsEvena = GraphSwitchCheckBranch1NoDefault.Link( OSwitcha , IIsEvena ) + LSwitchaIsEvena.AddCoord( 1 , 381 , 509 ) + LSwitchaIsEvena.AddCoord( 2 , 381 , 229 ) + + LSwitchadefaulta = GraphSwitchCheckBranch1NoDefault.Link( OSwitcha , Idefaulta ) + LSwitchadefaulta.AddCoord( 1 , 382 , 377 ) + LSwitchadefaulta.AddCoord( 2 , 382 , 228 ) + + LSwitchBranchBranchNodeBranch = GraphSwitchCheckBranch1NoDefault.Link( OSwitchBranch , IBranchNodeBranch ) + + LSwitchdefaultdefaultGate = GraphSwitchCheckBranch1NoDefault.Link( OSwitchdefault , IdefaultGate ) + LSwitchdefaultdefaultGate.AddCoord( 1 , 410 , 403 ) + LSwitchdefaultdefaultGate.AddCoord( 2 , 410 , 269 ) + LSwitchdefaultdefaultGate.AddCoord( 3 , 410 , 268 ) + + LEndOfSwitchaEndOfInitLoopSwitchIndex = GraphSwitchCheckBranch1NoDefault.Link( OEndOfSwitcha , IEndOfInitLoopSwitchIndex ) + + LdefaultaEndOfSwitcha = GraphSwitchCheckBranch1NoDefault.Link( Odefaulta , IEndOfSwitcha ) + + # Input datas + IInitLoopSwitchIndex.Input( 0 ) + IInitLoopSwitchMin.Input( -5 ) + IInitLoopSwitchMax.Input( 10 ) + + # Output Ports of the graph + #OEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetOutPort( 'Index' ) + #OEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetOutPort( 'Min' ) + #OEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetOutPort( 'Max' ) + return GraphSwitchCheckBranch1NoDefault + + +GraphSwitchCheckBranch1NoDefault = DefGraphSwitchCheckBranch1NoDefault() diff --git a/examples/GraphSwitchCheckBranch1NoDefault.xml b/examples/GraphSwitchCheckBranch1NoDefault.xml new file mode 100644 index 0000000..dbc5326 --- /dev/null +++ b/examples/GraphSwitchCheckBranch1NoDefault.xml @@ -0,0 +1,532 @@ + + + + + +? + ? + GraphSwitchCheckBranch1NoDefault + 1 + ? + +GraphSwitchCheckBranch1 + + +long + InitLoopSwitch__Index + +long + InitLoopSwitch__Min + +long + InitLoopSwitch__Max + + +long + EndOfInitLoopSwitch__Index + +long + EndOfInitLoopSwitch__Min + +long + EndOfInitLoopSwitch__Max + + + 13/1/2005 - 11:48:50 + 14/2/2005 - 11:39:30 + 2.0 + JR + ? + Switch with two SwitchBranches, One NotSwitchBranch and the DefaultBranch + 0 + 0 + + +? + ? + IsOdd + 3 + ? + +IsOdd + + +long + a + + +long + a + + + +IsOdd + + + + + + 14/2/2005 - 11:36:28 + 14/2/2005 - 11:36:28 + 2.0 + ? + ? + Python function + 415 + 7 + +? + ? + IsEven + 3 + ? + +IsEven + + +long + a + + +long + a + + + +IsEven + + + + + + 14/2/2005 - 11:36:28 + 14/2/2005 - 11:36:28 + 2.0 + ? + ? + Compute Node + 421 + 438 + +? + ? + BranchNode + 3 + ? + +BranchNode + + +string + Branch + + +string + Branch + + + +Print_1 + + + + + + 14/2/2005 - 11:36:28 + 14/2/2005 - 11:36:28 + 2.0 + ? + ? + Compute Node + 529 + 177 + +? + ? + InitLoopSwitch + 4 + EndOfInitLoopSwitch + +InitLoopSwitch + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +InitLoop + + + + +MoreLoop + + + + = Min : ]]> + + + + + +NextLoop + + + + 14/2/2005 - 11:36:28 + 14/2/2005 - 11:36:28 + 2.0 + ? + ? + Compute Node + 10 + 157 + +? + ? + EndOfInitLoopSwitch + 5 + InitLoopSwitch + +EndOfInitLoopSwitch + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +EndOfInitLoopSwitch + + + + + 14/2/2005 - 11:36:28 + 14/2/2005 - 11:36:28 + 2.0 + ? + ? + Compute Node + 1073 + 216 + +? + ? + Switch + 6 + EndOfSwitch + +Switch + + +long + a + + +long + Odd + +int + Even + +int + a + +string + Branch + +boolean + default + + + +Switch + + + + + + + + + + + + 14/2/2005 - 11:36:28 + 14/2/2005 - 11:36:28 + 2.0 + ? + ? + Compute Node + 194 + 157 + +? + ? + EndOfSwitch + 7 + Switch + +EndOfSwitch + + +long + a + +string + Branch + + +long + a + + + +EndOfSwitch + + + + + 14/2/2005 - 11:36:28 + 14/2/2005 - 11:36:28 + 2.0 + ? + ? + Compute Node + 880 + 216 + +? + ? + default + 3 + ? + +default + + +long + a + + +long + a + + + +default + + + + + 14/2/2005 - 11:36:28 + 14/2/2005 - 11:36:28 + 2.0 + ? + ? + Compute Node + 428 + 308 + + +IsOdd + a + EndOfSwitch + a + + +IsEven + a + EndOfSwitch + a + + +BranchNode + Branch + EndOfSwitch + Branch + + +InitLoopSwitch + DoLoop + EndOfInitLoopSwitch + DoLoop + + +InitLoopSwitch + Index + Switch + a + + +InitLoopSwitch + Min + EndOfInitLoopSwitch + Min + + +InitLoopSwitch + Max + EndOfInitLoopSwitch + Max + + +EndOfInitLoopSwitch + DoLoop + InitLoopSwitch + DoLoop + + +Switch + Odd + IsOdd + Gate + + +401 + 101 + +401 + 188 + +Switch + Even + IsEven + Gate + + +392 + 533 + +392 + 208 + +Switch + a + IsOdd + a + + +382 + 78 + +382 + 229 + +Switch + a + IsEven + a + + +381 + 509 + +381 + 229 + +Switch + a + default + a + + +382 + 377 + +382 + 228 + +Switch + Branch + BranchNode + Branch + + +Switch + default + default + Gate + + +410 + 403 + +410 + 269 + +410 + 268 + +EndOfSwitch + a + EndOfInitLoopSwitch + Index + + +default + a + EndOfSwitch + a + + + +GraphSwitchCheckBranch1NoDefault + InitLoopSwitch__Index + InitLoopSwitch + Index + +3 + 0 + + +GraphSwitchCheckBranch1NoDefault + InitLoopSwitch__Min + InitLoopSwitch + Min + +3 + -5 + + +GraphSwitchCheckBranch1NoDefault + InitLoopSwitch__Max + InitLoopSwitch + Max + +3 + 10 + diff --git a/examples/GraphSwitchCheckBranch2NOTValid.py b/examples/GraphSwitchCheckBranch2NOTValid.py new file mode 100644 index 0000000..ee9fb64 --- /dev/null +++ b/examples/GraphSwitchCheckBranch2NOTValid.py @@ -0,0 +1,237 @@ + +# Generated python file of Graph GraphSwitchCheckBranch2NOTValid + +from SuperV import * + +# Graph creation of GraphSwitchCheckBranch2NOTValid +def DefGraphSwitchCheckBranch2NOTValid() : + GraphSwitchCheckBranch2NOTValid = Graph( 'GraphSwitchCheckBranch2NOTValid' ) + GraphSwitchCheckBranch2NOTValid.SetName( 'GraphSwitchCheckBranch2NOTValid' ) + GraphSwitchCheckBranch2NOTValid.SetAuthor( 'JR' ) + GraphSwitchCheckBranch2NOTValid.SetComment( 'Switch with two SwitchBranches, One NotSwitchBranch and the DefaultBranch +Shared Node between Branches' ) + GraphSwitchCheckBranch2NOTValid.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsOdd = [] + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd(aBranch) : ' ) + PyIsOdd.append( ' print a,"IsOdd (GraphSwitch)" ' ) + PyIsOdd.append( ' sleep( 1 ) ' ) + PyIsOdd.append( ' return a ' ) + IsOdd = GraphSwitchCheckBranch2NOTValid.INode( 'IsOdd' , PyIsOdd ) + IsOdd.SetName( 'IsOdd' ) + IsOdd.SetAuthor( '' ) + IsOdd.SetComment( 'Python function' ) + IsOdd.Coords( 649 , 6 ) + IIsOdda = IsOdd.InPort( 'a' , 'long' ) + IIsOddBranch = IsOdd.InPort( 'Branch' , 'string' ) + IIsOddGate = IsOdd.GetInPort( 'Gate' ) + OIsOdda = IsOdd.OutPort( 'a' , 'long' ) + OIsOddGate = IsOdd.GetOutPort( 'Gate' ) + + PyIsEven = [] + PyIsEven.append( 'from time import * ' ) + PyIsEven.append( 'def IsEven(aBranch) : ' ) + PyIsEven.append( ' print a,"IsEven (GraphSwitch)" ' ) + PyIsEven.append( ' sleep( 1 ) ' ) + PyIsEven.append( ' return a ' ) + IsEven = GraphSwitchCheckBranch2NOTValid.INode( 'IsEven' , PyIsEven ) + IsEven.SetName( 'IsEven' ) + IsEven.SetAuthor( '' ) + IsEven.SetComment( 'Compute Node' ) + IsEven.Coords( 657 , 451 ) + IIsEvena = IsEven.InPort( 'a' , 'long' ) + IIsEvenBranch = IsEven.InPort( 'Branch' , 'string' ) + IIsEvenGate = IsEven.GetInPort( 'Gate' ) + OIsEvena = IsEven.OutPort( 'a' , 'long' ) + OIsEvenGate = IsEven.GetOutPort( 'Gate' ) + + PyBranchNode = [] + PyBranchNode.append( 'from time import * ' ) + PyBranchNode.append( 'def Print_1(Branch) : ' ) + PyBranchNode.append( ' print "Print ",Branch ' ) + PyBranchNode.append( ' sleep(1) ' ) + PyBranchNode.append( ' return Branch ' ) + BranchNode = GraphSwitchCheckBranch2NOTValid.INode( 'Print_1' , PyBranchNode ) + BranchNode.SetName( 'BranchNode' ) + BranchNode.SetAuthor( '' ) + BranchNode.SetComment( 'Compute Node' ) + BranchNode.Coords( 429 , 177 ) + IBranchNodeBranch = BranchNode.InPort( 'Branch' , 'string' ) + IBranchNodeGate = BranchNode.GetInPort( 'Gate' ) + OBranchNodeBranch = BranchNode.OutPort( 'Branch' , 'string' ) + OBranchNodeGate = BranchNode.GetOutPort( 'Gate' ) + + Pydefault = [] + Pydefault.append( 'from time import * ' ) + Pydefault.append( 'def default(a,Branch) : ' ) + Pydefault.append( ' sleep(1) ' ) + Pydefault.append( ' return a ' ) + default = GraphSwitchCheckBranch2NOTValid.INode( 'default' , Pydefault ) + default.SetName( 'default' ) + default.SetAuthor( '' ) + default.SetComment( 'Compute Node' ) + default.Coords( 655 , 306 ) + Idefaulta = default.InPort( 'a' , 'long' ) + IdefaultBranch = default.InPort( 'Branch' , 'string' ) + IdefaultGate = default.GetInPort( 'Gate' ) + Odefaulta = default.OutPort( 'a' , 'long' ) + OdefaultGate = default.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyInitLoopSwitch = [] + PyInitLoopSwitch.append( 'def InitLoop(Index,Min,Max) : ' ) + PyInitLoopSwitch.append( ' Index = Max ' ) + PyInitLoopSwitch.append( ' return Index,Min,Max ' ) + PyMoreInitLoopSwitch = [] + PyMoreInitLoopSwitch.append( 'from time import * ' ) + PyMoreInitLoopSwitch.append( 'def MoreLoop(Index,Min,Max) : ' ) + PyMoreInitLoopSwitch.append( ' sleep(1) ' ) + PyMoreInitLoopSwitch.append( ' if Index >= Min : ' ) + PyMoreInitLoopSwitch.append( ' DoLoop = 1 ' ) + PyMoreInitLoopSwitch.append( ' else : ' ) + PyMoreInitLoopSwitch.append( ' DoLoop = 0 ' ) + PyMoreInitLoopSwitch.append( ' return DoLoop,Index,Min,Max ' ) + PyNextInitLoopSwitch = [] + PyNextInitLoopSwitch.append( 'def NextLoop(Index,Min,Max) : ' ) + PyNextInitLoopSwitch.append( ' Index = Index - 1 ' ) + PyNextInitLoopSwitch.append( ' return Index,Min,Max ' ) + InitLoopSwitch,EndOfInitLoopSwitch = GraphSwitchCheckBranch2NOTValid.LNode( 'InitLoop' , PyInitLoopSwitch , 'MoreLoop' , PyMoreInitLoopSwitch , 'NextLoop' , PyNextInitLoopSwitch ) + EndOfInitLoopSwitch.SetName( 'EndOfInitLoopSwitch' ) + EndOfInitLoopSwitch.SetAuthor( '' ) + EndOfInitLoopSwitch.SetComment( 'Compute Node' ) + EndOfInitLoopSwitch.Coords( 1073 , 216 ) + PyEndOfInitLoopSwitch = [] + PyEndOfInitLoopSwitch.append( 'from time import * ' ) + PyEndOfInitLoopSwitch.append( 'def EndOfInitLoopSwitch(DoLoop,Index,Min,Max) : ' ) + PyEndOfInitLoopSwitch.append( ' sleep(1) ' ) + PyEndOfInitLoopSwitch.append( ' return DoLoop,Index,Min,Max ' ) + EndOfInitLoopSwitch.SetPyFunction( 'EndOfInitLoopSwitch' , PyEndOfInitLoopSwitch ) + IInitLoopSwitchDoLoop = InitLoopSwitch.GetInPort( 'DoLoop' ) + IInitLoopSwitchIndex = InitLoopSwitch.InPort( 'Index' , 'long' ) + IInitLoopSwitchMin = InitLoopSwitch.InPort( 'Min' , 'long' ) + IInitLoopSwitchMax = InitLoopSwitch.InPort( 'Max' , 'long' ) + IInitLoopSwitchGate = InitLoopSwitch.GetInPort( 'Gate' ) + OInitLoopSwitchDoLoop = InitLoopSwitch.GetOutPort( 'DoLoop' ) + OInitLoopSwitchIndex = InitLoopSwitch.GetOutPort( 'Index' ) + OInitLoopSwitchMin = InitLoopSwitch.GetOutPort( 'Min' ) + OInitLoopSwitchMax = InitLoopSwitch.GetOutPort( 'Max' ) + IEndOfInitLoopSwitchDoLoop = EndOfInitLoopSwitch.GetInPort( 'DoLoop' ) + IEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetInPort( 'Index' ) + IEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetInPort( 'Min' ) + IEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetInPort( 'Max' ) + IEndOfInitLoopSwitchGate = EndOfInitLoopSwitch.GetInPort( 'Gate' ) + OEndOfInitLoopSwitchDoLoop = EndOfInitLoopSwitch.GetOutPort( 'DoLoop' ) + OEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetOutPort( 'Index' ) + OEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetOutPort( 'Min' ) + OEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetOutPort( 'Max' ) + OEndOfInitLoopSwitchGate = EndOfInitLoopSwitch.GetOutPort( 'Gate' ) + InitLoopSwitch.SetName( 'InitLoopSwitch' ) + InitLoopSwitch.SetAuthor( '' ) + InitLoopSwitch.SetComment( 'Compute Node' ) + InitLoopSwitch.Coords( 10 , 157 ) + + # Creation of Switch Nodes + PySwitch = [] + PySwitch.append( 'from time import * ' ) + PySwitch.append( 'def Switch(a) : ' ) + PySwitch.append( ' sleep(1) ' ) + PySwitch.append( ' Branch = "Negative or null" ' ) + PySwitch.append( ' if a <= 0 : ' ) + PySwitch.append( ' return 0,0,a,Branch,1 ' ) + PySwitch.append( ' if ( a & 1 ) == 0 : ' ) + PySwitch.append( ' Branch = "Even" ' ) + PySwitch.append( ' else : ' ) + PySwitch.append( ' Branch = "Odd" ' ) + PySwitch.append( ' return a & 1,1-(a&1),a,Branch,0 ' ) + Switch,EndOfSwitch = GraphSwitchCheckBranch2NOTValid.SNode( 'Switch' , PySwitch ) + EndOfSwitch.SetName( 'EndOfSwitch' ) + EndOfSwitch.SetAuthor( '' ) + EndOfSwitch.SetComment( 'Compute Node' ) + EndOfSwitch.Coords( 880 , 216 ) + PyEndOfSwitch = [] + PyEndOfSwitch.append( 'from time import * ' ) + PyEndOfSwitch.append( 'def EndOfSwitch(a,Branch) : ' ) + PyEndOfSwitch.append( ' sleep(1) ' ) + PyEndOfSwitch.append( ' return a ' ) + EndOfSwitch.SetPyFunction( 'EndOfSwitch' , PyEndOfSwitch ) + IEndOfSwitcha = EndOfSwitch.InPort( 'a' , 'long' ) + IEndOfSwitchBranch = EndOfSwitch.InPort( 'Branch' , 'string' ) + IEndOfSwitchDefault = EndOfSwitch.GetInPort( 'Default' ) + OEndOfSwitcha = EndOfSwitch.OutPort( 'a' , 'long' ) + OEndOfSwitchGate = EndOfSwitch.GetOutPort( 'Gate' ) + Switch.SetName( 'Switch' ) + Switch.SetAuthor( '' ) + Switch.SetComment( 'Compute Node' ) + Switch.Coords( 194 , 157 ) + ISwitcha = Switch.InPort( 'a' , 'long' ) + ISwitchGate = Switch.GetInPort( 'Gate' ) + OSwitchOdd = Switch.OutPort( 'Odd' , 'long' ) + OSwitchEven = Switch.OutPort( 'Even' , 'int' ) + OSwitcha = Switch.OutPort( 'a' , 'int' ) + OSwitchBranch = Switch.OutPort( 'Branch' , 'string' ) + OSwitchdefault = Switch.OutPort( 'default' , 'boolean' ) + OSwitchDefault = Switch.GetOutPort( 'Default' ) + + # Creation of Links + LIsOddaEndOfSwitcha = GraphSwitchCheckBranch2NOTValid.Link( OIsOdda , IEndOfSwitcha ) + + LIsEvenaEndOfSwitcha = GraphSwitchCheckBranch2NOTValid.Link( OIsEvena , IEndOfSwitcha ) + + LBranchNodeBranchEndOfSwitchBranch = GraphSwitchCheckBranch2NOTValid.Link( OBranchNodeBranch , IEndOfSwitchBranch ) + + LBranchNodeBranchIsOddBranch = GraphSwitchCheckBranch2NOTValid.Link( OBranchNodeBranch , IIsOddBranch ) + + LBranchNodeBranchdefaultBranch = GraphSwitchCheckBranch2NOTValid.Link( OBranchNodeBranch , IdefaultBranch ) + + LBranchNodeBranchIsEvenBranch = GraphSwitchCheckBranch2NOTValid.Link( OBranchNodeBranch , IIsEvenBranch ) + + LInitLoopSwitchIndexSwitcha = GraphSwitchCheckBranch2NOTValid.Link( OInitLoopSwitchIndex , ISwitcha ) + + LInitLoopSwitchMinEndOfInitLoopSwitchMin = GraphSwitchCheckBranch2NOTValid.Link( OInitLoopSwitchMin , IEndOfInitLoopSwitchMin ) + + LInitLoopSwitchMaxEndOfInitLoopSwitchMax = GraphSwitchCheckBranch2NOTValid.Link( OInitLoopSwitchMax , IEndOfInitLoopSwitchMax ) + + LSwitchOddIsOddGate = GraphSwitchCheckBranch2NOTValid.Link( OSwitchOdd , IIsOddGate ) + LSwitchOddIsOddGate.AddCoord( 1 , 400 , 121 ) + LSwitchOddIsOddGate.AddCoord( 2 , 401 , 188 ) + + LSwitchEvenIsEvenGate = GraphSwitchCheckBranch2NOTValid.Link( OSwitchEven , IIsEvenGate ) + LSwitchEvenIsEvenGate.AddCoord( 1 , 391 , 568 ) + LSwitchEvenIsEvenGate.AddCoord( 2 , 392 , 208 ) + + LSwitchadefaulta = GraphSwitchCheckBranch2NOTValid.Link( OSwitcha , Idefaulta ) + + LSwitchaIsEvena = GraphSwitchCheckBranch2NOTValid.Link( OSwitcha , IIsEvena ) + + LSwitchaIsOdda = GraphSwitchCheckBranch2NOTValid.Link( OSwitcha , IIsOdda ) + + LSwitchBranchBranchNodeBranch = GraphSwitchCheckBranch2NOTValid.Link( OSwitchBranch , IBranchNodeBranch ) + + LSwitchdefaultdefaultGate = GraphSwitchCheckBranch2NOTValid.Link( OSwitchdefault , IdefaultGate ) + LSwitchdefaultdefaultGate.AddCoord( 1 , 410 , 422 ) + LSwitchdefaultdefaultGate.AddCoord( 2 , 410 , 269 ) + LSwitchdefaultdefaultGate.AddCoord( 3 , 410 , 268 ) + + LSwitchDefaultEndOfSwitchDefault = GraphSwitchCheckBranch2NOTValid.Link( OSwitchDefault , IEndOfSwitchDefault ) + + LEndOfSwitchaEndOfInitLoopSwitchIndex = GraphSwitchCheckBranch2NOTValid.Link( OEndOfSwitcha , IEndOfInitLoopSwitchIndex ) + + LdefaultaEndOfSwitcha = GraphSwitchCheckBranch2NOTValid.Link( Odefaulta , IEndOfSwitcha ) + + # Input datas + IInitLoopSwitchIndex.Input( 0 ) + IInitLoopSwitchMin.Input( -5 ) + IInitLoopSwitchMax.Input( 10 ) + + # Output Ports of the graph + #OEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetOutPort( 'Index' ) + #OEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetOutPort( 'Min' ) + #OEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetOutPort( 'Max' ) + return GraphSwitchCheckBranch2NOTValid + + +GraphSwitchCheckBranch2NOTValid = DefGraphSwitchCheckBranch2NOTValid() diff --git a/examples/GraphSwitchCheckBranch2NOTValid.xml b/examples/GraphSwitchCheckBranch2NOTValid.xml new file mode 100644 index 0000000..0833676 --- /dev/null +++ b/examples/GraphSwitchCheckBranch2NOTValid.xml @@ -0,0 +1,548 @@ + + + + + +? + ? + GraphSwitchCheckBranch2NOTValid + 1 + ? + +GraphSwitchCheckBranch2NOTValid + + +long + InitLoopSwitch__Index + +long + InitLoopSwitch__Min + +long + InitLoopSwitch__Max + + +long + EndOfInitLoopSwitch__Index + +long + EndOfInitLoopSwitch__Min + +long + EndOfInitLoopSwitch__Max + + + 13/1/2005 - 11:48:50 + 15/2/2005 - 11:47:4 + 2.0 + JR + ? + Switch with two SwitchBranches, One NotSwitchBranch and the DefaultBranch +Shared Node between Branches + 0 + 0 + + +? + ? + IsOdd + 3 + ? + +IsOdd + + +long + a + +string + Branch + + +long + a + + + +IsOdd + + + + + + 15/2/2005 - 11:42:57 + 15/2/2005 - 11:42:57 + 2.0 + ? + ? + Python function + 649 + 6 + +? + ? + IsEven + 3 + ? + +IsEven + + +long + a + +string + Branch + + +long + a + + + +IsEven + + + + + + 15/2/2005 - 11:42:57 + 15/2/2005 - 11:42:57 + 2.0 + ? + ? + Compute Node + 657 + 451 + +? + ? + BranchNode + 3 + ? + +BranchNode + + +string + Branch + + +string + Branch + + + +Print_1 + + + + + + 15/2/2005 - 11:42:57 + 15/2/2005 - 11:42:57 + 2.0 + ? + ? + Compute Node + 429 + 177 + +? + ? + InitLoopSwitch + 4 + EndOfInitLoopSwitch + +InitLoopSwitch + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +InitLoop + + + + +MoreLoop + + + + = Min : ]]> + + + + + +NextLoop + + + + 15/2/2005 - 11:42:57 + 15/2/2005 - 11:42:57 + 2.0 + ? + ? + Compute Node + 10 + 157 + +? + ? + EndOfInitLoopSwitch + 5 + InitLoopSwitch + +EndOfInitLoopSwitch + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +EndOfInitLoopSwitch + + + + + 15/2/2005 - 11:42:57 + 15/2/2005 - 11:42:57 + 2.0 + ? + ? + Compute Node + 1073 + 216 + +? + ? + Switch + 6 + EndOfSwitch + +Switch + + +long + a + + +long + Odd + +int + Even + +int + a + +string + Branch + +boolean + default + + + +Switch + + + + + + + + + + + + 15/2/2005 - 11:42:57 + 15/2/2005 - 11:42:57 + 2.0 + ? + ? + Compute Node + 194 + 157 + +? + ? + EndOfSwitch + 7 + Switch + +EndOfSwitch + + +long + a + +string + Branch + + +long + a + + + +EndOfSwitch + + + + + 15/2/2005 - 11:42:57 + 15/2/2005 - 11:42:57 + 2.0 + ? + ? + Compute Node + 880 + 216 + +? + ? + default + 3 + ? + +default + + +long + a + +string + Branch + + +long + a + + + +default + + + + + 15/2/2005 - 11:42:57 + 15/2/2005 - 11:42:57 + 2.0 + ? + ? + Compute Node + 655 + 306 + + +IsOdd + a + EndOfSwitch + a + + +IsEven + a + EndOfSwitch + a + + +BranchNode + Branch + EndOfSwitch + Branch + + +BranchNode + Branch + IsOdd + Branch + + +BranchNode + Branch + default + Branch + + +BranchNode + Branch + IsEven + Branch + + +InitLoopSwitch + DoLoop + EndOfInitLoopSwitch + DoLoop + + +InitLoopSwitch + Index + Switch + a + + +InitLoopSwitch + Min + EndOfInitLoopSwitch + Min + + +InitLoopSwitch + Max + EndOfInitLoopSwitch + Max + + +EndOfInitLoopSwitch + DoLoop + InitLoopSwitch + DoLoop + + +Switch + Odd + IsOdd + Gate + + +400 + 121 + +401 + 188 + +Switch + Even + IsEven + Gate + + +391 + 568 + +392 + 208 + +Switch + a + default + a + + +Switch + a + IsEven + a + + +Switch + a + IsOdd + a + + +Switch + Branch + BranchNode + Branch + + +Switch + default + default + Gate + + +410 + 422 + +410 + 269 + +410 + 268 + +Switch + Default + EndOfSwitch + Default + + +EndOfSwitch + a + EndOfInitLoopSwitch + Index + + +default + a + EndOfSwitch + a + + + +GraphSwitchCheckBranch2NOTValid + InitLoopSwitch__Index + InitLoopSwitch + Index + +3 + 0 + + +GraphSwitchCheckBranch2NOTValid + InitLoopSwitch__Min + InitLoopSwitch + Min + +3 + -5 + + +GraphSwitchCheckBranch2NOTValid + InitLoopSwitch__Max + InitLoopSwitch + Max + +3 + 10 + diff --git a/examples/GraphSwitchCheckNoDefault2.py b/examples/GraphSwitchCheckNoDefault2.py new file mode 100644 index 0000000..55ee62f --- /dev/null +++ b/examples/GraphSwitchCheckNoDefault2.py @@ -0,0 +1,332 @@ + +# Generated python file of Graph GraphSwitchCheckNoDefault2 + +from SuperV import * + +# Graph creation of GraphSwitchCheckNoDefault2 +def DefGraphSwitchCheckNoDefault2() : + GraphSwitchCheckNoDefault2 = Graph( 'GraphSwitchCheckNoDefault2' ) + GraphSwitchCheckNoDefault2.SetName( 'GraphSwitchCheckNoDefault2' ) + GraphSwitchCheckNoDefault2.SetAuthor( 'JR' ) + GraphSwitchCheckNoDefault2.SetComment( '' ) + GraphSwitchCheckNoDefault2.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsOdd = [] + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd(a) : ' ) + PyIsOdd.append( ' print a,"IsOdd (GraphSwitch)" ' ) + PyIsOdd.append( ' sleep( 1 ) ' ) + PyIsOdd.append( ' return a ' ) + IsOdd = GraphSwitchCheckNoDefault2.INode( 'IsOdd' , PyIsOdd ) + IsOdd.SetName( 'IsOdd' ) + IsOdd.SetAuthor( '' ) + IsOdd.SetComment( 'Python function' ) + IsOdd.Coords( 415 , 7 ) + IIsOdda = IsOdd.InPort( 'a' , 'long' ) + IIsOddGate = IsOdd.GetInPort( 'Gate' ) + OIsOdda = IsOdd.OutPort( 'a' , 'long' ) + OIsOddGate = IsOdd.GetOutPort( 'Gate' ) + + PyIsEven = [] + PyIsEven.append( 'from time import * ' ) + PyIsEven.append( 'def IsEven(a) : ' ) + PyIsEven.append( ' print a,"IsEven (GraphSwitch)" ' ) + PyIsEven.append( ' sleep( 1 ) ' ) + PyIsEven.append( ' return a ' ) + IsEven = GraphSwitchCheckNoDefault2.INode( 'IsEven' , PyIsEven ) + IsEven.SetName( 'IsEven' ) + IsEven.SetAuthor( '' ) + IsEven.SetComment( 'Compute Node' ) + IsEven.Coords( 421 , 438 ) + IIsEvena = IsEven.InPort( 'a' , 'long' ) + IIsEvenGate = IsEven.GetInPort( 'Gate' ) + OIsEvena = IsEven.OutPort( 'a' , 'long' ) + OIsEvenGate = IsEven.GetOutPort( 'Gate' ) + + PyPrintOdd = [] + PyPrintOdd.append( 'from time import * ' ) + PyPrintOdd.append( 'def Print(a,Branch) : ' ) + PyPrintOdd.append( ' print "Print ",a,Branch ' ) + PyPrintOdd.append( ' sleep(1) ' ) + PyPrintOdd.append( ' return Branch ' ) + PrintOdd = GraphSwitchCheckNoDefault2.INode( 'Print' , PyPrintOdd ) + PrintOdd.SetName( 'PrintOdd' ) + PrintOdd.SetAuthor( '' ) + PrintOdd.SetComment( 'Compute Node' ) + PrintOdd.Coords( 415 , 130 ) + IPrintOdda = PrintOdd.InPort( 'a' , 'long' ) + IPrintOddBranch = PrintOdd.InPort( 'Branch' , 'string' ) + IPrintOddGate = PrintOdd.GetInPort( 'Gate' ) + OPrintOddBranch = PrintOdd.OutPort( 'Branch' , 'string' ) + OPrintOddGate = PrintOdd.GetOutPort( 'Gate' ) + + PyPrintEven = [] + PyPrintEven.append( 'from time import * ' ) + PyPrintEven.append( 'def Print_1(a,Branch) : ' ) + PyPrintEven.append( ' print "Print ",a,Branch ' ) + PyPrintEven.append( ' sleep(1) ' ) + PyPrintEven.append( ' return Branch ' ) + PrintEven = GraphSwitchCheckNoDefault2.INode( 'Print_1' , PyPrintEven ) + PrintEven.SetName( 'PrintEven' ) + PrintEven.SetAuthor( '' ) + PrintEven.SetComment( 'Compute Node' ) + PrintEven.Coords( 423 , 289 ) + IPrintEvena = PrintEven.InPort( 'a' , 'long' ) + IPrintEvenBranch = PrintEven.InPort( 'Branch' , 'string' ) + IPrintEvenGate = PrintEven.GetInPort( 'Gate' ) + OPrintEvenBranch = PrintEven.OutPort( 'Branch' , 'string' ) + OPrintEvenGate = PrintEven.GetOutPort( 'Gate' ) + + PyEmptyNode = [] + PyEmptyNode.append( 'from time import * ' ) + PyEmptyNode.append( 'def EmptyNode(a,Branch) : ' ) + PyEmptyNode.append( ' sleep(1) ' ) + PyEmptyNode.append( ' return a,Branch ' ) + EmptyNode = GraphSwitchCheckNoDefault2.INode( 'EmptyNode' , PyEmptyNode ) + EmptyNode.SetName( 'EmptyNode' ) + EmptyNode.SetAuthor( '' ) + EmptyNode.SetComment( 'Compute Node' ) + EmptyNode.Coords( 652 , 110 ) + IEmptyNodea = EmptyNode.InPort( 'a' , 'long' ) + IEmptyNodeBranch = EmptyNode.InPort( 'Branch' , 'string' ) + IEmptyNodeGate = EmptyNode.GetInPort( 'Gate' ) + OEmptyNodea = EmptyNode.OutPort( 'a' , 'long' ) + OEmptyNodeBranch = EmptyNode.OutPort( 'Branch' , 'string' ) + OEmptyNodeGate = EmptyNode.GetOutPort( 'Gate' ) + + PyDefault = [] + PyDefault.append( 'from time import * ' ) + PyDefault.append( 'def Default(a,Branch) : ' ) + PyDefault.append( ' sleep(1) ' ) + PyDefault.append( ' return a,Branch ' ) + Default = GraphSwitchCheckNoDefault2.INode( 'Default' , PyDefault ) + Default.SetName( 'Default' ) + Default.SetAuthor( '' ) + Default.SetComment( 'Compute Node' ) + Default.Coords( 421 , 592 ) + IDefaulta = Default.InPort( 'a' , 'long' ) + IDefaultBranch = Default.InPort( 'Branch' , 'string' ) + IDefaultGate = Default.GetInPort( 'Gate' ) + ODefaulta = Default.OutPort( 'a' , 'long' ) + ODefaultBranch = Default.OutPort( 'Branch' , 'string' ) + ODefaultGate = Default.GetOutPort( 'Gate' ) + + PyPuta = [] + PyPuta.append( 'from time import * ' ) + PyPuta.append( 'def Puta(a) : ' ) + PyPuta.append( ' sleep(1) ' ) + PyPuta.append( ' return a ' ) + Puta = GraphSwitchCheckNoDefault2.INode( 'Puta' , PyPuta ) + Puta.SetName( 'Puta' ) + Puta.SetAuthor( '' ) + Puta.SetComment( 'Compute Node' ) + Puta.Coords( 665 , 486 ) + IPutaa = Puta.InPort( 'a' , 'long' ) + IPutaGate = Puta.GetInPort( 'Gate' ) + OPutaa = Puta.OutPort( 'a' , 'long' ) + OPutaGate = Puta.GetOutPort( 'Gate' ) + + PyPutBranch = [] + PyPutBranch.append( 'from time import * ' ) + PyPutBranch.append( 'def PutBranch(Branch) : ' ) + PyPutBranch.append( ' sleep(1) ' ) + PyPutBranch.append( ' return Branch ' ) + PutBranch = GraphSwitchCheckNoDefault2.INode( 'PutBranch' , PyPutBranch ) + PutBranch.SetName( 'PutBranch' ) + PutBranch.SetAuthor( '' ) + PutBranch.SetComment( 'Compute Node' ) + PutBranch.Coords( 662 , 613 ) + IPutBranchBranch = PutBranch.InPort( 'Branch' , 'string' ) + IPutBranchGate = PutBranch.GetInPort( 'Gate' ) + OPutBranchBranch = PutBranch.OutPort( 'Branch' , 'string' ) + OPutBranchGate = PutBranch.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyInitLoopSwitch = [] + PyInitLoopSwitch.append( 'def InitLoop(Index,Min,Max) : ' ) + PyInitLoopSwitch.append( ' Index = Max ' ) + PyInitLoopSwitch.append( ' return Index,Min,Max ' ) + PyMoreInitLoopSwitch = [] + PyMoreInitLoopSwitch.append( 'from time import * ' ) + PyMoreInitLoopSwitch.append( 'def MoreLoop(Index,Min,Max) : ' ) + PyMoreInitLoopSwitch.append( ' sleep(1) ' ) + PyMoreInitLoopSwitch.append( ' if Index >= Min : ' ) + PyMoreInitLoopSwitch.append( ' DoLoop = 1 ' ) + PyMoreInitLoopSwitch.append( ' else : ' ) + PyMoreInitLoopSwitch.append( ' DoLoop = 0 ' ) + PyMoreInitLoopSwitch.append( ' return DoLoop,Index,Min,Max ' ) + PyNextInitLoopSwitch = [] + PyNextInitLoopSwitch.append( 'def NextLoop(Index,Min,Max) : ' ) + PyNextInitLoopSwitch.append( ' Index = Index - 1 ' ) + PyNextInitLoopSwitch.append( ' return Index,Min,Max ' ) + InitLoopSwitch,EndOfInitLoopSwitch = GraphSwitchCheckNoDefault2.LNode( 'InitLoop' , PyInitLoopSwitch , 'MoreLoop' , PyMoreInitLoopSwitch , 'NextLoop' , PyNextInitLoopSwitch ) + EndOfInitLoopSwitch.SetName( 'EndOfInitLoopSwitch' ) + EndOfInitLoopSwitch.SetAuthor( '' ) + EndOfInitLoopSwitch.SetComment( 'Compute Node' ) + EndOfInitLoopSwitch.Coords( 1074 , 194 ) + PyEndOfInitLoopSwitch = [] + PyEndOfInitLoopSwitch.append( 'from time import * ' ) + PyEndOfInitLoopSwitch.append( 'def EndOfInitLoopSwitch(DoLoop,Index,Min,Max) : ' ) + PyEndOfInitLoopSwitch.append( ' sleep(1) ' ) + PyEndOfInitLoopSwitch.append( ' return DoLoop,Index,Min,Max ' ) + EndOfInitLoopSwitch.SetPyFunction( 'EndOfInitLoopSwitch' , PyEndOfInitLoopSwitch ) + IInitLoopSwitchDoLoop = InitLoopSwitch.GetInPort( 'DoLoop' ) + IInitLoopSwitchIndex = InitLoopSwitch.InPort( 'Index' , 'long' ) + IInitLoopSwitchMin = InitLoopSwitch.InPort( 'Min' , 'long' ) + IInitLoopSwitchMax = InitLoopSwitch.InPort( 'Max' , 'long' ) + IInitLoopSwitchGate = InitLoopSwitch.GetInPort( 'Gate' ) + OInitLoopSwitchDoLoop = InitLoopSwitch.GetOutPort( 'DoLoop' ) + OInitLoopSwitchIndex = InitLoopSwitch.GetOutPort( 'Index' ) + OInitLoopSwitchMin = InitLoopSwitch.GetOutPort( 'Min' ) + OInitLoopSwitchMax = InitLoopSwitch.GetOutPort( 'Max' ) + IEndOfInitLoopSwitchDoLoop = EndOfInitLoopSwitch.GetInPort( 'DoLoop' ) + IEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetInPort( 'Index' ) + IEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetInPort( 'Min' ) + IEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetInPort( 'Max' ) + IEndOfInitLoopSwitchGate = EndOfInitLoopSwitch.GetInPort( 'Gate' ) + OEndOfInitLoopSwitchDoLoop = EndOfInitLoopSwitch.GetOutPort( 'DoLoop' ) + OEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetOutPort( 'Index' ) + OEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetOutPort( 'Min' ) + OEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetOutPort( 'Max' ) + OEndOfInitLoopSwitchGate = EndOfInitLoopSwitch.GetOutPort( 'Gate' ) + InitLoopSwitch.SetName( 'InitLoopSwitch' ) + InitLoopSwitch.SetAuthor( '' ) + InitLoopSwitch.SetComment( 'Compute Node' ) + InitLoopSwitch.Coords( 10 , 129 ) + + # Creation of Switch Nodes + PySwitch = [] + PySwitch.append( 'from time import * ' ) + PySwitch.append( 'def Switch(a) : ' ) + PySwitch.append( ' sleep(1) ' ) + PySwitch.append( ' Branch = "Negative or null" ' ) + PySwitch.append( ' if a <= 0 : ' ) + PySwitch.append( ' return 0,0,a,Branch,1 ' ) + PySwitch.append( ' if ( a & 1 ) == 0 : ' ) + PySwitch.append( ' Branch = "Even" ' ) + PySwitch.append( ' else : ' ) + PySwitch.append( ' Branch = "Odd" ' ) + PySwitch.append( ' return a & 1,1-(a&1),a,Branch,0 ' ) + Switch,EndOfSwitch = GraphSwitchCheckNoDefault2.SNode( 'Switch' , PySwitch ) + EndOfSwitch.SetName( 'EndOfSwitch' ) + EndOfSwitch.SetAuthor( '' ) + EndOfSwitch.SetComment( 'Compute Node' ) + EndOfSwitch.Coords( 882 , 194 ) + PyEndOfSwitch = [] + PyEndOfSwitch.append( 'from time import * ' ) + PyEndOfSwitch.append( 'def EndOfSwitch(a,Branch) : ' ) + PyEndOfSwitch.append( ' sleep(1) ' ) + PyEndOfSwitch.append( ' return a ' ) + EndOfSwitch.SetPyFunction( 'EndOfSwitch' , PyEndOfSwitch ) + IEndOfSwitcha = EndOfSwitch.InPort( 'a' , 'long' ) + IEndOfSwitchBranch = EndOfSwitch.InPort( 'Branch' , 'string' ) + IEndOfSwitchDefault = EndOfSwitch.GetInPort( 'Default' ) + OEndOfSwitcha = EndOfSwitch.OutPort( 'a' , 'long' ) + OEndOfSwitchGate = EndOfSwitch.GetOutPort( 'Gate' ) + Switch.SetName( 'Switch' ) + Switch.SetAuthor( '' ) + Switch.SetComment( 'Compute Node' ) + Switch.Coords( 190 , 129 ) + ISwitcha = Switch.InPort( 'a' , 'long' ) + ISwitchGate = Switch.GetInPort( 'Gate' ) + OSwitchOdd = Switch.OutPort( 'Odd' , 'long' ) + OSwitchEven = Switch.OutPort( 'Even' , 'int' ) + OSwitcha = Switch.OutPort( 'a' , 'int' ) + OSwitchBranch = Switch.OutPort( 'Branch' , 'string' ) + OSwitchdefault = Switch.OutPort( 'default' , 'boolean' ) + OSwitchDefault = Switch.GetOutPort( 'Default' ) + + # Creation of Links + LIsOddaEmptyNodea = GraphSwitchCheckNoDefault2.Link( OIsOdda , IEmptyNodea ) + LIsOddaEmptyNodea.AddCoord( 1 , 646 , 78 ) + + LIsEvenaEndOfSwitcha = GraphSwitchCheckNoDefault2.Link( OIsEvena , IEndOfSwitcha ) + + LPrintOddBranchEmptyNodeBranch = GraphSwitchCheckNoDefault2.Link( OPrintOddBranch , IEmptyNodeBranch ) + + LPrintEvenBranchEndOfSwitchBranch = GraphSwitchCheckNoDefault2.Link( OPrintEvenBranch , IEndOfSwitchBranch ) + + LEmptyNodeaEndOfSwitcha = GraphSwitchCheckNoDefault2.Link( OEmptyNodea , IEndOfSwitcha ) + + LEmptyNodeBranchEndOfSwitchBranch = GraphSwitchCheckNoDefault2.Link( OEmptyNodeBranch , IEndOfSwitchBranch ) + + LDefaultaPutaa = GraphSwitchCheckNoDefault2.Link( ODefaulta , IPutaa ) + + LDefaultBranchPutBranchBranch = GraphSwitchCheckNoDefault2.Link( ODefaultBranch , IPutBranchBranch ) + + LInitLoopSwitchIndexSwitcha = GraphSwitchCheckNoDefault2.Link( OInitLoopSwitchIndex , ISwitcha ) + + LInitLoopSwitchMinEndOfInitLoopSwitchMin = GraphSwitchCheckNoDefault2.Link( OInitLoopSwitchMin , IEndOfInitLoopSwitchMin ) + + LInitLoopSwitchMaxEndOfInitLoopSwitchMax = GraphSwitchCheckNoDefault2.Link( OInitLoopSwitchMax , IEndOfInitLoopSwitchMax ) + + LSwitchOddIsOddGate = GraphSwitchCheckNoDefault2.Link( OSwitchOdd , IIsOddGate ) + LSwitchOddIsOddGate.AddCoord( 1 , 401 , 101 ) + LSwitchOddIsOddGate.AddCoord( 2 , 401 , 160 ) + + LSwitchOddPrintOddGate = GraphSwitchCheckNoDefault2.Link( OSwitchOdd , IPrintOddGate ) + LSwitchOddPrintOddGate.AddCoord( 1 , 401 , 245 ) + LSwitchOddPrintOddGate.AddCoord( 2 , 401 , 159 ) + + LSwitchEvenIsEvenGate = GraphSwitchCheckNoDefault2.Link( OSwitchEven , IIsEvenGate ) + LSwitchEvenIsEvenGate.AddCoord( 1 , 392 , 533 ) + LSwitchEvenIsEvenGate.AddCoord( 2 , 392 , 182 ) + + LSwitchEvenPrintEvenGate = GraphSwitchCheckNoDefault2.Link( OSwitchEven , IPrintEvenGate ) + LSwitchEvenPrintEvenGate.AddCoord( 1 , 392 , 403 ) + LSwitchEvenPrintEvenGate.AddCoord( 2 , 392 , 181 ) + + LSwitchaIsOdda = GraphSwitchCheckNoDefault2.Link( OSwitcha , IIsOdda ) + LSwitchaIsOdda.AddCoord( 1 , 382 , 78 ) + LSwitchaIsOdda.AddCoord( 2 , 382 , 199 ) + + LSwitchaIsEvena = GraphSwitchCheckNoDefault2.Link( OSwitcha , IIsEvena ) + LSwitchaIsEvena.AddCoord( 1 , 381 , 509 ) + LSwitchaIsEvena.AddCoord( 2 , 382 , 200 ) + + LSwitchaPrintOdda = GraphSwitchCheckNoDefault2.Link( OSwitcha , IPrintOdda ) + + LSwitchaPrintEvena = GraphSwitchCheckNoDefault2.Link( OSwitcha , IPrintEvena ) + LSwitchaPrintEvena.AddCoord( 1 , 381 , 361 ) + LSwitchaPrintEvena.AddCoord( 2 , 382 , 200 ) + + LSwitchaDefaulta = GraphSwitchCheckNoDefault2.Link( OSwitcha , IDefaulta ) + LSwitchaDefaulta.AddCoord( 1 , 382 , 663 ) + LSwitchaDefaulta.AddCoord( 2 , 382 , 199 ) + + LSwitchBranchPrintOddBranch = GraphSwitchCheckNoDefault2.Link( OSwitchBranch , IPrintOddBranch ) + + LSwitchBranchPrintEvenBranch = GraphSwitchCheckNoDefault2.Link( OSwitchBranch , IPrintEvenBranch ) + LSwitchBranchPrintEvenBranch.AddCoord( 1 , 369 , 381 ) + LSwitchBranchPrintEvenBranch.AddCoord( 2 , 369 , 219 ) + + LSwitchBranchDefaultBranch = GraphSwitchCheckNoDefault2.Link( OSwitchBranch , IDefaultBranch ) + LSwitchBranchDefaultBranch.AddCoord( 1 , 370 , 683 ) + LSwitchBranchDefaultBranch.AddCoord( 2 , 370 , 220 ) + + LSwitchdefaultDefaultGate = GraphSwitchCheckNoDefault2.Link( OSwitchdefault , IDefaultGate ) + LSwitchdefaultDefaultGate.AddCoord( 1 , 363 , 707 ) + LSwitchdefaultDefaultGate.AddCoord( 2 , 362 , 239 ) + + LEndOfSwitchaEndOfInitLoopSwitchIndex = GraphSwitchCheckNoDefault2.Link( OEndOfSwitcha , IEndOfInitLoopSwitchIndex ) + + LPutaaEndOfSwitcha = GraphSwitchCheckNoDefault2.Link( OPutaa , IEndOfSwitcha ) + + LPutBranchBranchEndOfSwitchBranch = GraphSwitchCheckNoDefault2.Link( OPutBranchBranch , IEndOfSwitchBranch ) + + # Input datas + IInitLoopSwitchIndex.Input( 0 ) + IInitLoopSwitchMin.Input( -5 ) + IInitLoopSwitchMax.Input( 10 ) + + # Output Ports of the graph + #OEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetOutPort( 'Index' ) + #OEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetOutPort( 'Min' ) + #OEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetOutPort( 'Max' ) + return GraphSwitchCheckNoDefault2 + + +GraphSwitchCheckNoDefault2 = DefGraphSwitchCheckNoDefault2() diff --git a/examples/GraphSwitchCheckNoDefault2.xml b/examples/GraphSwitchCheckNoDefault2.xml new file mode 100644 index 0000000..d7ccd5e --- /dev/null +++ b/examples/GraphSwitchCheckNoDefault2.xml @@ -0,0 +1,781 @@ + + + + + +? + ? + GraphSwitchCheckNoDefault2 + 1 + ? + +GraphSwitchCheckDefault2NOTValid2 + + +long + InitLoopSwitch__Index + +long + InitLoopSwitch__Min + +long + InitLoopSwitch__Max + + +long + EndOfInitLoopSwitch__Index + +long + EndOfInitLoopSwitch__Min + +long + EndOfInitLoopSwitch__Max + + + 13/1/2005 - 12:21:43 + 14/2/2005 - 14:13:3 + 2.0 + JR + ? + ? + 0 + 0 + + +? + ? + IsOdd + 3 + ? + +IsOdd + + +long + a + + +long + a + + + +IsOdd + + + + + + 14/2/2005 - 14:13:3 + 14/2/2005 - 14:13:3 + 2.0 + ? + ? + Python function + 415 + 7 + +? + ? + IsEven + 3 + ? + +IsEven + + +long + a + + +long + a + + + +IsEven + + + + + + 14/2/2005 - 14:13:3 + 14/2/2005 - 14:13:3 + 2.0 + ? + ? + Compute Node + 421 + 438 + +? + ? + PrintOdd + 3 + ? + +PrintOdd + + +long + a + +string + Branch + + +string + Branch + + + +Print + + + + + + 14/2/2005 - 14:13:3 + 14/2/2005 - 14:13:3 + 2.0 + ? + ? + Compute Node + 415 + 130 + +? + ? + PrintEven + 3 + ? + +PrintEven + + +long + a + +string + Branch + + +string + Branch + + + +Print_1 + + + + + + 14/2/2005 - 14:13:3 + 14/2/2005 - 14:13:3 + 2.0 + ? + ? + Compute Node + 423 + 289 + +? + ? + EmptyNode + 3 + ? + +EmptyNode + + +long + a + +string + Branch + + +long + a + +string + Branch + + + +EmptyNode + + + + + 14/2/2005 - 14:13:3 + 14/2/2005 - 14:13:3 + 2.0 + ? + ? + Compute Node + 652 + 110 + +? + ? + Default + 3 + ? + +Default + + +long + a + +string + Branch + + +long + a + +string + Branch + + + +Default + + + + + 14/2/2005 - 14:13:3 + 14/2/2005 - 14:13:3 + 2.0 + ? + ? + Compute Node + 421 + 592 + +? + ? + InitLoopSwitch + 4 + EndOfInitLoopSwitch + +InitLoopSwitch + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +InitLoop + + + + +MoreLoop + + + + = Min : ]]> + + + + + +NextLoop + + + + 14/2/2005 - 14:13:3 + 14/2/2005 - 14:13:3 + 2.0 + ? + ? + Compute Node + 10 + 129 + +? + ? + EndOfInitLoopSwitch + 5 + InitLoopSwitch + +EndOfInitLoopSwitch + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +EndOfInitLoopSwitch + + + + + 14/2/2005 - 14:13:3 + 14/2/2005 - 14:13:3 + 2.0 + ? + ? + Compute Node + 1074 + 194 + +? + ? + Switch + 6 + EndOfSwitch + +Switch + + +long + a + + +long + Odd + +int + Even + +int + a + +string + Branch + +boolean + default + + + +Switch + + + + + + + + + + + + 14/2/2005 - 14:13:3 + 14/2/2005 - 14:13:3 + 2.0 + ? + ? + Compute Node + 190 + 129 + +? + ? + EndOfSwitch + 7 + Switch + +EndOfSwitch + + +long + a + +string + Branch + + +long + a + + + +EndOfSwitch + + + + + 14/2/2005 - 14:13:3 + 14/2/2005 - 14:13:3 + 2.0 + ? + ? + Compute Node + 882 + 194 + +? + ? + Puta + 3 + ? + +Puta + + +long + a + + +long + a + + + +Puta + + + + + 14/2/2005 - 14:13:3 + 14/2/2005 - 14:13:3 + 2.0 + ? + ? + Compute Node + 665 + 486 + +? + ? + PutBranch + 3 + ? + +PutBranch + + +string + Branch + + +string + Branch + + + +PutBranch + + + + + 14/2/2005 - 14:13:3 + 14/2/2005 - 14:13:3 + 2.0 + ? + ? + Compute Node + 662 + 613 + + +IsOdd + a + EmptyNode + a + + +646 + 78 + +IsEven + a + EndOfSwitch + a + + +PrintOdd + Branch + EmptyNode + Branch + + +PrintEven + Branch + EndOfSwitch + Branch + + +EmptyNode + a + EndOfSwitch + a + + +EmptyNode + Branch + EndOfSwitch + Branch + + +Default + a + Puta + a + + +Default + Branch + PutBranch + Branch + + +InitLoopSwitch + DoLoop + EndOfInitLoopSwitch + DoLoop + + +InitLoopSwitch + Index + Switch + a + + +InitLoopSwitch + Min + EndOfInitLoopSwitch + Min + + +InitLoopSwitch + Max + EndOfInitLoopSwitch + Max + + +EndOfInitLoopSwitch + DoLoop + InitLoopSwitch + DoLoop + + +Switch + Odd + IsOdd + Gate + + +401 + 101 + +401 + 160 + +Switch + Odd + PrintOdd + Gate + + +401 + 245 + +401 + 159 + +Switch + Even + IsEven + Gate + + +392 + 533 + +392 + 182 + +Switch + Even + PrintEven + Gate + + +392 + 403 + +392 + 181 + +Switch + a + IsOdd + a + + +382 + 78 + +382 + 199 + +Switch + a + IsEven + a + + +381 + 509 + +382 + 200 + +Switch + a + PrintOdd + a + + +Switch + a + PrintEven + a + + +381 + 361 + +382 + 200 + +Switch + a + Default + a + + +382 + 663 + +382 + 199 + +Switch + Branch + PrintOdd + Branch + + +Switch + Branch + PrintEven + Branch + + +369 + 381 + +369 + 219 + +Switch + Branch + Default + Branch + + +370 + 683 + +370 + 220 + +Switch + default + Default + Gate + + +363 + 707 + +362 + 239 + +EndOfSwitch + a + EndOfInitLoopSwitch + Index + + +Puta + a + EndOfSwitch + a + + +PutBranch + Branch + EndOfSwitch + Branch + + + +GraphSwitchCheckNoDefault2 + InitLoopSwitch__Index + InitLoopSwitch + Index + +3 + 0 + + +GraphSwitchCheckNoDefault2 + InitLoopSwitch__Min + InitLoopSwitch + Min + +3 + -5 + + +GraphSwitchCheckNoDefault2 + InitLoopSwitch__Max + InitLoopSwitch + Max + +3 + 10 + diff --git a/examples/GraphSwitchGates.py b/examples/GraphSwitchGates.py new file mode 100644 index 0000000..6999ae1 --- /dev/null +++ b/examples/GraphSwitchGates.py @@ -0,0 +1,156 @@ + +# Generated python file of Graph GraphSwitchGates + +from SuperV import * + +# Graph creation of GraphSwitchGates +def DefGraphSwitchGates() : + GraphSwitchGates = Graph( 'GraphSwitchGates' ) + GraphSwitchGates.SetName( 'GraphSwitchGates' ) + GraphSwitchGates.SetAuthor( 'JR' ) + GraphSwitchGates.SetComment( '' ) + GraphSwitchGates.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsOdd = [] + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd() : ' ) + PyIsOdd.append( ' sleep(1) ' ) + PyIsOdd.append( ' return ' ) + IsOdd = GraphSwitchGates.INode( 'IsOdd' , PyIsOdd ) + IsOdd.SetName( 'IsOdd' ) + IsOdd.SetAuthor( '' ) + IsOdd.SetComment( 'Compute Node' ) + IsOdd.Coords( 424 , 116 ) + IIsOddGate = IsOdd.GetInPort( 'Gate' ) + OIsOddGate = IsOdd.GetOutPort( 'Gate' ) + + PyIsEven = [] + PyIsEven.append( 'from time import * ' ) + PyIsEven.append( 'def IsEven() : ' ) + PyIsEven.append( ' sleep(1) ' ) + PyIsEven.append( ' return ' ) + IsEven = GraphSwitchGates.INode( 'IsEven' , PyIsEven ) + IsEven.SetName( 'IsEven' ) + IsEven.SetAuthor( '' ) + IsEven.SetComment( 'Compute Node' ) + IsEven.Coords( 428 , 345 ) + IIsEvenGate = IsEven.GetInPort( 'Gate' ) + OIsEvenGate = IsEven.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyLoopGates = [] + PyLoopGates.append( 'def InitLoop(Index,Max,Min) : ' ) + PyLoopGates.append( ' Index = Max ' ) + PyLoopGates.append( ' return Index,Max,Min ' ) + PyMoreLoopGates = [] + PyMoreLoopGates.append( 'from time import * ' ) + PyMoreLoopGates.append( 'def MoreLoop(Index,Max,Min) : ' ) + PyMoreLoopGates.append( ' sleep(1) ' ) + PyMoreLoopGates.append( ' DoLoop = 0 ' ) + PyMoreLoopGates.append( ' if Index >= Min : ' ) + PyMoreLoopGates.append( ' DoLoop = 1 ' ) + PyMoreLoopGates.append( ' return DoLoop,Index,Max,Min ' ) + PyNextLoopGates = [] + PyNextLoopGates.append( 'def NextLoop(Index,Max,Min) : ' ) + PyNextLoopGates.append( ' Index = Index - 1 ' ) + PyNextLoopGates.append( ' return Index,Max,Min ' ) + LoopGates,EndLoopGates = GraphSwitchGates.LNode( 'InitLoop' , PyLoopGates , 'MoreLoop' , PyMoreLoopGates , 'NextLoop' , PyNextLoopGates ) + EndLoopGates.SetName( 'EndLoopGates' ) + EndLoopGates.SetAuthor( '' ) + EndLoopGates.SetComment( 'Compute Node' ) + EndLoopGates.Coords( 875 , 216 ) + PyEndLoopGates = [] + EndLoopGates.SetPyFunction( 'EndLoopGates' , PyEndLoopGates ) + ILoopGatesDoLoop = LoopGates.GetInPort( 'DoLoop' ) + ILoopGatesIndex = LoopGates.InPort( 'Index' , 'long' ) + ILoopGatesMax = LoopGates.InPort( 'Max' , 'long' ) + ILoopGatesMin = LoopGates.InPort( 'Min' , 'long' ) + ILoopGatesGate = LoopGates.GetInPort( 'Gate' ) + OLoopGatesDoLoop = LoopGates.GetOutPort( 'DoLoop' ) + OLoopGatesIndex = LoopGates.GetOutPort( 'Index' ) + OLoopGatesMax = LoopGates.GetOutPort( 'Max' ) + OLoopGatesMin = LoopGates.GetOutPort( 'Min' ) + IEndLoopGatesDoLoop = EndLoopGates.GetInPort( 'DoLoop' ) + IEndLoopGatesIndex = EndLoopGates.GetInPort( 'Index' ) + IEndLoopGatesMax = EndLoopGates.GetInPort( 'Max' ) + IEndLoopGatesMin = EndLoopGates.GetInPort( 'Min' ) + IEndLoopGatesGate = EndLoopGates.GetInPort( 'Gate' ) + OEndLoopGatesDoLoop = EndLoopGates.GetOutPort( 'DoLoop' ) + OEndLoopGatesIndex = EndLoopGates.GetOutPort( 'Index' ) + OEndLoopGatesMax = EndLoopGates.GetOutPort( 'Max' ) + OEndLoopGatesMin = EndLoopGates.GetOutPort( 'Min' ) + OEndLoopGatesGate = EndLoopGates.GetOutPort( 'Gate' ) + LoopGates.SetName( 'LoopGates' ) + LoopGates.SetAuthor( '' ) + LoopGates.SetComment( 'Compute Node' ) + LoopGates.Coords( 13 , 236 ) + + # Creation of Switch Nodes + PySwitchGates = [] + PySwitchGates.append( 'def SwitchGates(Index) : ' ) + PySwitchGates.append( ' Odd = 0 ' ) + PySwitchGates.append( ' Even = 0 ' ) + PySwitchGates.append( ' if (Index & 1) == 1 : ' ) + PySwitchGates.append( ' Odd = 1 ' ) + PySwitchGates.append( ' if (Index & 1) == 0 : ' ) + PySwitchGates.append( ' Even = 1 ' ) + PySwitchGates.append( ' return Odd,Even ' ) + SwitchGates,EndSwitchGates = GraphSwitchGates.SNode( 'SwitchGates' , PySwitchGates ) + EndSwitchGates.SetName( 'EndSwitchGates' ) + EndSwitchGates.SetAuthor( '' ) + EndSwitchGates.SetComment( 'Compute Node' ) + EndSwitchGates.Coords( 648 , 276 ) + PyEndSwitchGates = [] + PyEndSwitchGates.append( 'from time import * ' ) + PyEndSwitchGates.append( 'def EndSwitchGates() : ' ) + PyEndSwitchGates.append( ' sleep(1) ' ) + PyEndSwitchGates.append( ' return ' ) + PyEndSwitchGates.append( '' ) + EndSwitchGates.SetPyFunction( 'EndSwitchGates' , PyEndSwitchGates ) + IEndSwitchGatesDefault = EndSwitchGates.GetInPort( 'Default' ) + OEndSwitchGatesGate = EndSwitchGates.GetOutPort( 'Gate' ) + SwitchGates.SetName( 'SwitchGates' ) + SwitchGates.SetAuthor( '' ) + SwitchGates.SetComment( 'Compute Node' ) + SwitchGates.Coords( 204 , 236 ) + ISwitchGatesIndex = SwitchGates.InPort( 'Index' , 'long' ) + ISwitchGatesGate = SwitchGates.GetInPort( 'Gate' ) + OSwitchGatesOdd = SwitchGates.OutPort( 'Odd' , 'long' ) + OSwitchGatesEven = SwitchGates.OutPort( 'Even' , 'long' ) + OSwitchGatesDefault = SwitchGates.GetOutPort( 'Default' ) + + # Creation of Links + LLoopGatesIndexEndLoopGatesIndex = GraphSwitchGates.Link( OLoopGatesIndex , IEndLoopGatesIndex ) + + LLoopGatesIndexSwitchGatesIndex = GraphSwitchGates.Link( OLoopGatesIndex , ISwitchGatesIndex ) + + LLoopGatesMaxEndLoopGatesMax = GraphSwitchGates.Link( OLoopGatesMax , IEndLoopGatesMax ) + + LLoopGatesMinEndLoopGatesMin = GraphSwitchGates.Link( OLoopGatesMin , IEndLoopGatesMin ) + + LSwitchGatesOddIsOddGate = GraphSwitchGates.Link( OSwitchGatesOdd , IIsOddGate ) + + LSwitchGatesEvenIsEvenGate = GraphSwitchGates.Link( OSwitchGatesEven , IIsEvenGate ) + + LEndSwitchGatesGateEndLoopGatesGate = GraphSwitchGates.Link( OEndSwitchGatesGate , IEndLoopGatesGate ) + + LIsOddGateEndSwitchGatesDefault = GraphSwitchGates.Link( OIsOddGate , IEndSwitchGatesDefault ) + + LIsEvenGateEndSwitchGatesDefault = GraphSwitchGates.Link( OIsEvenGate , IEndSwitchGatesDefault ) + + # Input datas + ILoopGatesIndex.Input( 0 ) + ILoopGatesMax.Input( 13 ) + ILoopGatesMin.Input( -7 ) + + # Output Ports of the graph + #OEndLoopGatesIndex = EndLoopGates.GetOutPort( 'Index' ) + #OEndLoopGatesMax = EndLoopGates.GetOutPort( 'Max' ) + #OEndLoopGatesMin = EndLoopGates.GetOutPort( 'Min' ) + return GraphSwitchGates + + +GraphSwitchGates = DefGraphSwitchGates() diff --git a/examples/GraphSwitchGates.xml b/examples/GraphSwitchGates.xml new file mode 100644 index 0000000..7c6b883 --- /dev/null +++ b/examples/GraphSwitchGates.xml @@ -0,0 +1,354 @@ + + + + + +? + ? + GraphSwitchGates + 1 + ? + +GraphSwitchGatesDefault + + +long + LoopGates__Index + +long + LoopGates__Max + +long + LoopGates__Min + + +long + EndLoopGates__Index + +long + EndLoopGates__Max + +long + EndLoopGates__Min + + + 16/2/2005 - 10:40:8 + 16/2/2005 - 11:44:13 + 2.0 + JR + ? + ? + 0 + 0 + + +? + ? + LoopGates + 4 + EndLoopGates + +LoopGates + + +long + Index + +long + Max + +long + Min + + +long + Index + +long + Max + +long + Min + + + +InitLoop + + + + +MoreLoop + + + + + = Min : ]]> + + + +NextLoop + + + + 16/2/2005 - 11:33:14 + 16/2/2005 - 11:33:14 + 2.0 + ? + ? + Compute Node + 13 + 236 + +? + ? + EndLoopGates + 5 + LoopGates + +EndLoopGates + + +long + Index + +long + Max + +long + Min + + +long + Index + +long + Max + +long + Min + + + +EndLoopGates + + 16/2/2005 - 11:33:14 + 16/2/2005 - 11:33:14 + 2.0 + ? + ? + Compute Node + 875 + 216 + +? + ? + SwitchGates + 6 + EndSwitchGates + +SwitchGates + + +long + Index + + +long + Odd + +long + Even + + + +SwitchGates + + + + + + + + + 16/2/2005 - 11:33:14 + 16/2/2005 - 11:33:14 + 2.0 + ? + ? + Compute Node + 204 + 236 + +? + ? + EndSwitchGates + 7 + SwitchGates + +EndSwitchGates + + + + + +EndSwitchGates + + + + + + 16/2/2005 - 11:33:14 + 16/2/2005 - 11:33:14 + 2.0 + ? + ? + Compute Node + 648 + 276 + +? + ? + IsOdd + 3 + ? + +IsOdd + + + + + +IsOdd + + + + + 16/2/2005 - 11:33:14 + 16/2/2005 - 11:33:14 + 2.0 + ? + ? + Compute Node + 424 + 116 + +? + ? + IsEven + 3 + ? + +IsEven + + + + + +IsEven + + + + + 16/2/2005 - 11:33:14 + 16/2/2005 - 11:33:14 + 2.0 + ? + ? + Compute Node + 428 + 345 + + +LoopGates + DoLoop + EndLoopGates + DoLoop + + +LoopGates + Index + EndLoopGates + Index + + +LoopGates + Index + SwitchGates + Index + + +LoopGates + Max + EndLoopGates + Max + + +LoopGates + Min + EndLoopGates + Min + + +EndLoopGates + DoLoop + LoopGates + DoLoop + + +SwitchGates + Odd + IsOdd + Gate + + +SwitchGates + Even + IsEven + Gate + + +EndSwitchGates + Gate + EndLoopGates + Gate + + +IsOdd + Gate + EndSwitchGates + Default + + +IsEven + Gate + EndSwitchGates + Default + + + +GraphSwitchGates + LoopGates__Index + LoopGates + Index + +3 + 0 + + +GraphSwitchGates + LoopGates__Max + LoopGates + Max + +3 + 13 + + +GraphSwitchGates + LoopGates__Min + LoopGates + Min + +3 + -7 + diff --git a/examples/GraphSwitchGatesDefault.py b/examples/GraphSwitchGatesDefault.py new file mode 100644 index 0000000..dd176ff --- /dev/null +++ b/examples/GraphSwitchGatesDefault.py @@ -0,0 +1,159 @@ + +# Generated python file of Graph GraphSwitchGatesDefault + +from SuperV import * + +# Graph creation of GraphSwitchGatesDefault +def DefGraphSwitchGatesDefault() : + GraphSwitchGatesDefault = Graph( 'GraphSwitchGatesDefault' ) + GraphSwitchGatesDefault.SetName( 'GraphSwitchGatesDefault' ) + GraphSwitchGatesDefault.SetAuthor( 'JR' ) + GraphSwitchGatesDefault.SetComment( '' ) + GraphSwitchGatesDefault.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsOdd = [] + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd() : ' ) + PyIsOdd.append( ' sleep(1) ' ) + PyIsOdd.append( ' return ' ) + IsOdd = GraphSwitchGatesDefault.INode( 'IsOdd' , PyIsOdd ) + IsOdd.SetName( 'IsOdd' ) + IsOdd.SetAuthor( '' ) + IsOdd.SetComment( 'Compute Node' ) + IsOdd.Coords( 424 , 116 ) + IIsOddGate = IsOdd.GetInPort( 'Gate' ) + OIsOddGate = IsOdd.GetOutPort( 'Gate' ) + + PyIsEven = [] + PyIsEven.append( 'from time import * ' ) + PyIsEven.append( 'def IsEven() : ' ) + PyIsEven.append( ' sleep(1) ' ) + PyIsEven.append( ' return ' ) + IsEven = GraphSwitchGatesDefault.INode( 'IsEven' , PyIsEven ) + IsEven.SetName( 'IsEven' ) + IsEven.SetAuthor( '' ) + IsEven.SetComment( 'Compute Node' ) + IsEven.Coords( 428 , 345 ) + IIsEvenGate = IsEven.GetInPort( 'Gate' ) + OIsEvenGate = IsEven.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyLoopGates = [] + PyLoopGates.append( 'def InitLoop(Index,Max,Min) : ' ) + PyLoopGates.append( ' Index = Max ' ) + PyLoopGates.append( ' return Index,Max,Min ' ) + PyMoreLoopGates = [] + PyMoreLoopGates.append( 'from time import * ' ) + PyMoreLoopGates.append( 'def MoreLoop(Index,Max,Min) : ' ) + PyMoreLoopGates.append( ' sleep(1) ' ) + PyMoreLoopGates.append( ' DoLoop = 0 ' ) + PyMoreLoopGates.append( ' if Index >= Min : ' ) + PyMoreLoopGates.append( ' DoLoop = 1 ' ) + PyMoreLoopGates.append( ' return DoLoop,Index,Max,Min ' ) + PyNextLoopGates = [] + PyNextLoopGates.append( 'def NextLoop(Index,Max,Min) : ' ) + PyNextLoopGates.append( ' Index = Index - 1 ' ) + PyNextLoopGates.append( ' return Index,Max,Min ' ) + LoopGates,EndLoopGates = GraphSwitchGatesDefault.LNode( 'InitLoop' , PyLoopGates , 'MoreLoop' , PyMoreLoopGates , 'NextLoop' , PyNextLoopGates ) + EndLoopGates.SetName( 'EndLoopGates' ) + EndLoopGates.SetAuthor( '' ) + EndLoopGates.SetComment( 'Compute Node' ) + EndLoopGates.Coords( 875 , 216 ) + PyEndLoopGates = [] + EndLoopGates.SetPyFunction( 'EndLoopGates' , PyEndLoopGates ) + ILoopGatesDoLoop = LoopGates.GetInPort( 'DoLoop' ) + ILoopGatesIndex = LoopGates.InPort( 'Index' , 'long' ) + ILoopGatesMax = LoopGates.InPort( 'Max' , 'long' ) + ILoopGatesMin = LoopGates.InPort( 'Min' , 'long' ) + ILoopGatesGate = LoopGates.GetInPort( 'Gate' ) + OLoopGatesDoLoop = LoopGates.GetOutPort( 'DoLoop' ) + OLoopGatesIndex = LoopGates.GetOutPort( 'Index' ) + OLoopGatesMax = LoopGates.GetOutPort( 'Max' ) + OLoopGatesMin = LoopGates.GetOutPort( 'Min' ) + IEndLoopGatesDoLoop = EndLoopGates.GetInPort( 'DoLoop' ) + IEndLoopGatesIndex = EndLoopGates.GetInPort( 'Index' ) + IEndLoopGatesMax = EndLoopGates.GetInPort( 'Max' ) + IEndLoopGatesMin = EndLoopGates.GetInPort( 'Min' ) + IEndLoopGatesGate = EndLoopGates.GetInPort( 'Gate' ) + OEndLoopGatesDoLoop = EndLoopGates.GetOutPort( 'DoLoop' ) + OEndLoopGatesIndex = EndLoopGates.GetOutPort( 'Index' ) + OEndLoopGatesMax = EndLoopGates.GetOutPort( 'Max' ) + OEndLoopGatesMin = EndLoopGates.GetOutPort( 'Min' ) + OEndLoopGatesGate = EndLoopGates.GetOutPort( 'Gate' ) + LoopGates.SetName( 'LoopGates' ) + LoopGates.SetAuthor( '' ) + LoopGates.SetComment( 'Compute Node' ) + LoopGates.Coords( 13 , 236 ) + + # Creation of Switch Nodes + PySwitchGates = [] + PySwitchGates.append( 'def SwitchGates(Index) : ' ) + PySwitchGates.append( ' Odd = 0 ' ) + PySwitchGates.append( ' Even = 0 ' ) + PySwitchGates.append( ' if Index > 0 : ' ) + PySwitchGates.append( ' if (Index & 1) == 1 : ' ) + PySwitchGates.append( ' Odd = 1 ' ) + PySwitchGates.append( ' if (Index & 1) == 0 : ' ) + PySwitchGates.append( ' Even = 1 ' ) + PySwitchGates.append( ' return Odd,Even ' ) + SwitchGates,EndSwitchGates = GraphSwitchGatesDefault.SNode( 'SwitchGates' , PySwitchGates ) + EndSwitchGates.SetName( 'EndSwitchGates' ) + EndSwitchGates.SetAuthor( '' ) + EndSwitchGates.SetComment( 'Compute Node' ) + EndSwitchGates.Coords( 648 , 276 ) + PyEndSwitchGates = [] + PyEndSwitchGates.append( 'from time import * ' ) + PyEndSwitchGates.append( 'def EndSwitchGates() : ' ) + PyEndSwitchGates.append( ' sleep(1) ' ) + PyEndSwitchGates.append( ' return ' ) + PyEndSwitchGates.append( '' ) + EndSwitchGates.SetPyFunction( 'EndSwitchGates' , PyEndSwitchGates ) + IEndSwitchGatesDefault = EndSwitchGates.GetInPort( 'Default' ) + OEndSwitchGatesGate = EndSwitchGates.GetOutPort( 'Gate' ) + SwitchGates.SetName( 'SwitchGates' ) + SwitchGates.SetAuthor( '' ) + SwitchGates.SetComment( 'Compute Node' ) + SwitchGates.Coords( 204 , 236 ) + ISwitchGatesIndex = SwitchGates.InPort( 'Index' , 'long' ) + ISwitchGatesGate = SwitchGates.GetInPort( 'Gate' ) + OSwitchGatesOdd = SwitchGates.OutPort( 'Odd' , 'long' ) + OSwitchGatesEven = SwitchGates.OutPort( 'Even' , 'long' ) + OSwitchGatesDefault = SwitchGates.GetOutPort( 'Default' ) + + # Creation of Links + LLoopGatesIndexEndLoopGatesIndex = GraphSwitchGatesDefault.Link( OLoopGatesIndex , IEndLoopGatesIndex ) + + LLoopGatesIndexSwitchGatesIndex = GraphSwitchGatesDefault.Link( OLoopGatesIndex , ISwitchGatesIndex ) + + LLoopGatesMaxEndLoopGatesMax = GraphSwitchGatesDefault.Link( OLoopGatesMax , IEndLoopGatesMax ) + + LLoopGatesMinEndLoopGatesMin = GraphSwitchGatesDefault.Link( OLoopGatesMin , IEndLoopGatesMin ) + + LSwitchGatesOddIsOddGate = GraphSwitchGatesDefault.Link( OSwitchGatesOdd , IIsOddGate ) + + LSwitchGatesEvenIsEvenGate = GraphSwitchGatesDefault.Link( OSwitchGatesEven , IIsEvenGate ) + + LSwitchGatesDefaultEndSwitchGatesDefault = GraphSwitchGatesDefault.Link( OSwitchGatesDefault , IEndSwitchGatesDefault ) + + LEndSwitchGatesGateEndLoopGatesGate = GraphSwitchGatesDefault.Link( OEndSwitchGatesGate , IEndLoopGatesGate ) + + LIsOddGateEndSwitchGatesDefault = GraphSwitchGatesDefault.Link( OIsOddGate , IEndSwitchGatesDefault ) + + LIsEvenGateEndSwitchGatesDefault = GraphSwitchGatesDefault.Link( OIsEvenGate , IEndSwitchGatesDefault ) + + # Input datas + ILoopGatesIndex.Input( 0 ) + ILoopGatesMax.Input( 13 ) + ILoopGatesMin.Input( -7 ) + + # Output Ports of the graph + #OEndLoopGatesIndex = EndLoopGates.GetOutPort( 'Index' ) + #OEndLoopGatesMax = EndLoopGates.GetOutPort( 'Max' ) + #OEndLoopGatesMin = EndLoopGates.GetOutPort( 'Min' ) + return GraphSwitchGatesDefault + + +GraphSwitchGatesDefault = DefGraphSwitchGatesDefault() diff --git a/examples/GraphSwitchGatesDefault.xml b/examples/GraphSwitchGatesDefault.xml new file mode 100644 index 0000000..2dbc8c8 --- /dev/null +++ b/examples/GraphSwitchGatesDefault.xml @@ -0,0 +1,361 @@ + + + + + +? + ? + GraphSwitchGatesDefault + 1 + ? + +GraphSwitchGatesDefault_1 + + +long + LoopGates__Index + +long + LoopGates__Max + +long + LoopGates__Min + + +long + EndLoopGates__Index + +long + EndLoopGates__Max + +long + EndLoopGates__Min + + + 16/2/2005 - 10:40:8 + 16/2/2005 - 11:46:44 + 2.0 + JR + ? + ? + 0 + 0 + + +? + ? + LoopGates + 4 + EndLoopGates + +LoopGates + + +long + Index + +long + Max + +long + Min + + +long + Index + +long + Max + +long + Min + + + +InitLoop + + + + +MoreLoop + + + + + = Min : ]]> + + + +NextLoop + + + + 16/2/2005 - 11:46:44 + 16/2/2005 - 11:46:44 + 2.0 + ? + ? + Compute Node + 13 + 236 + +? + ? + EndLoopGates + 5 + LoopGates + +EndLoopGates + + +long + Index + +long + Max + +long + Min + + +long + Index + +long + Max + +long + Min + + + +EndLoopGates + + 16/2/2005 - 11:46:44 + 16/2/2005 - 11:46:44 + 2.0 + ? + ? + Compute Node + 875 + 216 + +? + ? + SwitchGates + 6 + EndSwitchGates + +SwitchGates + + +long + Index + + +long + Odd + +long + Even + + + +SwitchGates + + + + 0 : ]]> + + + + + + 16/2/2005 - 11:46:44 + 16/2/2005 - 11:46:44 + 2.0 + ? + ? + Compute Node + 204 + 236 + +? + ? + EndSwitchGates + 7 + SwitchGates + +EndSwitchGates + + + + + +EndSwitchGates + + + + + + 16/2/2005 - 11:46:44 + 16/2/2005 - 11:46:44 + 2.0 + ? + ? + Compute Node + 648 + 276 + +? + ? + IsOdd + 3 + ? + +IsOdd + + + + + +IsOdd + + + + + 16/2/2005 - 11:46:44 + 16/2/2005 - 11:46:44 + 2.0 + ? + ? + Compute Node + 424 + 116 + +? + ? + IsEven + 3 + ? + +IsEven + + + + + +IsEven + + + + + 16/2/2005 - 11:46:44 + 16/2/2005 - 11:46:44 + 2.0 + ? + ? + Compute Node + 428 + 345 + + +LoopGates + DoLoop + EndLoopGates + DoLoop + + +LoopGates + Index + EndLoopGates + Index + + +LoopGates + Index + SwitchGates + Index + + +LoopGates + Max + EndLoopGates + Max + + +LoopGates + Min + EndLoopGates + Min + + +EndLoopGates + DoLoop + LoopGates + DoLoop + + +SwitchGates + Odd + IsOdd + Gate + + +SwitchGates + Even + IsEven + Gate + + +SwitchGates + Default + EndSwitchGates + Default + + +EndSwitchGates + Gate + EndLoopGates + Gate + + +IsOdd + Gate + EndSwitchGates + Default + + +IsEven + Gate + EndSwitchGates + Default + + + +GraphSwitchGatesDefault + LoopGates__Index + LoopGates + Index + +3 + 0 + + +GraphSwitchGatesDefault + LoopGates__Max + LoopGates + Max + +3 + 13 + + +GraphSwitchGatesDefault + LoopGates__Min + LoopGates + Min + +3 + -7 + diff --git a/examples/GraphSwitchGatesNoDefaultAborted.py b/examples/GraphSwitchGatesNoDefaultAborted.py new file mode 100644 index 0000000..cccfc8f --- /dev/null +++ b/examples/GraphSwitchGatesNoDefaultAborted.py @@ -0,0 +1,157 @@ + +# Generated python file of Graph GraphSwitchGatesNoDefaultAborted + +from SuperV import * + +# Graph creation of GraphSwitchGatesNoDefaultAborted +def DefGraphSwitchGatesNoDefaultAborted() : + GraphSwitchGatesNoDefaultAborted = Graph( 'GraphSwitchGatesNoDefaultAborted' ) + GraphSwitchGatesNoDefaultAborted.SetName( 'GraphSwitchGatesNoDefaultAborted' ) + GraphSwitchGatesNoDefaultAborted.SetAuthor( 'JR' ) + GraphSwitchGatesNoDefaultAborted.SetComment( '' ) + GraphSwitchGatesNoDefaultAborted.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsOdd = [] + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd() : ' ) + PyIsOdd.append( ' sleep(1) ' ) + PyIsOdd.append( ' return ' ) + IsOdd = GraphSwitchGatesNoDefaultAborted.INode( 'IsOdd' , PyIsOdd ) + IsOdd.SetName( 'IsOdd' ) + IsOdd.SetAuthor( '' ) + IsOdd.SetComment( 'Compute Node' ) + IsOdd.Coords( 424 , 116 ) + IIsOddGate = IsOdd.GetInPort( 'Gate' ) + OIsOddGate = IsOdd.GetOutPort( 'Gate' ) + + PyIsEven = [] + PyIsEven.append( 'from time import * ' ) + PyIsEven.append( 'def IsEven() : ' ) + PyIsEven.append( ' sleep(1) ' ) + PyIsEven.append( ' return ' ) + IsEven = GraphSwitchGatesNoDefaultAborted.INode( 'IsEven' , PyIsEven ) + IsEven.SetName( 'IsEven' ) + IsEven.SetAuthor( '' ) + IsEven.SetComment( 'Compute Node' ) + IsEven.Coords( 428 , 345 ) + IIsEvenGate = IsEven.GetInPort( 'Gate' ) + OIsEvenGate = IsEven.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyLoopGates = [] + PyLoopGates.append( 'def InitLoop(Index,Max,Min) : ' ) + PyLoopGates.append( ' Index = Max ' ) + PyLoopGates.append( ' return Index,Max,Min ' ) + PyMoreLoopGates = [] + PyMoreLoopGates.append( 'from time import * ' ) + PyMoreLoopGates.append( 'def MoreLoop(Index,Max,Min) : ' ) + PyMoreLoopGates.append( ' sleep(1) ' ) + PyMoreLoopGates.append( ' DoLoop = 0 ' ) + PyMoreLoopGates.append( ' if Index >= Min : ' ) + PyMoreLoopGates.append( ' DoLoop = 1 ' ) + PyMoreLoopGates.append( ' return DoLoop,Index,Max,Min ' ) + PyNextLoopGates = [] + PyNextLoopGates.append( 'def NextLoop(Index,Max,Min) : ' ) + PyNextLoopGates.append( ' Index = Index - 1 ' ) + PyNextLoopGates.append( ' return Index,Max,Min ' ) + LoopGates,EndLoopGates = GraphSwitchGatesNoDefaultAborted.LNode( 'InitLoop' , PyLoopGates , 'MoreLoop' , PyMoreLoopGates , 'NextLoop' , PyNextLoopGates ) + EndLoopGates.SetName( 'EndLoopGates' ) + EndLoopGates.SetAuthor( '' ) + EndLoopGates.SetComment( 'Compute Node' ) + EndLoopGates.Coords( 875 , 216 ) + PyEndLoopGates = [] + EndLoopGates.SetPyFunction( 'EndLoopGates' , PyEndLoopGates ) + ILoopGatesDoLoop = LoopGates.GetInPort( 'DoLoop' ) + ILoopGatesIndex = LoopGates.InPort( 'Index' , 'long' ) + ILoopGatesMax = LoopGates.InPort( 'Max' , 'long' ) + ILoopGatesMin = LoopGates.InPort( 'Min' , 'long' ) + ILoopGatesGate = LoopGates.GetInPort( 'Gate' ) + OLoopGatesDoLoop = LoopGates.GetOutPort( 'DoLoop' ) + OLoopGatesIndex = LoopGates.GetOutPort( 'Index' ) + OLoopGatesMax = LoopGates.GetOutPort( 'Max' ) + OLoopGatesMin = LoopGates.GetOutPort( 'Min' ) + IEndLoopGatesDoLoop = EndLoopGates.GetInPort( 'DoLoop' ) + IEndLoopGatesIndex = EndLoopGates.GetInPort( 'Index' ) + IEndLoopGatesMax = EndLoopGates.GetInPort( 'Max' ) + IEndLoopGatesMin = EndLoopGates.GetInPort( 'Min' ) + IEndLoopGatesGate = EndLoopGates.GetInPort( 'Gate' ) + OEndLoopGatesDoLoop = EndLoopGates.GetOutPort( 'DoLoop' ) + OEndLoopGatesIndex = EndLoopGates.GetOutPort( 'Index' ) + OEndLoopGatesMax = EndLoopGates.GetOutPort( 'Max' ) + OEndLoopGatesMin = EndLoopGates.GetOutPort( 'Min' ) + OEndLoopGatesGate = EndLoopGates.GetOutPort( 'Gate' ) + LoopGates.SetName( 'LoopGates' ) + LoopGates.SetAuthor( '' ) + LoopGates.SetComment( 'Compute Node' ) + LoopGates.Coords( 13 , 236 ) + + # Creation of Switch Nodes + PySwitchGates = [] + PySwitchGates.append( 'def SwitchGates(Index) : ' ) + PySwitchGates.append( ' Odd = 0 ' ) + PySwitchGates.append( ' Even = 0 ' ) + PySwitchGates.append( ' if Index > 0 : ' ) + PySwitchGates.append( ' if (Index & 1) == 1 : ' ) + PySwitchGates.append( ' Odd = 1 ' ) + PySwitchGates.append( ' if (Index & 1) == 0 : ' ) + PySwitchGates.append( ' Even = 1 ' ) + PySwitchGates.append( ' return Odd,Even ' ) + SwitchGates,EndSwitchGates = GraphSwitchGatesNoDefaultAborted.SNode( 'SwitchGates' , PySwitchGates ) + EndSwitchGates.SetName( 'EndSwitchGates' ) + EndSwitchGates.SetAuthor( '' ) + EndSwitchGates.SetComment( 'Compute Node' ) + EndSwitchGates.Coords( 648 , 276 ) + PyEndSwitchGates = [] + PyEndSwitchGates.append( 'from time import * ' ) + PyEndSwitchGates.append( 'def EndSwitchGates() : ' ) + PyEndSwitchGates.append( ' sleep(1) ' ) + PyEndSwitchGates.append( ' return ' ) + PyEndSwitchGates.append( '' ) + EndSwitchGates.SetPyFunction( 'EndSwitchGates' , PyEndSwitchGates ) + IEndSwitchGatesDefault = EndSwitchGates.GetInPort( 'Default' ) + OEndSwitchGatesGate = EndSwitchGates.GetOutPort( 'Gate' ) + SwitchGates.SetName( 'SwitchGates' ) + SwitchGates.SetAuthor( '' ) + SwitchGates.SetComment( 'Compute Node' ) + SwitchGates.Coords( 204 , 236 ) + ISwitchGatesIndex = SwitchGates.InPort( 'Index' , 'long' ) + ISwitchGatesGate = SwitchGates.GetInPort( 'Gate' ) + OSwitchGatesOdd = SwitchGates.OutPort( 'Odd' , 'long' ) + OSwitchGatesEven = SwitchGates.OutPort( 'Even' , 'long' ) + OSwitchGatesDefault = SwitchGates.GetOutPort( 'Default' ) + + # Creation of Links + LLoopGatesIndexEndLoopGatesIndex = GraphSwitchGatesNoDefaultAborted.Link( OLoopGatesIndex , IEndLoopGatesIndex ) + + LLoopGatesIndexSwitchGatesIndex = GraphSwitchGatesNoDefaultAborted.Link( OLoopGatesIndex , ISwitchGatesIndex ) + + LLoopGatesMaxEndLoopGatesMax = GraphSwitchGatesNoDefaultAborted.Link( OLoopGatesMax , IEndLoopGatesMax ) + + LLoopGatesMinEndLoopGatesMin = GraphSwitchGatesNoDefaultAborted.Link( OLoopGatesMin , IEndLoopGatesMin ) + + LSwitchGatesOddIsOddGate = GraphSwitchGatesNoDefaultAborted.Link( OSwitchGatesOdd , IIsOddGate ) + + LSwitchGatesEvenIsEvenGate = GraphSwitchGatesNoDefaultAborted.Link( OSwitchGatesEven , IIsEvenGate ) + + LEndSwitchGatesGateEndLoopGatesGate = GraphSwitchGatesNoDefaultAborted.Link( OEndSwitchGatesGate , IEndLoopGatesGate ) + + LIsOddGateEndSwitchGatesDefault = GraphSwitchGatesNoDefaultAborted.Link( OIsOddGate , IEndSwitchGatesDefault ) + + LIsEvenGateEndSwitchGatesDefault = GraphSwitchGatesNoDefaultAborted.Link( OIsEvenGate , IEndSwitchGatesDefault ) + + # Input datas + ILoopGatesIndex.Input( 0 ) + ILoopGatesMax.Input( 13 ) + ILoopGatesMin.Input( -7 ) + + # Output Ports of the graph + #OEndLoopGatesIndex = EndLoopGates.GetOutPort( 'Index' ) + #OEndLoopGatesMax = EndLoopGates.GetOutPort( 'Max' ) + #OEndLoopGatesMin = EndLoopGates.GetOutPort( 'Min' ) + return GraphSwitchGatesNoDefaultAborted + + +GraphSwitchGatesNoDefaultAborted = DefGraphSwitchGatesNoDefaultAborted() diff --git a/examples/GraphSwitchGatesNoDefaultAborted.xml b/examples/GraphSwitchGatesNoDefaultAborted.xml new file mode 100644 index 0000000..76ee607 --- /dev/null +++ b/examples/GraphSwitchGatesNoDefaultAborted.xml @@ -0,0 +1,355 @@ + + + + + +? + ? + GraphSwitchGatesNoDefaultAborted + 1 + ? + +GraphSwitchGatesDefault_1 + + +long + LoopGates__Index + +long + LoopGates__Max + +long + LoopGates__Min + + +long + EndLoopGates__Index + +long + EndLoopGates__Max + +long + EndLoopGates__Min + + + 16/2/2005 - 10:40:8 + 16/2/2005 - 12:12:25 + 2.0 + JR + ? + ? + 0 + 0 + + +? + ? + LoopGates + 4 + EndLoopGates + +LoopGates + + +long + Index + +long + Max + +long + Min + + +long + Index + +long + Max + +long + Min + + + +InitLoop + + + + +MoreLoop + + + + + = Min : ]]> + + + +NextLoop + + + + 16/2/2005 - 12:12:25 + 16/2/2005 - 12:12:25 + 2.0 + ? + ? + Compute Node + 13 + 236 + +? + ? + EndLoopGates + 5 + LoopGates + +EndLoopGates + + +long + Index + +long + Max + +long + Min + + +long + Index + +long + Max + +long + Min + + + +EndLoopGates + + 16/2/2005 - 12:12:25 + 16/2/2005 - 12:12:25 + 2.0 + ? + ? + Compute Node + 875 + 216 + +? + ? + SwitchGates + 6 + EndSwitchGates + +SwitchGates + + +long + Index + + +long + Odd + +long + Even + + + +SwitchGates + + + + 0 : ]]> + + + + + + 16/2/2005 - 12:12:25 + 16/2/2005 - 12:12:25 + 2.0 + ? + ? + Compute Node + 204 + 236 + +? + ? + EndSwitchGates + 7 + SwitchGates + +EndSwitchGates + + + + + +EndSwitchGates + + + + + + 16/2/2005 - 12:12:25 + 16/2/2005 - 12:12:25 + 2.0 + ? + ? + Compute Node + 648 + 276 + +? + ? + IsOdd + 3 + ? + +IsOdd + + + + + +IsOdd + + + + + 16/2/2005 - 12:12:25 + 16/2/2005 - 12:12:25 + 2.0 + ? + ? + Compute Node + 424 + 116 + +? + ? + IsEven + 3 + ? + +IsEven + + + + + +IsEven + + + + + 16/2/2005 - 12:12:25 + 16/2/2005 - 12:12:25 + 2.0 + ? + ? + Compute Node + 428 + 345 + + +LoopGates + DoLoop + EndLoopGates + DoLoop + + +LoopGates + Index + EndLoopGates + Index + + +LoopGates + Index + SwitchGates + Index + + +LoopGates + Max + EndLoopGates + Max + + +LoopGates + Min + EndLoopGates + Min + + +EndLoopGates + DoLoop + LoopGates + DoLoop + + +SwitchGates + Odd + IsOdd + Gate + + +SwitchGates + Even + IsEven + Gate + + +EndSwitchGates + Gate + EndLoopGates + Gate + + +IsOdd + Gate + EndSwitchGates + Default + + +IsEven + Gate + EndSwitchGates + Default + + + +GraphSwitchGatesNoDefaultAborted + LoopGates__Index + LoopGates + Index + +3 + 0 + + +GraphSwitchGatesNoDefaultAborted + LoopGates__Max + LoopGates + Max + +3 + 13 + + +GraphSwitchGatesNoDefaultAborted + LoopGates__Min + LoopGates + Min + +3 + -7 + diff --git a/examples/GraphSwitchGatesdefault.py b/examples/GraphSwitchGatesdefault.py new file mode 100644 index 0000000..0a5ccdf --- /dev/null +++ b/examples/GraphSwitchGatesdefault.py @@ -0,0 +1,163 @@ + +# Generated python file of Graph GraphSwitchGatesdefault + +from SuperV import * + +# Graph creation of GraphSwitchGatesdefault +def DefGraphSwitchGatesdefault() : + GraphSwitchGatesdefault = Graph( 'GraphSwitchGatesdefault' ) + GraphSwitchGatesdefault.SetName( 'GraphSwitchGatesdefault' ) + GraphSwitchGatesdefault.SetAuthor( 'JR' ) + GraphSwitchGatesdefault.SetComment( '' ) + GraphSwitchGatesdefault.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsOdd = [] + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd() : ' ) + PyIsOdd.append( ' sleep(1) ' ) + PyIsOdd.append( ' return ' ) + IsOdd = GraphSwitchGatesdefault.INode( 'IsOdd' , PyIsOdd ) + IsOdd.SetName( 'IsOdd' ) + IsOdd.SetAuthor( '' ) + IsOdd.SetComment( 'Compute Node' ) + IsOdd.Coords( 424 , 116 ) + IIsOddGate = IsOdd.GetInPort( 'Gate' ) + OIsOddGate = IsOdd.GetOutPort( 'Gate' ) + + PyIsEven = [] + PyIsEven.append( 'from time import * ' ) + PyIsEven.append( 'def IsEven() : ' ) + PyIsEven.append( ' sleep(1) ' ) + PyIsEven.append( ' return ' ) + IsEven = GraphSwitchGatesdefault.INode( 'IsEven' , PyIsEven ) + IsEven.SetName( 'IsEven' ) + IsEven.SetAuthor( '' ) + IsEven.SetComment( 'Compute Node' ) + IsEven.Coords( 428 , 345 ) + IIsEvenGate = IsEven.GetInPort( 'Gate' ) + OIsEvenGate = IsEven.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyLoopGates = [] + PyLoopGates.append( 'def InitLoop(Index,Max,Min) : ' ) + PyLoopGates.append( ' Index = Max ' ) + PyLoopGates.append( ' return Index,Max,Min ' ) + PyMoreLoopGates = [] + PyMoreLoopGates.append( 'from time import * ' ) + PyMoreLoopGates.append( 'def MoreLoop(Index,Max,Min) : ' ) + PyMoreLoopGates.append( ' sleep(1) ' ) + PyMoreLoopGates.append( ' DoLoop = 0 ' ) + PyMoreLoopGates.append( ' if Index >= Min : ' ) + PyMoreLoopGates.append( ' DoLoop = 1 ' ) + PyMoreLoopGates.append( ' return DoLoop,Index,Max,Min ' ) + PyNextLoopGates = [] + PyNextLoopGates.append( 'def NextLoop(Index,Max,Min) : ' ) + PyNextLoopGates.append( ' Index = Index - 1 ' ) + PyNextLoopGates.append( ' return Index,Max,Min ' ) + LoopGates,EndLoopGates = GraphSwitchGatesdefault.LNode( 'InitLoop' , PyLoopGates , 'MoreLoop' , PyMoreLoopGates , 'NextLoop' , PyNextLoopGates ) + EndLoopGates.SetName( 'EndLoopGates' ) + EndLoopGates.SetAuthor( '' ) + EndLoopGates.SetComment( 'Compute Node' ) + EndLoopGates.Coords( 875 , 216 ) + PyEndLoopGates = [] + EndLoopGates.SetPyFunction( 'EndLoopGates' , PyEndLoopGates ) + ILoopGatesDoLoop = LoopGates.GetInPort( 'DoLoop' ) + ILoopGatesIndex = LoopGates.InPort( 'Index' , 'long' ) + ILoopGatesMax = LoopGates.InPort( 'Max' , 'long' ) + ILoopGatesMin = LoopGates.InPort( 'Min' , 'long' ) + ILoopGatesGate = LoopGates.GetInPort( 'Gate' ) + OLoopGatesDoLoop = LoopGates.GetOutPort( 'DoLoop' ) + OLoopGatesIndex = LoopGates.GetOutPort( 'Index' ) + OLoopGatesMax = LoopGates.GetOutPort( 'Max' ) + OLoopGatesMin = LoopGates.GetOutPort( 'Min' ) + IEndLoopGatesDoLoop = EndLoopGates.GetInPort( 'DoLoop' ) + IEndLoopGatesIndex = EndLoopGates.GetInPort( 'Index' ) + IEndLoopGatesMax = EndLoopGates.GetInPort( 'Max' ) + IEndLoopGatesMin = EndLoopGates.GetInPort( 'Min' ) + IEndLoopGatesGate = EndLoopGates.GetInPort( 'Gate' ) + OEndLoopGatesDoLoop = EndLoopGates.GetOutPort( 'DoLoop' ) + OEndLoopGatesIndex = EndLoopGates.GetOutPort( 'Index' ) + OEndLoopGatesMax = EndLoopGates.GetOutPort( 'Max' ) + OEndLoopGatesMin = EndLoopGates.GetOutPort( 'Min' ) + OEndLoopGatesGate = EndLoopGates.GetOutPort( 'Gate' ) + LoopGates.SetName( 'LoopGates' ) + LoopGates.SetAuthor( '' ) + LoopGates.SetComment( 'Compute Node' ) + LoopGates.Coords( 13 , 236 ) + + # Creation of Switch Nodes + PySwitchGates = [] + PySwitchGates.append( 'def SwitchGates(Index) : ' ) + PySwitchGates.append( ' Odd = 0 ' ) + PySwitchGates.append( ' Even = 0 ' ) + PySwitchGates.append( ' default = 0 ' ) + PySwitchGates.append( ' if Index > 0 : ' ) + PySwitchGates.append( ' if (Index & 1) == 1 : ' ) + PySwitchGates.append( ' Odd = 1 ' ) + PySwitchGates.append( ' if (Index & 1) == 0 : ' ) + PySwitchGates.append( ' Even = 1 ' ) + PySwitchGates.append( ' else : ' ) + PySwitchGates.append( ' default = 1 ' ) + PySwitchGates.append( ' return Odd,Even,default ' ) + SwitchGates,EndSwitchGates = GraphSwitchGatesdefault.SNode( 'SwitchGates' , PySwitchGates ) + EndSwitchGates.SetName( 'EndSwitchGates' ) + EndSwitchGates.SetAuthor( '' ) + EndSwitchGates.SetComment( 'Compute Node' ) + EndSwitchGates.Coords( 648 , 276 ) + PyEndSwitchGates = [] + PyEndSwitchGates.append( 'from time import * ' ) + PyEndSwitchGates.append( 'def EndSwitchGates() : ' ) + PyEndSwitchGates.append( ' sleep(1) ' ) + PyEndSwitchGates.append( ' return ' ) + PyEndSwitchGates.append( '' ) + EndSwitchGates.SetPyFunction( 'EndSwitchGates' , PyEndSwitchGates ) + IEndSwitchGatesDefault = EndSwitchGates.GetInPort( 'Default' ) + OEndSwitchGatesGate = EndSwitchGates.GetOutPort( 'Gate' ) + SwitchGates.SetName( 'SwitchGates' ) + SwitchGates.SetAuthor( '' ) + SwitchGates.SetComment( 'Compute Node' ) + SwitchGates.Coords( 204 , 236 ) + ISwitchGatesIndex = SwitchGates.InPort( 'Index' , 'long' ) + ISwitchGatesGate = SwitchGates.GetInPort( 'Gate' ) + OSwitchGatesOdd = SwitchGates.OutPort( 'Odd' , 'long' ) + OSwitchGatesEven = SwitchGates.OutPort( 'Even' , 'long' ) + OSwitchGatesdefault = SwitchGates.OutPort( 'default' , 'long' ) + OSwitchGatesDefault = SwitchGates.GetOutPort( 'Default' ) + + # Creation of Links + LLoopGatesIndexEndLoopGatesIndex = GraphSwitchGatesdefault.Link( OLoopGatesIndex , IEndLoopGatesIndex ) + + LLoopGatesIndexSwitchGatesIndex = GraphSwitchGatesdefault.Link( OLoopGatesIndex , ISwitchGatesIndex ) + + LLoopGatesMaxEndLoopGatesMax = GraphSwitchGatesdefault.Link( OLoopGatesMax , IEndLoopGatesMax ) + + LLoopGatesMinEndLoopGatesMin = GraphSwitchGatesdefault.Link( OLoopGatesMin , IEndLoopGatesMin ) + + LSwitchGatesOddIsOddGate = GraphSwitchGatesdefault.Link( OSwitchGatesOdd , IIsOddGate ) + + LSwitchGatesEvenIsEvenGate = GraphSwitchGatesdefault.Link( OSwitchGatesEven , IIsEvenGate ) + + LSwitchGatesdefaultEndSwitchGatesDefault = GraphSwitchGatesdefault.Link( OSwitchGatesdefault , IEndSwitchGatesDefault ) + + LEndSwitchGatesGateEndLoopGatesGate = GraphSwitchGatesdefault.Link( OEndSwitchGatesGate , IEndLoopGatesGate ) + + LIsOddGateEndSwitchGatesDefault = GraphSwitchGatesdefault.Link( OIsOddGate , IEndSwitchGatesDefault ) + + LIsEvenGateEndSwitchGatesDefault = GraphSwitchGatesdefault.Link( OIsEvenGate , IEndSwitchGatesDefault ) + + # Input datas + ILoopGatesIndex.Input( 0 ) + ILoopGatesMax.Input( 13 ) + ILoopGatesMin.Input( -7 ) + + # Output Ports of the graph + #OEndLoopGatesIndex = EndLoopGates.GetOutPort( 'Index' ) + #OEndLoopGatesMax = EndLoopGates.GetOutPort( 'Max' ) + #OEndLoopGatesMin = EndLoopGates.GetOutPort( 'Min' ) + return GraphSwitchGatesdefault + + +GraphSwitchGatesdefault = DefGraphSwitchGatesdefault() diff --git a/examples/GraphSwitchGatesdefault.xml b/examples/GraphSwitchGatesdefault.xml new file mode 100644 index 0000000..e4a0692 --- /dev/null +++ b/examples/GraphSwitchGatesdefault.xml @@ -0,0 +1,367 @@ + + + + + +? + ? + GraphSwitchGatesdefault + 1 + ? + +GraphSwitchGatesdefault + + +long + LoopGates__Index + +long + LoopGates__Max + +long + LoopGates__Min + + +long + EndLoopGates__Index + +long + EndLoopGates__Max + +long + EndLoopGates__Min + + + 16/2/2005 - 10:40:8 + 16/2/2005 - 12:13:31 + 2.0 + JR + ? + ? + 0 + 0 + + +? + ? + LoopGates + 4 + EndLoopGates + +LoopGates + + +long + Index + +long + Max + +long + Min + + +long + Index + +long + Max + +long + Min + + + +InitLoop + + + + +MoreLoop + + + + + = Min : ]]> + + + +NextLoop + + + + 16/2/2005 - 12:13:25 + 16/2/2005 - 12:13:25 + 2.0 + ? + ? + Compute Node + 13 + 236 + +? + ? + EndLoopGates + 5 + LoopGates + +EndLoopGates + + +long + Index + +long + Max + +long + Min + + +long + Index + +long + Max + +long + Min + + + +EndLoopGates + + 16/2/2005 - 12:13:25 + 16/2/2005 - 12:13:25 + 2.0 + ? + ? + Compute Node + 875 + 216 + +? + ? + SwitchGates + 6 + EndSwitchGates + +SwitchGates + + +long + Index + + +long + Odd + +long + Even + +long + default + + + +SwitchGates + + + + + 0 : ]]> + + + + + + + + 16/2/2005 - 12:13:25 + 16/2/2005 - 12:13:25 + 2.0 + ? + ? + Compute Node + 204 + 236 + +? + ? + EndSwitchGates + 7 + SwitchGates + +EndSwitchGates + + + + + +EndSwitchGates + + + + + + 16/2/2005 - 12:13:25 + 16/2/2005 - 12:13:25 + 2.0 + ? + ? + Compute Node + 648 + 276 + +? + ? + IsOdd + 3 + ? + +IsOdd + + + + + +IsOdd + + + + + 16/2/2005 - 12:13:25 + 16/2/2005 - 12:13:25 + 2.0 + ? + ? + Compute Node + 424 + 116 + +? + ? + IsEven + 3 + ? + +IsEven + + + + + +IsEven + + + + + 16/2/2005 - 12:13:25 + 16/2/2005 - 12:13:25 + 2.0 + ? + ? + Compute Node + 428 + 345 + + +LoopGates + DoLoop + EndLoopGates + DoLoop + + +LoopGates + Index + EndLoopGates + Index + + +LoopGates + Index + SwitchGates + Index + + +LoopGates + Max + EndLoopGates + Max + + +LoopGates + Min + EndLoopGates + Min + + +EndLoopGates + DoLoop + LoopGates + DoLoop + + +SwitchGates + Odd + IsOdd + Gate + + +SwitchGates + Even + IsEven + Gate + + +SwitchGates + default + EndSwitchGates + Default + + +EndSwitchGates + Gate + EndLoopGates + Gate + + +IsOdd + Gate + EndSwitchGates + Default + + +IsEven + Gate + EndSwitchGates + Default + + + +GraphSwitchGatesdefault + LoopGates__Index + LoopGates + Index + +3 + 0 + + +GraphSwitchGatesdefault + LoopGates__Max + LoopGates + Max + +3 + 13 + + +GraphSwitchGatesdefault + LoopGates__Min + LoopGates + Min + +3 + -7 + diff --git a/examples/GraphSwitchGatesdefaultBranch.py b/examples/GraphSwitchGatesdefaultBranch.py new file mode 100644 index 0000000..14b03d0 --- /dev/null +++ b/examples/GraphSwitchGatesdefaultBranch.py @@ -0,0 +1,178 @@ + +# Generated python file of Graph GraphSwitchGatesdefaultBranch + +from SuperV import * + +# Graph creation of GraphSwitchGatesdefaultBranch +def DefGraphSwitchGatesdefaultBranch() : + GraphSwitchGatesdefaultBranch = Graph( 'GraphSwitchGatesdefaultBranch' ) + GraphSwitchGatesdefaultBranch.SetName( 'GraphSwitchGatesdefaultBranch' ) + GraphSwitchGatesdefaultBranch.SetAuthor( 'JR' ) + GraphSwitchGatesdefaultBranch.SetComment( '' ) + GraphSwitchGatesdefaultBranch.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsOdd = [] + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd() : ' ) + PyIsOdd.append( ' sleep(1) ' ) + PyIsOdd.append( ' return ' ) + IsOdd = GraphSwitchGatesdefaultBranch.INode( 'IsOdd' , PyIsOdd ) + IsOdd.SetName( 'IsOdd' ) + IsOdd.SetAuthor( '' ) + IsOdd.SetComment( 'Compute Node' ) + IsOdd.Coords( 424 , 116 ) + IIsOddGate = IsOdd.GetInPort( 'Gate' ) + OIsOddGate = IsOdd.GetOutPort( 'Gate' ) + + PyIsEven = [] + PyIsEven.append( 'from time import * ' ) + PyIsEven.append( 'def IsEven() : ' ) + PyIsEven.append( ' sleep(1) ' ) + PyIsEven.append( ' return ' ) + IsEven = GraphSwitchGatesdefaultBranch.INode( 'IsEven' , PyIsEven ) + IsEven.SetName( 'IsEven' ) + IsEven.SetAuthor( '' ) + IsEven.SetComment( 'Compute Node' ) + IsEven.Coords( 428 , 345 ) + IIsEvenGate = IsEven.GetInPort( 'Gate' ) + OIsEvenGate = IsEven.GetOutPort( 'Gate' ) + + PydefaultNode = [] + PydefaultNode.append( 'from time import * ' ) + PydefaultNode.append( 'def defaultNode() : ' ) + PydefaultNode.append( ' sleep(1) ' ) + PydefaultNode.append( ' return ' ) + defaultNode = GraphSwitchGatesdefaultBranch.INode( 'defaultNode' , PydefaultNode ) + defaultNode.SetName( 'defaultNode' ) + defaultNode.SetAuthor( '' ) + defaultNode.SetComment( 'Compute Node' ) + defaultNode.Coords( 425 , 232 ) + IdefaultNodeGate = defaultNode.GetInPort( 'Gate' ) + OdefaultNodeGate = defaultNode.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyLoopGates = [] + PyLoopGates.append( 'def InitLoop(Index,Max,Min) : ' ) + PyLoopGates.append( ' Index = Max ' ) + PyLoopGates.append( ' return Index,Max,Min ' ) + PyMoreLoopGates = [] + PyMoreLoopGates.append( 'from time import * ' ) + PyMoreLoopGates.append( 'def MoreLoop(Index,Max,Min) : ' ) + PyMoreLoopGates.append( ' sleep(1) ' ) + PyMoreLoopGates.append( ' DoLoop = 0 ' ) + PyMoreLoopGates.append( ' if Index >= Min : ' ) + PyMoreLoopGates.append( ' DoLoop = 1 ' ) + PyMoreLoopGates.append( ' return DoLoop,Index,Max,Min ' ) + PyNextLoopGates = [] + PyNextLoopGates.append( 'def NextLoop(Index,Max,Min) : ' ) + PyNextLoopGates.append( ' Index = Index - 1 ' ) + PyNextLoopGates.append( ' return Index,Max,Min ' ) + LoopGates,EndLoopGates = GraphSwitchGatesdefaultBranch.LNode( 'InitLoop' , PyLoopGates , 'MoreLoop' , PyMoreLoopGates , 'NextLoop' , PyNextLoopGates ) + EndLoopGates.SetName( 'EndLoopGates' ) + EndLoopGates.SetAuthor( '' ) + EndLoopGates.SetComment( 'Compute Node' ) + EndLoopGates.Coords( 875 , 216 ) + PyEndLoopGates = [] + EndLoopGates.SetPyFunction( 'EndLoopGates' , PyEndLoopGates ) + ILoopGatesDoLoop = LoopGates.GetInPort( 'DoLoop' ) + ILoopGatesIndex = LoopGates.InPort( 'Index' , 'long' ) + ILoopGatesMax = LoopGates.InPort( 'Max' , 'long' ) + ILoopGatesMin = LoopGates.InPort( 'Min' , 'long' ) + ILoopGatesGate = LoopGates.GetInPort( 'Gate' ) + OLoopGatesDoLoop = LoopGates.GetOutPort( 'DoLoop' ) + OLoopGatesIndex = LoopGates.GetOutPort( 'Index' ) + OLoopGatesMax = LoopGates.GetOutPort( 'Max' ) + OLoopGatesMin = LoopGates.GetOutPort( 'Min' ) + IEndLoopGatesDoLoop = EndLoopGates.GetInPort( 'DoLoop' ) + IEndLoopGatesIndex = EndLoopGates.GetInPort( 'Index' ) + IEndLoopGatesMax = EndLoopGates.GetInPort( 'Max' ) + IEndLoopGatesMin = EndLoopGates.GetInPort( 'Min' ) + IEndLoopGatesGate = EndLoopGates.GetInPort( 'Gate' ) + OEndLoopGatesDoLoop = EndLoopGates.GetOutPort( 'DoLoop' ) + OEndLoopGatesIndex = EndLoopGates.GetOutPort( 'Index' ) + OEndLoopGatesMax = EndLoopGates.GetOutPort( 'Max' ) + OEndLoopGatesMin = EndLoopGates.GetOutPort( 'Min' ) + OEndLoopGatesGate = EndLoopGates.GetOutPort( 'Gate' ) + LoopGates.SetName( 'LoopGates' ) + LoopGates.SetAuthor( '' ) + LoopGates.SetComment( 'Compute Node' ) + LoopGates.Coords( 13 , 236 ) + + # Creation of Switch Nodes + PySwitchGates = [] + PySwitchGates.append( 'def SwitchGates(Index) : ' ) + PySwitchGates.append( ' Odd = 0 ' ) + PySwitchGates.append( ' Even = 0 ' ) + PySwitchGates.append( ' default = 0 ' ) + PySwitchGates.append( ' if Index > 0 : ' ) + PySwitchGates.append( ' if (Index & 1) == 1 : ' ) + PySwitchGates.append( ' Odd = 1 ' ) + PySwitchGates.append( ' if (Index & 1) == 0 : ' ) + PySwitchGates.append( ' Even = 1 ' ) + PySwitchGates.append( ' else : ' ) + PySwitchGates.append( ' default = 1 ' ) + PySwitchGates.append( ' return Odd,Even,default ' ) + SwitchGates,EndSwitchGates = GraphSwitchGatesdefaultBranch.SNode( 'SwitchGates' , PySwitchGates ) + EndSwitchGates.SetName( 'EndSwitchGates' ) + EndSwitchGates.SetAuthor( '' ) + EndSwitchGates.SetComment( 'Compute Node' ) + EndSwitchGates.Coords( 647 , 272 ) + PyEndSwitchGates = [] + PyEndSwitchGates.append( 'from time import * ' ) + PyEndSwitchGates.append( 'def EndSwitchGates() : ' ) + PyEndSwitchGates.append( ' sleep(1) ' ) + PyEndSwitchGates.append( ' return ' ) + PyEndSwitchGates.append( '' ) + EndSwitchGates.SetPyFunction( 'EndSwitchGates' , PyEndSwitchGates ) + IEndSwitchGatesDefault = EndSwitchGates.GetInPort( 'Default' ) + OEndSwitchGatesGate = EndSwitchGates.GetOutPort( 'Gate' ) + SwitchGates.SetName( 'SwitchGates' ) + SwitchGates.SetAuthor( '' ) + SwitchGates.SetComment( 'Compute Node' ) + SwitchGates.Coords( 204 , 236 ) + ISwitchGatesIndex = SwitchGates.InPort( 'Index' , 'long' ) + ISwitchGatesGate = SwitchGates.GetInPort( 'Gate' ) + OSwitchGatesOdd = SwitchGates.OutPort( 'Odd' , 'long' ) + OSwitchGatesEven = SwitchGates.OutPort( 'Even' , 'long' ) + OSwitchGatesdefault = SwitchGates.OutPort( 'default' , 'long' ) + OSwitchGatesDefault = SwitchGates.GetOutPort( 'Default' ) + + # Creation of Links + LLoopGatesIndexEndLoopGatesIndex = GraphSwitchGatesdefaultBranch.Link( OLoopGatesIndex , IEndLoopGatesIndex ) + + LLoopGatesIndexSwitchGatesIndex = GraphSwitchGatesdefaultBranch.Link( OLoopGatesIndex , ISwitchGatesIndex ) + + LLoopGatesMaxEndLoopGatesMax = GraphSwitchGatesdefaultBranch.Link( OLoopGatesMax , IEndLoopGatesMax ) + + LLoopGatesMinEndLoopGatesMin = GraphSwitchGatesdefaultBranch.Link( OLoopGatesMin , IEndLoopGatesMin ) + + LSwitchGatesOddIsOddGate = GraphSwitchGatesdefaultBranch.Link( OSwitchGatesOdd , IIsOddGate ) + + LSwitchGatesEvenIsEvenGate = GraphSwitchGatesdefaultBranch.Link( OSwitchGatesEven , IIsEvenGate ) + + LSwitchGatesdefaultdefaultNodeGate = GraphSwitchGatesdefaultBranch.Link( OSwitchGatesdefault , IdefaultNodeGate ) + + LEndSwitchGatesGateEndLoopGatesGate = GraphSwitchGatesdefaultBranch.Link( OEndSwitchGatesGate , IEndLoopGatesGate ) + + LIsOddGateEndSwitchGatesDefault = GraphSwitchGatesdefaultBranch.Link( OIsOddGate , IEndSwitchGatesDefault ) + + LIsEvenGateEndSwitchGatesDefault = GraphSwitchGatesdefaultBranch.Link( OIsEvenGate , IEndSwitchGatesDefault ) + + LdefaultNodeGateEndSwitchGatesDefault = GraphSwitchGatesdefaultBranch.Link( OdefaultNodeGate , IEndSwitchGatesDefault ) + + # Input datas + ILoopGatesIndex.Input( 0 ) + ILoopGatesMax.Input( 13 ) + ILoopGatesMin.Input( -7 ) + + # Output Ports of the graph + #OEndLoopGatesIndex = EndLoopGates.GetOutPort( 'Index' ) + #OEndLoopGatesMax = EndLoopGates.GetOutPort( 'Max' ) + #OEndLoopGatesMin = EndLoopGates.GetOutPort( 'Min' ) + return GraphSwitchGatesdefaultBranch + + +GraphSwitchGatesdefaultBranch = DefGraphSwitchGatesdefaultBranch() diff --git a/examples/GraphSwitchGatesdefaultBranch.xml b/examples/GraphSwitchGatesdefaultBranch.xml new file mode 100644 index 0000000..811665e --- /dev/null +++ b/examples/GraphSwitchGatesdefaultBranch.xml @@ -0,0 +1,399 @@ + + + + + +? + ? + GraphSwitchGatesdefaultBranch + 1 + ? + +GraphSwitchGatesdefaultBranch + + +long + LoopGates__Index + +long + LoopGates__Max + +long + LoopGates__Min + + +long + EndLoopGates__Index + +long + EndLoopGates__Max + +long + EndLoopGates__Min + + + 16/2/2005 - 10:40:8 + 16/2/2005 - 15:13:4 + 2.0 + JR + ? + ? + 0 + 0 + + +? + ? + LoopGates + 4 + EndLoopGates + +LoopGates + + +long + Index + +long + Max + +long + Min + + +long + Index + +long + Max + +long + Min + + + +InitLoop + + + + +MoreLoop + + + + + = Min : ]]> + + + +NextLoop + + + + 16/2/2005 - 15:4:47 + 16/2/2005 - 15:4:47 + 2.0 + ? + ? + Compute Node + 13 + 236 + +? + ? + EndLoopGates + 5 + LoopGates + +EndLoopGates + + +long + Index + +long + Max + +long + Min + + +long + Index + +long + Max + +long + Min + + + +EndLoopGates + + 16/2/2005 - 15:4:47 + 16/2/2005 - 15:4:47 + 2.0 + ? + ? + Compute Node + 875 + 216 + +? + ? + SwitchGates + 6 + EndSwitchGates + +SwitchGates + + +long + Index + + +long + Odd + +long + Even + +long + default + + + +SwitchGates + + + + + 0 : ]]> + + + + + + + + 16/2/2005 - 15:4:47 + 16/2/2005 - 15:4:47 + 2.0 + ? + ? + Compute Node + 204 + 236 + +? + ? + EndSwitchGates + 7 + SwitchGates + +EndSwitchGates + + + + + +EndSwitchGates + + + + + + 16/2/2005 - 15:4:47 + 16/2/2005 - 15:4:47 + 2.0 + ? + ? + Compute Node + 647 + 272 + +? + ? + IsOdd + 3 + ? + +IsOdd + + + + + +IsOdd + + + + + 16/2/2005 - 15:4:47 + 16/2/2005 - 15:4:47 + 2.0 + ? + ? + Compute Node + 424 + 116 + +? + ? + IsEven + 3 + ? + +IsEven + + + + + +IsEven + + + + + 16/2/2005 - 15:4:47 + 16/2/2005 - 15:4:47 + 2.0 + ? + ? + Compute Node + 428 + 345 + +? + ? + defaultNode + 3 + ? + +defaultNode + + + + + +defaultNode + + + + + 16/2/2005 - 15:12:49 + 16/2/2005 - 15:12:49 + 2.0 + ? + ? + Compute Node + 425 + 232 + + +LoopGates + DoLoop + EndLoopGates + DoLoop + + +LoopGates + Index + EndLoopGates + Index + + +LoopGates + Index + SwitchGates + Index + + +LoopGates + Max + EndLoopGates + Max + + +LoopGates + Min + EndLoopGates + Min + + +EndLoopGates + DoLoop + LoopGates + DoLoop + + +SwitchGates + Odd + IsOdd + Gate + + +SwitchGates + Even + IsEven + Gate + + +SwitchGates + default + defaultNode + Gate + + +EndSwitchGates + Gate + EndLoopGates + Gate + + +IsOdd + Gate + EndSwitchGates + Default + + +IsEven + Gate + EndSwitchGates + Default + + +defaultNode + Gate + EndSwitchGates + Default + + + +GraphSwitchGatesdefaultBranch + LoopGates__Index + LoopGates + Index + +3 + 0 + + +GraphSwitchGatesdefaultBranch + LoopGates__Max + LoopGates + Max + +3 + 13 + + +GraphSwitchGatesdefaultBranch + LoopGates__Min + LoopGates + Min + +3 + -7 + diff --git a/examples/GraphSwitchNOTValid.py b/examples/GraphSwitchNOTValid.py new file mode 100644 index 0000000..3c07542 --- /dev/null +++ b/examples/GraphSwitchNOTValid.py @@ -0,0 +1,143 @@ + +# Generated python file of Graph GraphSwitchNOTValid + +from SuperV import * + +# Graph creation of GraphSwitchNOTValid +def DefGraphSwitchNOTValid() : + GraphSwitchNOTValid = Graph( 'GraphSwitchNOTValid' ) + GraphSwitchNOTValid.SetName( 'GraphSwitchNOTValid' ) + GraphSwitchNOTValid.SetAuthor( 'JR' ) + GraphSwitchNOTValid.SetComment( '' ) + GraphSwitchNOTValid.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsOdd = [] + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd(a) : ' ) + PyIsOdd.append( ' print a,"IsOdd (GraphSwitch1)" ' ) + PyIsOdd.append( ' sleep( 1 ) ' ) + PyIsOdd.append( ' return a ' ) + IsOdd = GraphSwitchNOTValid.INode( 'IsOdd' , PyIsOdd ) + IsOdd.SetName( 'IsOdd' ) + IsOdd.SetAuthor( '' ) + IsOdd.SetComment( 'Python function' ) + IsOdd.Coords( 389 , 65 ) + IIsOdda = IsOdd.InPort( 'a' , 'long' ) + IIsOddGate = IsOdd.GetInPort( 'Gate' ) + OIsOdda = IsOdd.OutPort( 'a' , 'long' ) + OIsOddGate = IsOdd.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyInitLoop = [] + PyInitLoop.append( 'def InitLoop(Index,Min,Max) : ' ) + PyInitLoop.append( ' return Index,Min,Max ' ) + PyMoreInitLoop = [] + PyMoreInitLoop.append( 'def MoreLoop(Index,Min,Max) : ' ) + PyMoreInitLoop.append( ' if Index <= Max : ' ) + PyMoreInitLoop.append( ' DoLoop = 1 ' ) + PyMoreInitLoop.append( ' else : ' ) + PyMoreInitLoop.append( ' DoLoop = 0 ' ) + PyMoreInitLoop.append( ' return DoLoop,Index,Min,Max ' ) + PyNextInitLoop = [] + PyNextInitLoop.append( 'def NextLoop(Index,Min,Max) : ' ) + PyNextInitLoop.append( ' Index = Index + 1 ' ) + PyNextInitLoop.append( ' return Index,Min,Max ' ) + InitLoop,EndOfInitLoop = GraphSwitchNOTValid.LNode( 'InitLoop' , PyInitLoop , 'MoreLoop' , PyMoreInitLoop , 'NextLoop' , PyNextInitLoop ) + EndOfInitLoop.SetName( 'EndOfInitLoop' ) + EndOfInitLoop.SetAuthor( '' ) + EndOfInitLoop.SetComment( 'Compute Node' ) + EndOfInitLoop.Coords( 777 , 170 ) + PyEndOfInitLoop = [] + EndOfInitLoop.SetPyFunction( '' , PyEndOfInitLoop ) + IInitLoopDoLoop = InitLoop.GetInPort( 'DoLoop' ) + IInitLoopIndex = InitLoop.InPort( 'Index' , 'long' ) + IInitLoopMin = InitLoop.InPort( 'Min' , 'long' ) + IInitLoopMax = InitLoop.InPort( 'Max' , 'long' ) + IInitLoopGate = InitLoop.GetInPort( 'Gate' ) + OInitLoopDoLoop = InitLoop.GetOutPort( 'DoLoop' ) + OInitLoopIndex = InitLoop.GetOutPort( 'Index' ) + OInitLoopMin = InitLoop.GetOutPort( 'Min' ) + OInitLoopMax = InitLoop.GetOutPort( 'Max' ) + IEndOfInitLoopDoLoop = EndOfInitLoop.GetInPort( 'DoLoop' ) + IEndOfInitLoopIndex = EndOfInitLoop.GetInPort( 'Index' ) + IEndOfInitLoopMin = EndOfInitLoop.GetInPort( 'Min' ) + IEndOfInitLoopMax = EndOfInitLoop.GetInPort( 'Max' ) + IEndOfInitLoopGate = EndOfInitLoop.GetInPort( 'Gate' ) + OEndOfInitLoopDoLoop = EndOfInitLoop.GetOutPort( 'DoLoop' ) + OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) + OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) + OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) + OEndOfInitLoopGate = EndOfInitLoop.GetOutPort( 'Gate' ) + InitLoop.SetName( 'InitLoop' ) + InitLoop.SetAuthor( '' ) + InitLoop.SetComment( 'Compute Node' ) + InitLoop.Coords( 10 , 129 ) + + # Creation of Switch Nodes + PySwitch = [] + PySwitch.append( 'from time import * ' ) + PySwitch.append( 'def Switch(a) : ' ) + PySwitch.append( ' if ( a & 1 ) == 0 : ' ) + PySwitch.append( ' sleep(1) ' ) + PySwitch.append( ' return a & 1,1-(a&1),a ' ) + Switch,EndOfSwitch = GraphSwitchNOTValid.SNode( 'Switch' , PySwitch ) + EndOfSwitch.SetName( 'EndOfSwitch' ) + EndOfSwitch.SetAuthor( '' ) + EndOfSwitch.SetComment( 'Compute Node' ) + EndOfSwitch.Coords( 589 , 170 ) + PyEndOfSwitch = [] + EndOfSwitch.SetPyFunction( '' , PyEndOfSwitch ) + IEndOfSwitcha = EndOfSwitch.InPort( 'a' , 'long' ) + IEndOfSwitchDefault = EndOfSwitch.GetInPort( 'Default' ) + OEndOfSwitcha = EndOfSwitch.OutPort( 'a' , 'long' ) + OEndOfSwitchGate = EndOfSwitch.GetOutPort( 'Gate' ) + Switch.SetName( 'Switch' ) + Switch.SetAuthor( '' ) + Switch.SetComment( 'Compute Node' ) + Switch.Coords( 195 , 130 ) + ISwitcha = Switch.InPort( 'a' , 'long' ) + ISwitchGate = Switch.GetInPort( 'Gate' ) + OSwitchOdd = Switch.OutPort( 'Odd' , 'long' ) + OSwitchEven = Switch.OutPort( 'Even' , 'int' ) + OSwitcha = Switch.OutPort( 'a' , 'int' ) + OSwitchDefault = Switch.GetOutPort( 'Default' ) + + # Creation of Links + LIsOddaEndOfSwitcha = GraphSwitchNOTValid.Link( OIsOdda , IEndOfSwitcha ) + LIsOddaEndOfSwitcha.AddCoord( 1 , 571 , 201 ) + LIsOddaEndOfSwitcha.AddCoord( 2 , 571 , 136 ) + + LInitLoopIndexSwitcha = GraphSwitchNOTValid.Link( OInitLoopIndex , ISwitcha ) + + LInitLoopMinEndOfInitLoopMin = GraphSwitchNOTValid.Link( OInitLoopMin , IEndOfInitLoopMin ) + + LInitLoopMaxEndOfInitLoopMax = GraphSwitchNOTValid.Link( OInitLoopMax , IEndOfInitLoopMax ) + + LSwitchOddIsOddGate = GraphSwitchNOTValid.Link( OSwitchOdd , IIsOddGate ) + + LSwitchEvenEndOfSwitchDefault = GraphSwitchNOTValid.Link( OSwitchEven , IEndOfSwitchDefault ) + + LSwitchaIsOdda = GraphSwitchNOTValid.Link( OSwitcha , IIsOdda ) + LSwitchaIsOdda.AddCoord( 1 , 375 , 136 ) + LSwitchaIsOdda.AddCoord( 2 , 375 , 201 ) + + LSwitchDefaultEndOfSwitchDefault = GraphSwitchNOTValid.Link( OSwitchDefault , IEndOfSwitchDefault ) + + LEndOfSwitchaEndOfInitLoopIndex = GraphSwitchNOTValid.Link( OEndOfSwitcha , IEndOfInitLoopIndex ) + + # Input datas + IInitLoopIndex.Input( 0 ) + IInitLoopMin.Input( 0 ) + IInitLoopMax.Input( 23 ) + + # Output Ports of the graph + #OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) + #OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) + #OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) + return GraphSwitchNOTValid + + +GraphSwitchNOTValid = DefGraphSwitchNOTValid() diff --git a/examples/GraphSwitchNOTValid.xml b/examples/GraphSwitchNOTValid.xml new file mode 100644 index 0000000..933e9ea --- /dev/null +++ b/examples/GraphSwitchNOTValid.xml @@ -0,0 +1,347 @@ + + + + + +? + ? + GraphSwitchNOTValid + 1 + ? + +GraphSwitchNOTValid + + +long + InitLoop__Index + +long + InitLoop__Min + +long + InitLoop__Max + + +long + EndOfInitLoop__Index + +long + EndOfInitLoop__Min + +long + EndOfInitLoop__Max + + + 1/10/2003 - 17:12:48 + 16/2/2005 - 15:19:14 + 1.05 + JR + ? + ? + 0 + 0 + + +? + ? + IsOdd + 3 + ? + +IsOdd + + +long + a + + +long + a + + + +IsOdd + + + + + + 16/2/2005 - 15:16:28 + 16/2/2005 - 15:16:28 + 1.05 + ? + ? + Python function + 389 + 65 + +? + ? + InitLoop + 4 + EndOfInitLoop + +InitLoop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +InitLoop + + + +MoreLoop + + + + + + + +NextLoop + + + + 16/2/2005 - 15:16:28 + 16/2/2005 - 15:16:28 + 1.05 + ? + ? + Compute Node + 10 + 129 + +? + ? + EndOfInitLoop + 5 + InitLoop + +EndOfInitLoop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +? + + 16/2/2005 - 15:16:28 + 16/2/2005 - 15:16:28 + 1.05 + ? + ? + Compute Node + 777 + 170 + +? + ? + Switch + 6 + EndOfSwitch + +Switch + + +long + a + + +long + Odd + +int + Even + +int + a + + + +Switch + + + + + + 16/2/2005 - 15:16:28 + 16/2/2005 - 15:16:28 + 1.05 + ? + ? + Compute Node + 195 + 130 + +? + ? + EndOfSwitch + 7 + Switch + +EndOfSwitch + + +long + a + + +long + a + + + +? + + 16/2/2005 - 15:16:28 + 16/2/2005 - 15:16:28 + 1.05 + ? + ? + Compute Node + 589 + 170 + + +IsOdd + a + EndOfSwitch + a + + +571 + 201 + +571 + 136 + +InitLoop + DoLoop + EndOfInitLoop + DoLoop + + +InitLoop + Index + Switch + a + + +InitLoop + Min + EndOfInitLoop + Min + + +InitLoop + Max + EndOfInitLoop + Max + + +EndOfInitLoop + DoLoop + InitLoop + DoLoop + + +Switch + Odd + IsOdd + Gate + + +Switch + Even + EndOfSwitch + Default + + +Switch + a + IsOdd + a + + +375 + 136 + +375 + 201 + +Switch + Default + EndOfSwitch + Default + + +EndOfSwitch + a + EndOfInitLoop + Index + + + +GraphSwitchNOTValid + InitLoop__Index + InitLoop + Index + +3 + 0 + + +GraphSwitchNOTValid + InitLoop__Min + InitLoop + Min + +3 + 0 + + +GraphSwitchNOTValid + InitLoop__Max + InitLoop + Max + +3 + 23 + -- 2.39.2