From cca857299a332db51185a3e7fbc6e364e9f21eac Mon Sep 17 00:00:00 2001 From: rahuel Date: Tue, 15 Feb 2005 12:06:00 +0000 Subject: [PATCH] Different steps of an edition of a graph --- examples/GraphEditGraphSwitchs.py | 61 ++++ examples/GraphEditGraphSwitchs_1.py | 204 +++++++++++ examples/GraphEditGraphSwitchs_1.xml | 493 ++++++++++++++++++++++++++ examples/GraphEditGraphSwitchs_2.py | 205 +++++++++++ examples/GraphEditGraphSwitchs_2.xml | 496 ++++++++++++++++++++++++++ examples/GraphEditGraphSwitchs_3.py | 205 +++++++++++ examples/GraphEditGraphSwitchs_3.xml | 502 +++++++++++++++++++++++++++ examples/GraphEditGraphSwitchs_4.py | 206 +++++++++++ examples/GraphEditGraphSwitchs_4.xml | 499 ++++++++++++++++++++++++++ examples/GraphEditGraphSwitchs_5.py | 204 +++++++++++ examples/GraphEditGraphSwitchs_5.xml | 499 ++++++++++++++++++++++++++ 11 files changed, 3574 insertions(+) create mode 100644 examples/GraphEditGraphSwitchs.py create mode 100644 examples/GraphEditGraphSwitchs_1.py create mode 100644 examples/GraphEditGraphSwitchs_1.xml create mode 100644 examples/GraphEditGraphSwitchs_2.py create mode 100644 examples/GraphEditGraphSwitchs_2.xml create mode 100644 examples/GraphEditGraphSwitchs_3.py create mode 100644 examples/GraphEditGraphSwitchs_3.xml create mode 100644 examples/GraphEditGraphSwitchs_4.py create mode 100644 examples/GraphEditGraphSwitchs_4.xml create mode 100644 examples/GraphEditGraphSwitchs_5.py create mode 100644 examples/GraphEditGraphSwitchs_5.xml diff --git a/examples/GraphEditGraphSwitchs.py b/examples/GraphEditGraphSwitchs.py new file mode 100644 index 0000000..9dff962 --- /dev/null +++ b/examples/GraphEditGraphSwitchs.py @@ -0,0 +1,61 @@ + +from GraphSwitchs import * + +GraphSwitchs.SetName('GraphEditSwitchs') +GraphEditSwitchs = GraphSwitchs + +exec GraphEditSwitchs.ListNodes() +InitLoopSwitch.destroy() + +GraphEditSwitchs.Export('/sal_01/salome/SalomePALHead_15_11_2004/SUPERV_SRC/examples/GraphEditGraphSwitchs_1.py') + +exec InitLoop.ListPorts() +exec Switch.ListPorts() + +GraphEditSwitchs.Link( OInitLoopIndex , ISwitcha ) + +exec EndOfInitLoop.ListPorts() +IEndOfInitLoopIndex.Link().destroy() + +GraphEditSwitchs.Export('/sal_01/salome/SalomePALHead_15_11_2004/SUPERV_SRC/examples/GraphEditGraphSwitchs_2.py') + +exec EndOfSwitch.ListPorts() +GraphEditSwitchs.Link(OEndOfSwitcha,IEndOfInitLoopIndex) + +exec EndSwitch.ListPorts() +GraphEditSwitchs.Link(OEndSwitchGate,IEndOfInitLoopGate) + +GraphEditSwitchs.Export('/sal_01/salome/SalomePALHead_15_11_2004/SUPERV_SRC/examples/GraphEditGraphSwitchs_3.py') + +IsOdd_1.SetName('IsEven') +IsEven = IsOdd_1 + +exec IsEven.ListPorts() +IIsEvena.Link().destroy() + +IIsEvenGate.Link().destroy() + +exec Switch_1.ListPorts() +GraphEditSwitchs.Link(OSwitch_1Even,IIsEvenGate) + +GraphEditSwitchs.Export('/sal_01/salome/SalomePALHead_15_11_2004/SUPERV_SRC/examples/GraphEditGraphSwitchs_4.py') + +GraphEditSwitchs.PrintLinks() + +L = GraphEditSwitchs.Link(OSwitch_1Even,IEndSwitchDefault) +L.destroy() + +GraphEditSwitchs.Export('/sal_01/salome/SalomePALHead_15_11_2004/SUPERV_SRC/examples/GraphEditGraphSwitchs_5.py') + +GraphEditSwitchs.Link(OSwitch_1Default,IEndSwitchDefault) + +GraphEditSwitchs.Link(OSwitch_1a,IIsEvena) + +GraphEditSwitchs.Export('/sal_01/salome/SalomePALHead_15_11_2004/SUPERV_SRC/examples/GraphEditGraphSwitchs_5.py') + +Switch_1.SetName('') + +from SuperV import * + +GraphEditSwitchs = Graph('/sal_01/salome/SalomePALHead_15_11_2004/SUPERV_SRC/examples/GraphEditGraphSwitchs_3.xml') + diff --git a/examples/GraphEditGraphSwitchs_1.py b/examples/GraphEditGraphSwitchs_1.py new file mode 100644 index 0000000..d848151 --- /dev/null +++ b/examples/GraphEditGraphSwitchs_1.py @@ -0,0 +1,204 @@ + +# Generated python file of Graph GraphEditSwitchs + +from SuperV import * + +# Graph creation of GraphEditSwitchs +def DefGraphEditSwitchs() : + GraphEditSwitchs = Graph( 'GraphEditSwitchs' ) + GraphEditSwitchs.SetName( 'GraphEditSwitchs' ) + GraphEditSwitchs.SetAuthor( '' ) + GraphEditSwitchs.SetComment( '' ) + GraphEditSwitchs.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsOdd = [] + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd(a) : ' ) + PyIsOdd.append( ' print a,"IsOdd (GraphSwitchs)" ' ) + PyIsOdd.append( ' sleep( 1 ) ' ) + PyIsOdd.append( ' return a ' ) + IsOdd = GraphEditSwitchs.INode( 'IsOdd' , PyIsOdd ) + IsOdd.SetName( 'IsOdd' ) + IsOdd.SetAuthor( '' ) + IsOdd.SetComment( 'Python function' ) + IsOdd.Coords( 388 , 50 ) + IIsOdda = IsOdd.InPort( 'a' , 'long' ) + IIsOddGate = IsOdd.GetInPort( 'Gate' ) + OIsOdda = IsOdd.OutPort( 'a' , 'long' ) + OIsOddGate = IsOdd.GetOutPort( 'Gate' ) + + PyIsOdd_1 = [] + PyIsOdd_1.append( 'from time import * ' ) + PyIsOdd_1.append( 'def IsOdd(a) : ' ) + PyIsOdd_1.append( ' print a,"IsOdd_1 (GraphSwitchs)" ' ) + PyIsOdd_1.append( ' sleep( 1 ) ' ) + PyIsOdd_1.append( ' return a ' ) + IsOdd_1 = GraphEditSwitchs.INode( 'IsOdd' , PyIsOdd_1 ) + IsOdd_1.SetName( 'IsOdd_1' ) + IsOdd_1.SetAuthor( '' ) + IsOdd_1.SetComment( 'Python function' ) + IsOdd_1.Coords( 419 , 308 ) + IIsOdd_1a = IsOdd_1.InPort( 'a' , 'long' ) + IIsOdd_1Gate = IsOdd_1.GetInPort( 'Gate' ) + OIsOdd_1a = IsOdd_1.OutPort( 'a' , 'long' ) + OIsOdd_1Gate = IsOdd_1.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyInitLoop = [] + PyInitLoop.append( 'def InitLoop(Index,Min,Max) : ' ) + PyInitLoop.append( ' return Index,Min,Max ' ) + PyMoreInitLoop = [] + PyMoreInitLoop.append( 'def MoreLoop(Index,Min,Max) : ' ) + PyMoreInitLoop.append( ' if Index <= Max : ' ) + PyMoreInitLoop.append( ' DoLoop = 1 ' ) + PyMoreInitLoop.append( ' else : ' ) + PyMoreInitLoop.append( ' DoLoop = 0 ' ) + PyMoreInitLoop.append( ' return DoLoop,Index,Min,Max ' ) + PyNextInitLoop = [] + PyNextInitLoop.append( 'def NextLoop(Index,Min,Max) : ' ) + PyNextInitLoop.append( ' Index = Index + 1 ' ) + PyNextInitLoop.append( ' return Index,Min,Max ' ) + InitLoop,EndOfInitLoop = GraphEditSwitchs.LNode( 'InitLoop' , PyInitLoop , 'MoreLoop' , PyMoreInitLoop , 'NextLoop' , PyNextInitLoop ) + EndOfInitLoop.SetName( 'EndOfInitLoop' ) + EndOfInitLoop.SetAuthor( '' ) + EndOfInitLoop.SetComment( 'Compute Node' ) + EndOfInitLoop.Coords( 783 , 381 ) + PyEndOfInitLoop = [] + EndOfInitLoop.SetPyFunction( '' , PyEndOfInitLoop ) + IInitLoopDoLoop = InitLoop.GetInPort( 'DoLoop' ) + IInitLoopIndex = InitLoop.InPort( 'Index' , 'long' ) + IInitLoopMin = InitLoop.InPort( 'Min' , 'long' ) + IInitLoopMax = InitLoop.InPort( 'Max' , 'long' ) + IInitLoopGate = InitLoop.GetInPort( 'Gate' ) + OInitLoopDoLoop = InitLoop.GetOutPort( 'DoLoop' ) + OInitLoopIndex = InitLoop.GetOutPort( 'Index' ) + OInitLoopMin = InitLoop.GetOutPort( 'Min' ) + OInitLoopMax = InitLoop.GetOutPort( 'Max' ) + IEndOfInitLoopDoLoop = EndOfInitLoop.GetInPort( 'DoLoop' ) + IEndOfInitLoopIndex = EndOfInitLoop.GetInPort( 'Index' ) + IEndOfInitLoopMin = EndOfInitLoop.GetInPort( 'Min' ) + IEndOfInitLoopMax = EndOfInitLoop.GetInPort( 'Max' ) + IEndOfInitLoopGate = EndOfInitLoop.GetInPort( 'Gate' ) + OEndOfInitLoopDoLoop = EndOfInitLoop.GetOutPort( 'DoLoop' ) + OEndOfInitLoopGate = EndOfInitLoop.GetOutPort( 'Gate' ) + OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) + OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) + OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) + InitLoop.SetName( 'InitLoop' ) + InitLoop.SetAuthor( '' ) + InitLoop.SetComment( 'Compute Node' ) + InitLoop.Coords( 10 , 388 ) + + # Creation of Switch Nodes + PySwitch = [] + PySwitch.append( 'from time import * ' ) + PySwitch.append( 'def Switch(a) : ' ) + PySwitch.append( ' if ( a & 1 ) == 0 : ' ) + PySwitch.append( ' sleep(1) ' ) + PySwitch.append( ' return a & 1,1-(a&1),a ' ) + Switch,EndOfSwitch = GraphEditSwitchs.SNode( 'Switch' , PySwitch ) + EndOfSwitch.SetName( 'EndOfSwitch' ) + EndOfSwitch.SetAuthor( '' ) + EndOfSwitch.SetComment( 'Compute Node' ) + EndOfSwitch.Coords( 587 , 126 ) + PyEndOfSwitch = [] + EndOfSwitch.SetPyFunction( '' , PyEndOfSwitch ) + IEndOfSwitcha = EndOfSwitch.InPort( 'a' , 'long' ) + IEndOfSwitchDefault = EndOfSwitch.GetInPort( 'Default' ) + OEndOfSwitcha = EndOfSwitch.OutPort( 'a' , 'long' ) + OEndOfSwitchGate = EndOfSwitch.GetOutPort( 'Gate' ) + Switch.SetName( 'Switch' ) + Switch.SetAuthor( '' ) + Switch.SetComment( 'Compute Node' ) + Switch.Coords( 186 , 130 ) + ISwitcha = Switch.InPort( 'a' , 'long' ) + ISwitchGate = Switch.GetInPort( 'Gate' ) + OSwitchOdd = Switch.OutPort( 'Odd' , 'long' ) + OSwitchEven = Switch.OutPort( 'Even' , 'int' ) + OSwitcha = Switch.OutPort( 'a' , 'int' ) + OSwitchDefault = Switch.GetOutPort( 'Default' ) + + PySwitch_1 = [] + PySwitch_1.append( 'from time import * ' ) + PySwitch_1.append( 'def Switch(a) : ' ) + PySwitch_1.append( ' if ( a & 1 ) == 0 : ' ) + PySwitch_1.append( ' sleep(1) ' ) + PySwitch_1.append( ' return a & 1,1-(a&1),a ' ) + Switch_1,EndSwitch = GraphEditSwitchs.SNode( 'Switch' , PySwitch_1 ) + EndSwitch.SetName( 'EndSwitch' ) + EndSwitch.SetAuthor( '' ) + EndSwitch.SetComment( 'Compute Node' ) + EndSwitch.Coords( 605 , 382 ) + PyEndSwitch = [] + EndSwitch.SetPyFunction( '' , PyEndSwitch ) + IEndSwitcha = EndSwitch.InPort( 'a' , 'long' ) + IEndSwitchDefault = EndSwitch.GetInPort( 'Default' ) + OEndSwitcha = EndSwitch.OutPort( 'a' , 'long' ) + OEndSwitchGate = EndSwitch.GetOutPort( 'Gate' ) + Switch_1.SetName( 'Switch_1' ) + Switch_1.SetAuthor( '' ) + Switch_1.SetComment( 'Compute Node' ) + Switch_1.Coords( 193 , 388 ) + ISwitch_1a = Switch_1.InPort( 'a' , 'long' ) + ISwitch_1Gate = Switch_1.GetInPort( 'Gate' ) + OSwitch_1Odd = Switch_1.OutPort( 'Odd' , 'long' ) + OSwitch_1Even = Switch_1.OutPort( 'Even' , 'int' ) + OSwitch_1a = Switch_1.OutPort( 'a' , 'int' ) + OSwitch_1Default = Switch_1.GetOutPort( 'Default' ) + + # Creation of Links + LIsOddaEndOfSwitcha = GraphEditSwitchs.Link( OIsOdda , IEndOfSwitcha ) + LIsOddaEndOfSwitcha.AddCoord( 1 , 573 , 160 ) + LIsOddaEndOfSwitcha.AddCoord( 2 , 572 , 130 ) + + LIsOdd_1aEndSwitcha = GraphEditSwitchs.Link( OIsOdd_1a , IEndSwitcha ) + LIsOdd_1aEndSwitcha.AddCoord( 1 , 599 , 416 ) + LIsOdd_1aEndSwitcha.AddCoord( 2 , 598 , 389 ) + + LInitLoopIndexSwitch_1a = GraphEditSwitchs.Link( OInitLoopIndex , ISwitch_1a ) + + LInitLoopMinEndOfInitLoopMin = GraphEditSwitchs.Link( OInitLoopMin , IEndOfInitLoopMin ) + + LInitLoopMaxEndOfInitLoopMax = GraphEditSwitchs.Link( OInitLoopMax , IEndOfInitLoopMax ) + + LSwitchOddIsOddGate = GraphEditSwitchs.Link( OSwitchOdd , IIsOddGate ) + + LSwitchaIsOdda = GraphEditSwitchs.Link( OSwitcha , IIsOdda ) + LSwitchaIsOdda.AddCoord( 1 , 365 , 129 ) + LSwitchaIsOdda.AddCoord( 2 , 365 , 222 ) + + LSwitchDefaultEndOfSwitchDefault = GraphEditSwitchs.Link( OSwitchDefault , IEndOfSwitchDefault ) + LSwitchDefaultEndOfSwitchDefault.AddCoord( 1 , 572 , 194 ) + LSwitchDefaultEndOfSwitchDefault.AddCoord( 2 , 571 , 257 ) + + LSwitch_1OddIsOdd_1Gate = GraphEditSwitchs.Link( OSwitch_1Odd , IIsOdd_1Gate ) + + LSwitch_1EvenEndSwitchDefault = GraphEditSwitchs.Link( OSwitch_1Even , IEndSwitchDefault ) + + LSwitch_1aIsOdd_1a = GraphEditSwitchs.Link( OSwitch_1a , IIsOdd_1a ) + LSwitch_1aIsOdd_1a.AddCoord( 1 , 379 , 387 ) + LSwitch_1aIsOdd_1a.AddCoord( 2 , 378 , 481 ) + + LEndSwitchaEndOfInitLoopIndex = GraphEditSwitchs.Link( OEndSwitcha , IEndOfInitLoopIndex ) + + # Input datas + IInitLoopIndex.Input( 0 ) + IInitLoopMin.Input( 0 ) + IInitLoopMax.Input( 20 ) + + # Input Ports of the graph + #ISwitcha = Switch.GetInPort( 'a' ) + + # Output Ports of the graph + #OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) + #OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) + #OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) + #OSwitchEven = Switch.GetOutPort( 'Even' ) + #OEndOfSwitcha = EndOfSwitch.GetOutPort( 'a' ) + return GraphEditSwitchs + + +GraphEditSwitchs = DefGraphEditSwitchs() diff --git a/examples/GraphEditGraphSwitchs_1.xml b/examples/GraphEditGraphSwitchs_1.xml new file mode 100644 index 0000000..3cad031 --- /dev/null +++ b/examples/GraphEditGraphSwitchs_1.xml @@ -0,0 +1,493 @@ + + + + + +? + ? + GraphEditSwitchs + 1 + ? + +GraphEditSwitchs + + +long + InitLoop__Index + +long + InitLoop__Min + +long + InitLoop__Max + +long + Switch__a + + +long + EndOfInitLoop__Index + +long + EndOfInitLoop__Min + +long + EndOfInitLoop__Max + +int + Switch__Even + +long + EndOfSwitch__a + + + 3/2/2005 - 16:14:10 + 3/2/2005 - 16:14:11 + 2.0 + ? + ? + ? + 0 + 0 + + +? + ? + IsOdd + 3 + ? + +IsOdd + + +long + a + + +long + a + + + +IsOdd + + + + + + 3/2/2005 - 16:14:10 + 3/2/2005 - 16:14:10 + 2.0 + ? + ? + Python function + 388 + 50 + +? + ? + IsOdd_1 + 3 + ? + +IsOdd_1 + + +long + a + + +long + a + + + +IsOdd + + + + + + 3/2/2005 - 16:14:10 + 3/2/2005 - 16:14:10 + 2.0 + ? + ? + Python function + 419 + 308 + +? + ? + InitLoop + 4 + EndOfInitLoop + +InitLoop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +InitLoop + + + +MoreLoop + + + + + + + +NextLoop + + + + 3/2/2005 - 16:14:10 + 3/2/2005 - 16:14:10 + 2.0 + ? + ? + Compute Node + 10 + 388 + +? + ? + EndOfInitLoop + 5 + InitLoop + +EndInitLoop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +? + + 3/2/2005 - 16:14:10 + 3/2/2005 - 16:14:10 + 2.0 + ? + ? + Compute Node + 783 + 381 + +? + ? + Switch + 6 + EndOfSwitch + +Switch + + +long + a + + +long + Odd + +int + Even + +int + a + + + +Switch + + + + + + 3/2/2005 - 16:14:10 + 3/2/2005 - 16:14:10 + 2.0 + ? + ? + Compute Node + 186 + 130 + +? + ? + EndOfSwitch + 7 + Switch + +EndSwitch + + +long + a + + +long + a + + + +? + + 3/2/2005 - 16:14:10 + 3/2/2005 - 16:14:10 + 2.0 + ? + ? + Compute Node + 587 + 126 + +? + ? + Switch_1 + 6 + EndSwitch + +Switch_1 + + +long + a + + +long + Odd + +int + Even + +int + a + + + +Switch + + + + + + 3/2/2005 - 16:14:11 + 3/2/2005 - 16:14:11 + 2.0 + ? + ? + Compute Node + 193 + 388 + +? + ? + EndSwitch + 7 + Switch_1 + +EndSwitch + + +long + a + + +long + a + + + +? + + 3/2/2005 - 16:14:11 + 3/2/2005 - 16:14:11 + 2.0 + ? + ? + Compute Node + 605 + 382 + + +IsOdd + a + EndOfSwitch + a + + +573 + 160 + +572 + 130 + +IsOdd_1 + a + EndSwitch + a + + +599 + 416 + +598 + 389 + +InitLoop + DoLoop + EndOfInitLoop + DoLoop + + +InitLoop + Index + Switch_1 + a + + +InitLoop + Min + EndOfInitLoop + Min + + +InitLoop + Max + EndOfInitLoop + Max + + +EndOfInitLoop + DoLoop + InitLoop + DoLoop + + +Switch + Odd + IsOdd + Gate + + +Switch + a + IsOdd + a + + +365 + 129 + +365 + 222 + +Switch + Default + EndOfSwitch + Default + + +572 + 194 + +571 + 257 + +Switch_1 + Odd + IsOdd_1 + Gate + + +Switch_1 + Even + EndSwitch + Default + + +Switch_1 + a + IsOdd_1 + a + + +379 + 387 + +378 + 481 + +EndSwitch + a + EndOfInitLoop + Index + + + +GraphEditSwitchs + InitLoop__Index + InitLoop + Index + +3 + 0 + + +GraphEditSwitchs + InitLoop__Min + InitLoop + Min + +3 + 0 + + +GraphEditSwitchs + InitLoop__Max + InitLoop + Max + +3 + 20 + diff --git a/examples/GraphEditGraphSwitchs_2.py b/examples/GraphEditGraphSwitchs_2.py new file mode 100644 index 0000000..df8833b --- /dev/null +++ b/examples/GraphEditGraphSwitchs_2.py @@ -0,0 +1,205 @@ + +# Generated python file of Graph GraphEditSwitchs + +from SuperV import * + +# Graph creation of GraphEditSwitchs +def DefGraphEditSwitchs() : + GraphEditSwitchs = Graph( 'GraphEditSwitchs' ) + GraphEditSwitchs.SetName( 'GraphEditSwitchs' ) + GraphEditSwitchs.SetAuthor( '' ) + GraphEditSwitchs.SetComment( '' ) + GraphEditSwitchs.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsOdd = [] + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd(a) : ' ) + PyIsOdd.append( ' print a,"IsOdd (GraphSwitchs)" ' ) + PyIsOdd.append( ' sleep( 1 ) ' ) + PyIsOdd.append( ' return a ' ) + IsOdd = GraphEditSwitchs.INode( 'IsOdd' , PyIsOdd ) + IsOdd.SetName( 'IsOdd' ) + IsOdd.SetAuthor( '' ) + IsOdd.SetComment( 'Python function' ) + IsOdd.Coords( 388 , 50 ) + IIsOdda = IsOdd.InPort( 'a' , 'long' ) + IIsOddGate = IsOdd.GetInPort( 'Gate' ) + OIsOdda = IsOdd.OutPort( 'a' , 'long' ) + OIsOddGate = IsOdd.GetOutPort( 'Gate' ) + + PyIsOdd_1 = [] + PyIsOdd_1.append( 'from time import * ' ) + PyIsOdd_1.append( 'def IsOdd(a) : ' ) + PyIsOdd_1.append( ' print a,"IsOdd_1 (GraphSwitchs)" ' ) + PyIsOdd_1.append( ' sleep( 1 ) ' ) + PyIsOdd_1.append( ' return a ' ) + IsOdd_1 = GraphEditSwitchs.INode( 'IsOdd' , PyIsOdd_1 ) + IsOdd_1.SetName( 'IsOdd_1' ) + IsOdd_1.SetAuthor( '' ) + IsOdd_1.SetComment( 'Python function' ) + IsOdd_1.Coords( 419 , 308 ) + IIsOdd_1a = IsOdd_1.InPort( 'a' , 'long' ) + IIsOdd_1Gate = IsOdd_1.GetInPort( 'Gate' ) + OIsOdd_1a = IsOdd_1.OutPort( 'a' , 'long' ) + OIsOdd_1Gate = IsOdd_1.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyInitLoop = [] + PyInitLoop.append( 'def InitLoop(Index,Min,Max) : ' ) + PyInitLoop.append( ' return Index,Min,Max ' ) + PyMoreInitLoop = [] + PyMoreInitLoop.append( 'def MoreLoop(Index,Min,Max) : ' ) + PyMoreInitLoop.append( ' if Index <= Max : ' ) + PyMoreInitLoop.append( ' DoLoop = 1 ' ) + PyMoreInitLoop.append( ' else : ' ) + PyMoreInitLoop.append( ' DoLoop = 0 ' ) + PyMoreInitLoop.append( ' return DoLoop,Index,Min,Max ' ) + PyNextInitLoop = [] + PyNextInitLoop.append( 'def NextLoop(Index,Min,Max) : ' ) + PyNextInitLoop.append( ' Index = Index + 1 ' ) + PyNextInitLoop.append( ' return Index,Min,Max ' ) + InitLoop,EndOfInitLoop = GraphEditSwitchs.LNode( 'InitLoop' , PyInitLoop , 'MoreLoop' , PyMoreInitLoop , 'NextLoop' , PyNextInitLoop ) + EndOfInitLoop.SetName( 'EndOfInitLoop' ) + EndOfInitLoop.SetAuthor( '' ) + EndOfInitLoop.SetComment( 'Compute Node' ) + EndOfInitLoop.Coords( 783 , 381 ) + PyEndOfInitLoop = [] + EndOfInitLoop.SetPyFunction( '' , PyEndOfInitLoop ) + IInitLoopDoLoop = InitLoop.GetInPort( 'DoLoop' ) + IInitLoopIndex = InitLoop.InPort( 'Index' , 'long' ) + IInitLoopMin = InitLoop.InPort( 'Min' , 'long' ) + IInitLoopMax = InitLoop.InPort( 'Max' , 'long' ) + IInitLoopGate = InitLoop.GetInPort( 'Gate' ) + OInitLoopDoLoop = InitLoop.GetOutPort( 'DoLoop' ) + OInitLoopIndex = InitLoop.GetOutPort( 'Index' ) + OInitLoopMin = InitLoop.GetOutPort( 'Min' ) + OInitLoopMax = InitLoop.GetOutPort( 'Max' ) + IEndOfInitLoopDoLoop = EndOfInitLoop.GetInPort( 'DoLoop' ) + IEndOfInitLoopIndex = EndOfInitLoop.GetInPort( 'Index' ) + IEndOfInitLoopMin = EndOfInitLoop.GetInPort( 'Min' ) + IEndOfInitLoopMax = EndOfInitLoop.GetInPort( 'Max' ) + IEndOfInitLoopGate = EndOfInitLoop.GetInPort( 'Gate' ) + OEndOfInitLoopDoLoop = EndOfInitLoop.GetOutPort( 'DoLoop' ) + OEndOfInitLoopGate = EndOfInitLoop.GetOutPort( 'Gate' ) + OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) + OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) + OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) + InitLoop.SetName( 'InitLoop' ) + InitLoop.SetAuthor( '' ) + InitLoop.SetComment( 'Compute Node' ) + InitLoop.Coords( 10 , 388 ) + + # Creation of Switch Nodes + PySwitch = [] + PySwitch.append( 'from time import * ' ) + PySwitch.append( 'def Switch(a) : ' ) + PySwitch.append( ' if ( a & 1 ) == 0 : ' ) + PySwitch.append( ' sleep(1) ' ) + PySwitch.append( ' return a & 1,1-(a&1),a ' ) + Switch,EndOfSwitch = GraphEditSwitchs.SNode( 'Switch' , PySwitch ) + EndOfSwitch.SetName( 'EndOfSwitch' ) + EndOfSwitch.SetAuthor( '' ) + EndOfSwitch.SetComment( 'Compute Node' ) + EndOfSwitch.Coords( 587 , 126 ) + PyEndOfSwitch = [] + EndOfSwitch.SetPyFunction( '' , PyEndOfSwitch ) + IEndOfSwitcha = EndOfSwitch.InPort( 'a' , 'long' ) + IEndOfSwitchDefault = EndOfSwitch.GetInPort( 'Default' ) + OEndOfSwitcha = EndOfSwitch.OutPort( 'a' , 'long' ) + OEndOfSwitchGate = EndOfSwitch.GetOutPort( 'Gate' ) + Switch.SetName( 'Switch' ) + Switch.SetAuthor( '' ) + Switch.SetComment( 'Compute Node' ) + Switch.Coords( 186 , 130 ) + ISwitcha = Switch.InPort( 'a' , 'long' ) + ISwitchGate = Switch.GetInPort( 'Gate' ) + OSwitchOdd = Switch.OutPort( 'Odd' , 'long' ) + OSwitchEven = Switch.OutPort( 'Even' , 'int' ) + OSwitcha = Switch.OutPort( 'a' , 'int' ) + OSwitchDefault = Switch.GetOutPort( 'Default' ) + + PySwitch_1 = [] + PySwitch_1.append( 'from time import * ' ) + PySwitch_1.append( 'def Switch(a) : ' ) + PySwitch_1.append( ' if ( a & 1 ) == 0 : ' ) + PySwitch_1.append( ' sleep(1) ' ) + PySwitch_1.append( ' return a & 1,1-(a&1),a ' ) + Switch_1,EndSwitch = GraphEditSwitchs.SNode( 'Switch' , PySwitch_1 ) + EndSwitch.SetName( 'EndSwitch' ) + EndSwitch.SetAuthor( '' ) + EndSwitch.SetComment( 'Compute Node' ) + EndSwitch.Coords( 605 , 382 ) + PyEndSwitch = [] + EndSwitch.SetPyFunction( '' , PyEndSwitch ) + IEndSwitcha = EndSwitch.InPort( 'a' , 'long' ) + IEndSwitchDefault = EndSwitch.GetInPort( 'Default' ) + OEndSwitcha = EndSwitch.OutPort( 'a' , 'long' ) + OEndSwitchGate = EndSwitch.GetOutPort( 'Gate' ) + Switch_1.SetName( 'Switch_1' ) + Switch_1.SetAuthor( '' ) + Switch_1.SetComment( 'Compute Node' ) + Switch_1.Coords( 193 , 388 ) + ISwitch_1a = Switch_1.InPort( 'a' , 'long' ) + ISwitch_1Gate = Switch_1.GetInPort( 'Gate' ) + OSwitch_1Odd = Switch_1.OutPort( 'Odd' , 'long' ) + OSwitch_1Even = Switch_1.OutPort( 'Even' , 'int' ) + OSwitch_1a = Switch_1.OutPort( 'a' , 'int' ) + OSwitch_1Default = Switch_1.GetOutPort( 'Default' ) + + # Creation of Links + LIsOddaEndOfSwitcha = GraphEditSwitchs.Link( OIsOdda , IEndOfSwitcha ) + LIsOddaEndOfSwitcha.AddCoord( 1 , 573 , 160 ) + LIsOddaEndOfSwitcha.AddCoord( 2 , 572 , 130 ) + + LIsOdd_1aEndSwitcha = GraphEditSwitchs.Link( OIsOdd_1a , IEndSwitcha ) + LIsOdd_1aEndSwitcha.AddCoord( 1 , 599 , 416 ) + LIsOdd_1aEndSwitcha.AddCoord( 2 , 598 , 389 ) + + LInitLoopIndexSwitch_1a = GraphEditSwitchs.Link( OInitLoopIndex , ISwitch_1a ) + + LInitLoopIndexSwitcha = GraphEditSwitchs.Link( OInitLoopIndex , ISwitcha ) + + LInitLoopMinEndOfInitLoopMin = GraphEditSwitchs.Link( OInitLoopMin , IEndOfInitLoopMin ) + + LInitLoopMaxEndOfInitLoopMax = GraphEditSwitchs.Link( OInitLoopMax , IEndOfInitLoopMax ) + + LSwitchOddIsOddGate = GraphEditSwitchs.Link( OSwitchOdd , IIsOddGate ) + + LSwitchaIsOdda = GraphEditSwitchs.Link( OSwitcha , IIsOdda ) + LSwitchaIsOdda.AddCoord( 1 , 365 , 129 ) + LSwitchaIsOdda.AddCoord( 2 , 365 , 222 ) + + LSwitchDefaultEndOfSwitchDefault = GraphEditSwitchs.Link( OSwitchDefault , IEndOfSwitchDefault ) + LSwitchDefaultEndOfSwitchDefault.AddCoord( 1 , 572 , 194 ) + LSwitchDefaultEndOfSwitchDefault.AddCoord( 2 , 571 , 257 ) + + LSwitch_1OddIsOdd_1Gate = GraphEditSwitchs.Link( OSwitch_1Odd , IIsOdd_1Gate ) + + LSwitch_1EvenEndSwitchDefault = GraphEditSwitchs.Link( OSwitch_1Even , IEndSwitchDefault ) + + LSwitch_1aIsOdd_1a = GraphEditSwitchs.Link( OSwitch_1a , IIsOdd_1a ) + LSwitch_1aIsOdd_1a.AddCoord( 1 , 379 , 387 ) + LSwitch_1aIsOdd_1a.AddCoord( 2 , 378 , 481 ) + + # Input datas + IInitLoopIndex.Input( 0 ) + IInitLoopMin.Input( 0 ) + IInitLoopMax.Input( 20 ) + + # Input Ports of the graph + #IEndOfInitLoopIndex = EndOfInitLoop.GetInPort( 'Index' ) + + # Output Ports of the graph + #OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) + #OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) + #OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) + #OSwitchEven = Switch.GetOutPort( 'Even' ) + #OEndOfSwitcha = EndOfSwitch.GetOutPort( 'a' ) + #OEndSwitcha = EndSwitch.GetOutPort( 'a' ) + return GraphEditSwitchs + + +GraphEditSwitchs = DefGraphEditSwitchs() diff --git a/examples/GraphEditGraphSwitchs_2.xml b/examples/GraphEditGraphSwitchs_2.xml new file mode 100644 index 0000000..6932cd9 --- /dev/null +++ b/examples/GraphEditGraphSwitchs_2.xml @@ -0,0 +1,496 @@ + + + + + +? + ? + GraphEditSwitchs + 1 + ? + +GraphEditSwitchs + + +long + InitLoop__Index + +long + InitLoop__Min + +long + InitLoop__Max + +long + EndOfInitLoop__Index + + +long + EndOfInitLoop__Index + +long + EndOfInitLoop__Min + +long + EndOfInitLoop__Max + +int + Switch__Even + +long + EndOfSwitch__a + +long + EndSwitch__a + + + 3/2/2005 - 16:14:10 + 3/2/2005 - 16:14:12 + 2.0 + ? + ? + ? + 0 + 0 + + +? + ? + IsOdd + 3 + ? + +IsOdd + + +long + a + + +long + a + + + +IsOdd + + + + + + 3/2/2005 - 16:14:10 + 3/2/2005 - 16:14:10 + 2.0 + ? + ? + Python function + 388 + 50 + +? + ? + IsOdd_1 + 3 + ? + +IsOdd_1 + + +long + a + + +long + a + + + +IsOdd + + + + + + 3/2/2005 - 16:14:10 + 3/2/2005 - 16:14:10 + 2.0 + ? + ? + Python function + 419 + 308 + +? + ? + InitLoop + 4 + EndOfInitLoop + +InitLoop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +InitLoop + + + +MoreLoop + + + + + + + +NextLoop + + + + 3/2/2005 - 16:14:10 + 3/2/2005 - 16:14:10 + 2.0 + ? + ? + Compute Node + 10 + 388 + +? + ? + EndOfInitLoop + 5 + InitLoop + +EndInitLoop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +? + + 3/2/2005 - 16:14:10 + 3/2/2005 - 16:14:10 + 2.0 + ? + ? + Compute Node + 783 + 381 + +? + ? + Switch + 6 + EndOfSwitch + +Switch + + +long + a + + +long + Odd + +int + Even + +int + a + + + +Switch + + + + + + 3/2/2005 - 16:14:10 + 3/2/2005 - 16:14:10 + 2.0 + ? + ? + Compute Node + 186 + 130 + +? + ? + EndOfSwitch + 7 + Switch + +EndSwitch + + +long + a + + +long + a + + + +? + + 3/2/2005 - 16:14:10 + 3/2/2005 - 16:14:10 + 2.0 + ? + ? + Compute Node + 587 + 126 + +? + ? + Switch_1 + 6 + EndSwitch + +Switch_1 + + +long + a + + +long + Odd + +int + Even + +int + a + + + +Switch + + + + + + 3/2/2005 - 16:14:11 + 3/2/2005 - 16:14:11 + 2.0 + ? + ? + Compute Node + 193 + 388 + +? + ? + EndSwitch + 7 + Switch_1 + +EndSwitch + + +long + a + + +long + a + + + +? + + 3/2/2005 - 16:14:11 + 3/2/2005 - 16:14:11 + 2.0 + ? + ? + Compute Node + 605 + 382 + + +IsOdd + a + EndOfSwitch + a + + +573 + 160 + +572 + 130 + +IsOdd_1 + a + EndSwitch + a + + +599 + 416 + +598 + 389 + +InitLoop + DoLoop + EndOfInitLoop + DoLoop + + +InitLoop + Index + Switch_1 + a + + +InitLoop + Index + Switch + a + + +InitLoop + Min + EndOfInitLoop + Min + + +InitLoop + Max + EndOfInitLoop + Max + + +EndOfInitLoop + DoLoop + InitLoop + DoLoop + + +Switch + Odd + IsOdd + Gate + + +Switch + a + IsOdd + a + + +365 + 129 + +365 + 222 + +Switch + Default + EndOfSwitch + Default + + +572 + 194 + +571 + 257 + +Switch_1 + Odd + IsOdd_1 + Gate + + +Switch_1 + Even + EndSwitch + Default + + +Switch_1 + a + IsOdd_1 + a + + +379 + 387 + +378 + 481 + + +GraphEditSwitchs + InitLoop__Index + InitLoop + Index + +3 + 0 + + +GraphEditSwitchs + InitLoop__Min + InitLoop + Min + +3 + 0 + + +GraphEditSwitchs + InitLoop__Max + InitLoop + Max + +3 + 20 + diff --git a/examples/GraphEditGraphSwitchs_3.py b/examples/GraphEditGraphSwitchs_3.py new file mode 100644 index 0000000..1189ba0 --- /dev/null +++ b/examples/GraphEditGraphSwitchs_3.py @@ -0,0 +1,205 @@ + +# Generated python file of Graph GraphEditSwitchs + +from SuperV import * + +# Graph creation of GraphEditSwitchs +def DefGraphEditSwitchs() : + GraphEditSwitchs = Graph( 'GraphEditSwitchs' ) + GraphEditSwitchs.SetName( 'GraphEditSwitchs' ) + GraphEditSwitchs.SetAuthor( '' ) + GraphEditSwitchs.SetComment( '' ) + GraphEditSwitchs.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsOdd = [] + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd(a) : ' ) + PyIsOdd.append( ' print a,"IsOdd (GraphSwitchs)" ' ) + PyIsOdd.append( ' sleep( 1 ) ' ) + PyIsOdd.append( ' return a ' ) + IsOdd = GraphEditSwitchs.INode( 'IsOdd' , PyIsOdd ) + IsOdd.SetName( 'IsOdd' ) + IsOdd.SetAuthor( '' ) + IsOdd.SetComment( 'Python function' ) + IsOdd.Coords( 388 , 50 ) + IIsOdda = IsOdd.InPort( 'a' , 'long' ) + IIsOddGate = IsOdd.GetInPort( 'Gate' ) + OIsOdda = IsOdd.OutPort( 'a' , 'long' ) + OIsOddGate = IsOdd.GetOutPort( 'Gate' ) + + PyIsOdd_1 = [] + PyIsOdd_1.append( 'from time import * ' ) + PyIsOdd_1.append( 'def IsOdd(a) : ' ) + PyIsOdd_1.append( ' print a,"IsOdd_1 (GraphSwitchs)" ' ) + PyIsOdd_1.append( ' sleep( 1 ) ' ) + PyIsOdd_1.append( ' return a ' ) + IsOdd_1 = GraphEditSwitchs.INode( 'IsOdd' , PyIsOdd_1 ) + IsOdd_1.SetName( 'IsOdd_1' ) + IsOdd_1.SetAuthor( '' ) + IsOdd_1.SetComment( 'Python function' ) + IsOdd_1.Coords( 419 , 308 ) + IIsOdd_1a = IsOdd_1.InPort( 'a' , 'long' ) + IIsOdd_1Gate = IsOdd_1.GetInPort( 'Gate' ) + OIsOdd_1a = IsOdd_1.OutPort( 'a' , 'long' ) + OIsOdd_1Gate = IsOdd_1.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyInitLoop = [] + PyInitLoop.append( 'def InitLoop(Index,Min,Max) : ' ) + PyInitLoop.append( ' return Index,Min,Max ' ) + PyMoreInitLoop = [] + PyMoreInitLoop.append( 'def MoreLoop(Index,Min,Max) : ' ) + PyMoreInitLoop.append( ' if Index <= Max : ' ) + PyMoreInitLoop.append( ' DoLoop = 1 ' ) + PyMoreInitLoop.append( ' else : ' ) + PyMoreInitLoop.append( ' DoLoop = 0 ' ) + PyMoreInitLoop.append( ' return DoLoop,Index,Min,Max ' ) + PyNextInitLoop = [] + PyNextInitLoop.append( 'def NextLoop(Index,Min,Max) : ' ) + PyNextInitLoop.append( ' Index = Index + 1 ' ) + PyNextInitLoop.append( ' return Index,Min,Max ' ) + InitLoop,EndOfInitLoop = GraphEditSwitchs.LNode( 'InitLoop' , PyInitLoop , 'MoreLoop' , PyMoreInitLoop , 'NextLoop' , PyNextInitLoop ) + EndOfInitLoop.SetName( 'EndOfInitLoop' ) + EndOfInitLoop.SetAuthor( '' ) + EndOfInitLoop.SetComment( 'Compute Node' ) + EndOfInitLoop.Coords( 783 , 381 ) + PyEndOfInitLoop = [] + EndOfInitLoop.SetPyFunction( '' , PyEndOfInitLoop ) + IInitLoopDoLoop = InitLoop.GetInPort( 'DoLoop' ) + IInitLoopIndex = InitLoop.InPort( 'Index' , 'long' ) + IInitLoopMin = InitLoop.InPort( 'Min' , 'long' ) + IInitLoopMax = InitLoop.InPort( 'Max' , 'long' ) + IInitLoopGate = InitLoop.GetInPort( 'Gate' ) + OInitLoopDoLoop = InitLoop.GetOutPort( 'DoLoop' ) + OInitLoopIndex = InitLoop.GetOutPort( 'Index' ) + OInitLoopMin = InitLoop.GetOutPort( 'Min' ) + OInitLoopMax = InitLoop.GetOutPort( 'Max' ) + IEndOfInitLoopDoLoop = EndOfInitLoop.GetInPort( 'DoLoop' ) + IEndOfInitLoopIndex = EndOfInitLoop.GetInPort( 'Index' ) + IEndOfInitLoopMin = EndOfInitLoop.GetInPort( 'Min' ) + IEndOfInitLoopMax = EndOfInitLoop.GetInPort( 'Max' ) + IEndOfInitLoopGate = EndOfInitLoop.GetInPort( 'Gate' ) + OEndOfInitLoopDoLoop = EndOfInitLoop.GetOutPort( 'DoLoop' ) + OEndOfInitLoopGate = EndOfInitLoop.GetOutPort( 'Gate' ) + OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) + OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) + OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) + InitLoop.SetName( 'InitLoop' ) + InitLoop.SetAuthor( '' ) + InitLoop.SetComment( 'Compute Node' ) + InitLoop.Coords( 10 , 388 ) + + # Creation of Switch Nodes + PySwitch = [] + PySwitch.append( 'from time import * ' ) + PySwitch.append( 'def Switch(a) : ' ) + PySwitch.append( ' if ( a & 1 ) == 0 : ' ) + PySwitch.append( ' sleep(1) ' ) + PySwitch.append( ' return a & 1,1-(a&1),a ' ) + Switch,EndOfSwitch = GraphEditSwitchs.SNode( 'Switch' , PySwitch ) + EndOfSwitch.SetName( 'EndOfSwitch' ) + EndOfSwitch.SetAuthor( '' ) + EndOfSwitch.SetComment( 'Compute Node' ) + EndOfSwitch.Coords( 587 , 126 ) + PyEndOfSwitch = [] + EndOfSwitch.SetPyFunction( '' , PyEndOfSwitch ) + IEndOfSwitcha = EndOfSwitch.InPort( 'a' , 'long' ) + IEndOfSwitchDefault = EndOfSwitch.GetInPort( 'Default' ) + OEndOfSwitcha = EndOfSwitch.OutPort( 'a' , 'long' ) + OEndOfSwitchGate = EndOfSwitch.GetOutPort( 'Gate' ) + Switch.SetName( 'Switch' ) + Switch.SetAuthor( '' ) + Switch.SetComment( 'Compute Node' ) + Switch.Coords( 186 , 130 ) + ISwitcha = Switch.InPort( 'a' , 'long' ) + ISwitchGate = Switch.GetInPort( 'Gate' ) + OSwitchOdd = Switch.OutPort( 'Odd' , 'long' ) + OSwitchEven = Switch.OutPort( 'Even' , 'int' ) + OSwitcha = Switch.OutPort( 'a' , 'int' ) + OSwitchDefault = Switch.GetOutPort( 'Default' ) + + PySwitch_1 = [] + PySwitch_1.append( 'from time import * ' ) + PySwitch_1.append( 'def Switch(a) : ' ) + PySwitch_1.append( ' if ( a & 1 ) == 0 : ' ) + PySwitch_1.append( ' sleep(1) ' ) + PySwitch_1.append( ' return a & 1,1-(a&1),a ' ) + Switch_1,EndSwitch = GraphEditSwitchs.SNode( 'Switch' , PySwitch_1 ) + EndSwitch.SetName( 'EndSwitch' ) + EndSwitch.SetAuthor( '' ) + EndSwitch.SetComment( 'Compute Node' ) + EndSwitch.Coords( 605 , 382 ) + PyEndSwitch = [] + EndSwitch.SetPyFunction( '' , PyEndSwitch ) + IEndSwitcha = EndSwitch.InPort( 'a' , 'long' ) + IEndSwitchDefault = EndSwitch.GetInPort( 'Default' ) + OEndSwitcha = EndSwitch.OutPort( 'a' , 'long' ) + OEndSwitchGate = EndSwitch.GetOutPort( 'Gate' ) + Switch_1.SetName( 'Switch_1' ) + Switch_1.SetAuthor( '' ) + Switch_1.SetComment( 'Compute Node' ) + Switch_1.Coords( 193 , 388 ) + ISwitch_1a = Switch_1.InPort( 'a' , 'long' ) + ISwitch_1Gate = Switch_1.GetInPort( 'Gate' ) + OSwitch_1Odd = Switch_1.OutPort( 'Odd' , 'long' ) + OSwitch_1Even = Switch_1.OutPort( 'Even' , 'int' ) + OSwitch_1a = Switch_1.OutPort( 'a' , 'int' ) + OSwitch_1Default = Switch_1.GetOutPort( 'Default' ) + + # Creation of Links + LIsOddaEndOfSwitcha = GraphEditSwitchs.Link( OIsOdda , IEndOfSwitcha ) + LIsOddaEndOfSwitcha.AddCoord( 1 , 573 , 160 ) + LIsOddaEndOfSwitcha.AddCoord( 2 , 572 , 130 ) + + LIsOdd_1aEndSwitcha = GraphEditSwitchs.Link( OIsOdd_1a , IEndSwitcha ) + LIsOdd_1aEndSwitcha.AddCoord( 1 , 599 , 416 ) + LIsOdd_1aEndSwitcha.AddCoord( 2 , 598 , 389 ) + + LInitLoopIndexSwitch_1a = GraphEditSwitchs.Link( OInitLoopIndex , ISwitch_1a ) + + LInitLoopIndexSwitcha = GraphEditSwitchs.Link( OInitLoopIndex , ISwitcha ) + + LInitLoopMinEndOfInitLoopMin = GraphEditSwitchs.Link( OInitLoopMin , IEndOfInitLoopMin ) + + LInitLoopMaxEndOfInitLoopMax = GraphEditSwitchs.Link( OInitLoopMax , IEndOfInitLoopMax ) + + LSwitchOddIsOddGate = GraphEditSwitchs.Link( OSwitchOdd , IIsOddGate ) + + LSwitchaIsOdda = GraphEditSwitchs.Link( OSwitcha , IIsOdda ) + LSwitchaIsOdda.AddCoord( 1 , 365 , 129 ) + LSwitchaIsOdda.AddCoord( 2 , 365 , 222 ) + + LSwitchDefaultEndOfSwitchDefault = GraphEditSwitchs.Link( OSwitchDefault , IEndOfSwitchDefault ) + LSwitchDefaultEndOfSwitchDefault.AddCoord( 1 , 572 , 194 ) + LSwitchDefaultEndOfSwitchDefault.AddCoord( 2 , 571 , 257 ) + + LEndOfSwitchaEndOfInitLoopIndex = GraphEditSwitchs.Link( OEndOfSwitcha , IEndOfInitLoopIndex ) + + LSwitch_1OddIsOdd_1Gate = GraphEditSwitchs.Link( OSwitch_1Odd , IIsOdd_1Gate ) + + LSwitch_1EvenEndSwitchDefault = GraphEditSwitchs.Link( OSwitch_1Even , IEndSwitchDefault ) + + LSwitch_1aIsOdd_1a = GraphEditSwitchs.Link( OSwitch_1a , IIsOdd_1a ) + LSwitch_1aIsOdd_1a.AddCoord( 1 , 379 , 387 ) + LSwitch_1aIsOdd_1a.AddCoord( 2 , 378 , 481 ) + + LEndSwitchGateEndOfInitLoopGate = GraphEditSwitchs.Link( OEndSwitchGate , IEndOfInitLoopGate ) + + # Input datas + IInitLoopIndex.Input( 0 ) + IInitLoopMin.Input( 0 ) + IInitLoopMax.Input( 20 ) + + # Output Ports of the graph + #OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) + #OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) + #OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) + #OSwitchEven = Switch.GetOutPort( 'Even' ) + #OEndSwitcha = EndSwitch.GetOutPort( 'a' ) + return GraphEditSwitchs + + +GraphEditSwitchs = DefGraphEditSwitchs() diff --git a/examples/GraphEditGraphSwitchs_3.xml b/examples/GraphEditGraphSwitchs_3.xml new file mode 100644 index 0000000..cd21fd0 --- /dev/null +++ b/examples/GraphEditGraphSwitchs_3.xml @@ -0,0 +1,502 @@ + + + + + +? + ? + GraphEditSwitchs + 1 + ? + +GraphEditSwitchs + + +long + InitLoop__Index + +long + InitLoop__Min + +long + InitLoop__Max + + +long + EndOfInitLoop__Index + +long + EndOfInitLoop__Min + +long + EndOfInitLoop__Max + +int + Switch__Even + +long + EndSwitch__a + + + 3/2/2005 - 16:14:10 + 3/2/2005 - 16:14:12 + 2.0 + ? + ? + ? + 0 + 0 + + +? + ? + IsOdd + 3 + ? + +IsOdd + + +long + a + + +long + a + + + +IsOdd + + + + + + 3/2/2005 - 16:14:10 + 3/2/2005 - 16:14:10 + 2.0 + ? + ? + Python function + 388 + 50 + +? + ? + IsOdd_1 + 3 + ? + +IsOdd_1 + + +long + a + + +long + a + + + +IsOdd + + + + + + 3/2/2005 - 16:14:10 + 3/2/2005 - 16:14:10 + 2.0 + ? + ? + Python function + 419 + 308 + +? + ? + InitLoop + 4 + EndOfInitLoop + +InitLoop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +InitLoop + + + +MoreLoop + + + + + + + +NextLoop + + + + 3/2/2005 - 16:14:10 + 3/2/2005 - 16:14:10 + 2.0 + ? + ? + Compute Node + 10 + 388 + +? + ? + EndOfInitLoop + 5 + InitLoop + +EndInitLoop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +? + + 3/2/2005 - 16:14:10 + 3/2/2005 - 16:14:10 + 2.0 + ? + ? + Compute Node + 783 + 381 + +? + ? + Switch + 6 + EndOfSwitch + +Switch + + +long + a + + +long + Odd + +int + Even + +int + a + + + +Switch + + + + + + 3/2/2005 - 16:14:10 + 3/2/2005 - 16:14:10 + 2.0 + ? + ? + Compute Node + 186 + 130 + +? + ? + EndOfSwitch + 7 + Switch + +EndSwitch + + +long + a + + +long + a + + + +? + + 3/2/2005 - 16:14:10 + 3/2/2005 - 16:14:10 + 2.0 + ? + ? + Compute Node + 587 + 126 + +? + ? + Switch_1 + 6 + EndSwitch + +Switch_1 + + +long + a + + +long + Odd + +int + Even + +int + a + + + +Switch + + + + + + 3/2/2005 - 16:14:11 + 3/2/2005 - 16:14:11 + 2.0 + ? + ? + Compute Node + 193 + 388 + +? + ? + EndSwitch + 7 + Switch_1 + +EndSwitch + + +long + a + + +long + a + + + +? + + 3/2/2005 - 16:14:11 + 3/2/2005 - 16:14:11 + 2.0 + ? + ? + Compute Node + 605 + 382 + + +IsOdd + a + EndOfSwitch + a + + +573 + 160 + +572 + 130 + +IsOdd_1 + a + EndSwitch + a + + +599 + 416 + +598 + 389 + +InitLoop + DoLoop + EndOfInitLoop + DoLoop + + +InitLoop + Index + Switch_1 + a + + +InitLoop + Index + Switch + a + + +InitLoop + Min + EndOfInitLoop + Min + + +InitLoop + Max + EndOfInitLoop + Max + + +EndOfInitLoop + DoLoop + InitLoop + DoLoop + + +Switch + Odd + IsOdd + Gate + + +Switch + a + IsOdd + a + + +365 + 129 + +365 + 222 + +Switch + Default + EndOfSwitch + Default + + +572 + 194 + +571 + 257 + +EndOfSwitch + a + EndOfInitLoop + Index + + +Switch_1 + Odd + IsOdd_1 + Gate + + +Switch_1 + Even + EndSwitch + Default + + +Switch_1 + a + IsOdd_1 + a + + +379 + 387 + +378 + 481 + +EndSwitch + Gate + EndOfInitLoop + Gate + + + +GraphEditSwitchs + InitLoop__Index + InitLoop + Index + +3 + 0 + + +GraphEditSwitchs + InitLoop__Min + InitLoop + Min + +3 + 0 + + +GraphEditSwitchs + InitLoop__Max + InitLoop + Max + +3 + 20 + diff --git a/examples/GraphEditGraphSwitchs_4.py b/examples/GraphEditGraphSwitchs_4.py new file mode 100644 index 0000000..57ad2ad --- /dev/null +++ b/examples/GraphEditGraphSwitchs_4.py @@ -0,0 +1,206 @@ + +# Generated python file of Graph GraphEditSwitchs + +from SuperV import * + +# Graph creation of GraphEditSwitchs +def DefGraphEditSwitchs() : + GraphEditSwitchs = Graph( 'GraphEditSwitchs' ) + GraphEditSwitchs.SetName( 'GraphEditSwitchs' ) + GraphEditSwitchs.SetAuthor( '' ) + GraphEditSwitchs.SetComment( '' ) + GraphEditSwitchs.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsOdd = [] + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd(a) : ' ) + PyIsOdd.append( ' print a,"IsOdd (GraphSwitchs)" ' ) + PyIsOdd.append( ' sleep( 1 ) ' ) + PyIsOdd.append( ' return a ' ) + IsOdd = GraphEditSwitchs.INode( 'IsOdd' , PyIsOdd ) + IsOdd.SetName( 'IsOdd' ) + IsOdd.SetAuthor( '' ) + IsOdd.SetComment( 'Python function' ) + IsOdd.Coords( 388 , 50 ) + IIsOdda = IsOdd.InPort( 'a' , 'long' ) + IIsOddGate = IsOdd.GetInPort( 'Gate' ) + OIsOdda = IsOdd.OutPort( 'a' , 'long' ) + OIsOddGate = IsOdd.GetOutPort( 'Gate' ) + + PyIsEven = [] + PyIsEven.append( 'from time import * ' ) + PyIsEven.append( 'def IsOdd(a) : ' ) + PyIsEven.append( ' print a,"IsOdd_1 (GraphSwitchs)" ' ) + PyIsEven.append( ' sleep( 1 ) ' ) + PyIsEven.append( ' return a ' ) + IsEven = GraphEditSwitchs.INode( 'IsOdd' , PyIsEven ) + IsEven.SetName( 'IsEven' ) + IsEven.SetAuthor( '' ) + IsEven.SetComment( 'Python function' ) + IsEven.Coords( 419 , 308 ) + IIsEvena = IsEven.InPort( 'a' , 'long' ) + IIsEvenGate = IsEven.GetInPort( 'Gate' ) + OIsEvena = IsEven.OutPort( 'a' , 'long' ) + OIsEvenGate = IsEven.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyInitLoop = [] + PyInitLoop.append( 'def InitLoop(Index,Min,Max) : ' ) + PyInitLoop.append( ' return Index,Min,Max ' ) + PyMoreInitLoop = [] + PyMoreInitLoop.append( 'def MoreLoop(Index,Min,Max) : ' ) + PyMoreInitLoop.append( ' if Index <= Max : ' ) + PyMoreInitLoop.append( ' DoLoop = 1 ' ) + PyMoreInitLoop.append( ' else : ' ) + PyMoreInitLoop.append( ' DoLoop = 0 ' ) + PyMoreInitLoop.append( ' return DoLoop,Index,Min,Max ' ) + PyNextInitLoop = [] + PyNextInitLoop.append( 'def NextLoop(Index,Min,Max) : ' ) + PyNextInitLoop.append( ' Index = Index + 1 ' ) + PyNextInitLoop.append( ' return Index,Min,Max ' ) + InitLoop,EndOfInitLoop = GraphEditSwitchs.LNode( 'InitLoop' , PyInitLoop , 'MoreLoop' , PyMoreInitLoop , 'NextLoop' , PyNextInitLoop ) + EndOfInitLoop.SetName( 'EndOfInitLoop' ) + EndOfInitLoop.SetAuthor( '' ) + EndOfInitLoop.SetComment( 'Compute Node' ) + EndOfInitLoop.Coords( 783 , 381 ) + PyEndOfInitLoop = [] + EndOfInitLoop.SetPyFunction( '' , PyEndOfInitLoop ) + IInitLoopDoLoop = InitLoop.GetInPort( 'DoLoop' ) + IInitLoopIndex = InitLoop.InPort( 'Index' , 'long' ) + IInitLoopMin = InitLoop.InPort( 'Min' , 'long' ) + IInitLoopMax = InitLoop.InPort( 'Max' , 'long' ) + IInitLoopGate = InitLoop.GetInPort( 'Gate' ) + OInitLoopDoLoop = InitLoop.GetOutPort( 'DoLoop' ) + OInitLoopIndex = InitLoop.GetOutPort( 'Index' ) + OInitLoopMin = InitLoop.GetOutPort( 'Min' ) + OInitLoopMax = InitLoop.GetOutPort( 'Max' ) + IEndOfInitLoopDoLoop = EndOfInitLoop.GetInPort( 'DoLoop' ) + IEndOfInitLoopIndex = EndOfInitLoop.GetInPort( 'Index' ) + IEndOfInitLoopMin = EndOfInitLoop.GetInPort( 'Min' ) + IEndOfInitLoopMax = EndOfInitLoop.GetInPort( 'Max' ) + IEndOfInitLoopGate = EndOfInitLoop.GetInPort( 'Gate' ) + OEndOfInitLoopDoLoop = EndOfInitLoop.GetOutPort( 'DoLoop' ) + OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) + OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) + OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) + OEndOfInitLoopGate = EndOfInitLoop.GetOutPort( 'Gate' ) + InitLoop.SetName( 'InitLoop' ) + InitLoop.SetAuthor( '' ) + InitLoop.SetComment( 'Compute Node' ) + InitLoop.Coords( 10 , 388 ) + + # Creation of Switch Nodes + PySwitch = [] + PySwitch.append( 'from time import * ' ) + PySwitch.append( 'def Switch(a) : ' ) + PySwitch.append( ' if ( a & 1 ) == 0 : ' ) + PySwitch.append( ' sleep(1) ' ) + PySwitch.append( ' return a & 1,1-(a&1),a ' ) + Switch,EndOfSwitch = GraphEditSwitchs.SNode( 'Switch' , PySwitch ) + EndOfSwitch.SetName( 'EndOfSwitch' ) + EndOfSwitch.SetAuthor( '' ) + EndOfSwitch.SetComment( 'Compute Node' ) + EndOfSwitch.Coords( 587 , 126 ) + PyEndOfSwitch = [] + EndOfSwitch.SetPyFunction( '' , PyEndOfSwitch ) + IEndOfSwitcha = EndOfSwitch.InPort( 'a' , 'long' ) + IEndOfSwitchDefault = EndOfSwitch.GetInPort( 'Default' ) + OEndOfSwitcha = EndOfSwitch.OutPort( 'a' , 'long' ) + OEndOfSwitchGate = EndOfSwitch.GetOutPort( 'Gate' ) + Switch.SetName( 'Switch' ) + Switch.SetAuthor( '' ) + Switch.SetComment( 'Compute Node' ) + Switch.Coords( 186 , 130 ) + ISwitcha = Switch.InPort( 'a' , 'long' ) + ISwitchGate = Switch.GetInPort( 'Gate' ) + OSwitchOdd = Switch.OutPort( 'Odd' , 'long' ) + OSwitchEven = Switch.OutPort( 'Even' , 'int' ) + OSwitcha = Switch.OutPort( 'a' , 'int' ) + OSwitchDefault = Switch.GetOutPort( 'Default' ) + + PySwitch_1 = [] + PySwitch_1.append( 'from time import * ' ) + PySwitch_1.append( 'def Switch(a) : ' ) + PySwitch_1.append( ' if ( a & 1 ) == 0 : ' ) + PySwitch_1.append( ' sleep(1) ' ) + PySwitch_1.append( ' return a & 1,1-(a&1),a ' ) + Switch_1,EndSwitch = GraphEditSwitchs.SNode( 'Switch' , PySwitch_1 ) + EndSwitch.SetName( 'EndSwitch' ) + EndSwitch.SetAuthor( '' ) + EndSwitch.SetComment( 'Compute Node' ) + EndSwitch.Coords( 605 , 382 ) + PyEndSwitch = [] + EndSwitch.SetPyFunction( '' , PyEndSwitch ) + IEndSwitcha = EndSwitch.InPort( 'a' , 'long' ) + IEndSwitchDefault = EndSwitch.GetInPort( 'Default' ) + OEndSwitcha = EndSwitch.OutPort( 'a' , 'long' ) + OEndSwitchGate = EndSwitch.GetOutPort( 'Gate' ) + Switch_1.SetName( 'Switch_1' ) + Switch_1.SetAuthor( '' ) + Switch_1.SetComment( 'Compute Node' ) + Switch_1.Coords( 193 , 388 ) + ISwitch_1a = Switch_1.InPort( 'a' , 'long' ) + ISwitch_1Gate = Switch_1.GetInPort( 'Gate' ) + OSwitch_1Odd = Switch_1.OutPort( 'Odd' , 'long' ) + OSwitch_1Even = Switch_1.OutPort( 'Even' , 'int' ) + OSwitch_1a = Switch_1.OutPort( 'a' , 'int' ) + OSwitch_1Default = Switch_1.GetOutPort( 'Default' ) + + # Creation of Links + LIsOddaEndOfSwitcha = GraphEditSwitchs.Link( OIsOdda , IEndOfSwitcha ) + LIsOddaEndOfSwitcha.AddCoord( 1 , 573 , 160 ) + LIsOddaEndOfSwitcha.AddCoord( 2 , 572 , 130 ) + + LIsEvenaEndSwitcha = GraphEditSwitchs.Link( OIsEvena , IEndSwitcha ) + LIsEvenaEndSwitcha.AddCoord( 1 , 599 , 416 ) + LIsEvenaEndSwitcha.AddCoord( 2 , 598 , 389 ) + + LInitLoopIndexSwitch_1a = GraphEditSwitchs.Link( OInitLoopIndex , ISwitch_1a ) + + LInitLoopIndexSwitcha = GraphEditSwitchs.Link( OInitLoopIndex , ISwitcha ) + + LInitLoopMinEndOfInitLoopMin = GraphEditSwitchs.Link( OInitLoopMin , IEndOfInitLoopMin ) + + LInitLoopMaxEndOfInitLoopMax = GraphEditSwitchs.Link( OInitLoopMax , IEndOfInitLoopMax ) + + LSwitchOddIsOddGate = GraphEditSwitchs.Link( OSwitchOdd , IIsOddGate ) + + LSwitchaIsOdda = GraphEditSwitchs.Link( OSwitcha , IIsOdda ) + LSwitchaIsOdda.AddCoord( 1 , 365 , 129 ) + LSwitchaIsOdda.AddCoord( 2 , 365 , 222 ) + + LSwitchDefaultEndOfSwitchDefault = GraphEditSwitchs.Link( OSwitchDefault , IEndOfSwitchDefault ) + LSwitchDefaultEndOfSwitchDefault.AddCoord( 1 , 572 , 194 ) + LSwitchDefaultEndOfSwitchDefault.AddCoord( 2 , 571 , 257 ) + + LEndOfSwitchaEndOfInitLoopIndex = GraphEditSwitchs.Link( OEndOfSwitcha , IEndOfInitLoopIndex ) + + LSwitch_1EvenEndSwitchDefault = GraphEditSwitchs.Link( OSwitch_1Even , IEndSwitchDefault ) + + LSwitch_1EvenIsEvenGate = GraphEditSwitchs.Link( OSwitch_1Even , IIsEvenGate ) + + LEndSwitchGateEndOfInitLoopGate = GraphEditSwitchs.Link( OEndSwitchGate , IEndOfInitLoopGate ) + + # Input datas + IInitLoopIndex.Input( 0 ) + IInitLoopMin.Input( 0 ) + IInitLoopMax.Input( 20 ) + + # Input Ports of the graph + #IIsEvena = IsEven.GetInPort( 'a' ) + + # Output Ports of the graph + #OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) + #OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) + #OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) + #OSwitchEven = Switch.GetOutPort( 'Even' ) + #OSwitch_1Odd = Switch_1.GetOutPort( 'Odd' ) + #OSwitch_1a = Switch_1.GetOutPort( 'a' ) + #OEndSwitcha = EndSwitch.GetOutPort( 'a' ) + return GraphEditSwitchs + + +GraphEditSwitchs = DefGraphEditSwitchs() diff --git a/examples/GraphEditGraphSwitchs_4.xml b/examples/GraphEditGraphSwitchs_4.xml new file mode 100644 index 0000000..c1157a0 --- /dev/null +++ b/examples/GraphEditGraphSwitchs_4.xml @@ -0,0 +1,499 @@ + + + + + +? + ? + GraphEditSwitchs + 1 + ? + +GraphEditSwitchs + + +long + IsEven__a + +long + InitLoop__Index + +long + InitLoop__Min + +long + InitLoop__Max + + +long + EndOfInitLoop__Index + +long + EndOfInitLoop__Min + +long + EndOfInitLoop__Max + +int + Switch__Even + +long + Switch_1__Odd + +int + Switch_1__a + +long + EndSwitch__a + + + 3/2/2005 - 16:14:10 + 3/2/2005 - 16:56:34 + 2.0 + ? + ? + ? + 0 + 0 + + +? + ? + IsOdd + 3 + ? + +IsOdd + + +long + a + + +long + a + + + +IsOdd + + + + + + 3/2/2005 - 16:54:2 + 3/2/2005 - 16:54:2 + 2.0 + ? + ? + Python function + 388 + 50 + +? + ? + IsEven + 3 + ? + +IsOdd_1 + + +long + a + + +long + a + + + +IsOdd + + + + + + 3/2/2005 - 16:54:2 + 3/2/2005 - 16:54:2 + 2.0 + ? + ? + Python function + 419 + 308 + +? + ? + InitLoop + 4 + EndOfInitLoop + +InitLoop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +InitLoop + + + +MoreLoop + + + + + + + +NextLoop + + + + 3/2/2005 - 16:54:2 + 3/2/2005 - 16:54:2 + 2.0 + ? + ? + Compute Node + 10 + 388 + +? + ? + EndOfInitLoop + 5 + InitLoop + +EndOfInitLoop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +? + + 3/2/2005 - 16:54:2 + 3/2/2005 - 16:54:2 + 2.0 + ? + ? + Compute Node + 783 + 381 + +? + ? + Switch + 6 + EndOfSwitch + +Switch + + +long + a + + +long + Odd + +int + Even + +int + a + + + +Switch + + + + + + 3/2/2005 - 16:54:2 + 3/2/2005 - 16:54:2 + 2.0 + ? + ? + Compute Node + 186 + 130 + +? + ? + EndOfSwitch + 7 + Switch + +EndOfSwitch + + +long + a + + +long + a + + + +? + + 3/2/2005 - 16:54:2 + 3/2/2005 - 16:54:2 + 2.0 + ? + ? + Compute Node + 587 + 126 + +? + ? + Switch_1 + 6 + EndSwitch + +Switch_1 + + +long + a + + +long + Odd + +int + Even + +int + a + + + +Switch + + + + + + 3/2/2005 - 16:54:2 + 3/2/2005 - 16:54:2 + 2.0 + ? + ? + Compute Node + 193 + 388 + +? + ? + EndSwitch + 7 + Switch_1 + +EndSwitch + + +long + a + + +long + a + + + +? + + 3/2/2005 - 16:54:2 + 3/2/2005 - 16:54:2 + 2.0 + ? + ? + Compute Node + 605 + 382 + + +IsOdd + a + EndOfSwitch + a + + +573 + 160 + +572 + 130 + +IsEven + a + EndSwitch + a + + +599 + 416 + +598 + 389 + +InitLoop + DoLoop + EndOfInitLoop + DoLoop + + +InitLoop + Index + Switch_1 + a + + +InitLoop + Index + Switch + a + + +InitLoop + Min + EndOfInitLoop + Min + + +InitLoop + Max + EndOfInitLoop + Max + + +EndOfInitLoop + DoLoop + InitLoop + DoLoop + + +Switch + Odd + IsOdd + Gate + + +Switch + a + IsOdd + a + + +365 + 129 + +365 + 222 + +Switch + Default + EndOfSwitch + Default + + +572 + 194 + +571 + 257 + +EndOfSwitch + a + EndOfInitLoop + Index + + +Switch_1 + Even + EndSwitch + Default + + +Switch_1 + Even + IsEven + Gate + + +EndSwitch + Gate + EndOfInitLoop + Gate + + + +GraphEditSwitchs + InitLoop__Index + InitLoop + Index + +3 + 0 + + +GraphEditSwitchs + InitLoop__Min + InitLoop + Min + +3 + 0 + + +GraphEditSwitchs + InitLoop__Max + InitLoop + Max + +3 + 20 + diff --git a/examples/GraphEditGraphSwitchs_5.py b/examples/GraphEditGraphSwitchs_5.py new file mode 100644 index 0000000..edbe8ea --- /dev/null +++ b/examples/GraphEditGraphSwitchs_5.py @@ -0,0 +1,204 @@ + +# Generated python file of Graph GraphEditSwitchs_5 + +from SuperV import * + +# Graph creation of GraphEditSwitchs_5 +def DefGraphEditSwitchs_5() : + GraphEditSwitchs_5 = Graph( 'GraphEditSwitchs_5' ) + GraphEditSwitchs_5.SetName( 'GraphEditSwitchs_5' ) + GraphEditSwitchs_5.SetAuthor( '' ) + GraphEditSwitchs_5.SetComment( '' ) + GraphEditSwitchs_5.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsOdd = [] + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd(a) : ' ) + PyIsOdd.append( ' print a,"IsOdd (GraphSwitchs)" ' ) + PyIsOdd.append( ' sleep( 1 ) ' ) + PyIsOdd.append( ' return a ' ) + IsOdd = GraphEditSwitchs_5.INode( 'IsOdd' , PyIsOdd ) + IsOdd.SetName( 'IsOdd' ) + IsOdd.SetAuthor( '' ) + IsOdd.SetComment( 'Python function' ) + IsOdd.Coords( 388 , 50 ) + IIsOdda = IsOdd.InPort( 'a' , 'long' ) + IIsOddGate = IsOdd.GetInPort( 'Gate' ) + OIsOdda = IsOdd.OutPort( 'a' , 'long' ) + OIsOddGate = IsOdd.GetOutPort( 'Gate' ) + + PyIsEven = [] + PyIsEven.append( 'from time import * ' ) + PyIsEven.append( 'def IsEven(a) : ' ) + PyIsEven.append( ' print a,"IsEven" ' ) + PyIsEven.append( ' sleep( 1 ) ' ) + PyIsEven.append( ' return a ' ) + IsEven = GraphEditSwitchs_5.INode( 'IsEven' , PyIsEven ) + IsEven.SetName( 'IsEven' ) + IsEven.SetAuthor( '' ) + IsEven.SetComment( 'Python function' ) + IsEven.Coords( 419 , 308 ) + IIsEvena = IsEven.InPort( 'a' , 'long' ) + IIsEvenGate = IsEven.GetInPort( 'Gate' ) + OIsEvena = IsEven.OutPort( 'a' , 'long' ) + OIsEvenGate = IsEven.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyInitLoop = [] + PyInitLoop.append( 'def InitLoop(Index,Min,Max) : ' ) + PyInitLoop.append( ' return Index,Min,Max ' ) + PyMoreInitLoop = [] + PyMoreInitLoop.append( 'def MoreLoop(Index,Min,Max) : ' ) + PyMoreInitLoop.append( ' if Index <= Max : ' ) + PyMoreInitLoop.append( ' DoLoop = 1 ' ) + PyMoreInitLoop.append( ' else : ' ) + PyMoreInitLoop.append( ' DoLoop = 0 ' ) + PyMoreInitLoop.append( ' return DoLoop,Index,Min,Max ' ) + PyNextInitLoop = [] + PyNextInitLoop.append( 'def NextLoop(Index,Min,Max) : ' ) + PyNextInitLoop.append( ' Index = Index + 1 ' ) + PyNextInitLoop.append( ' return Index,Min,Max ' ) + InitLoop,EndOfInitLoop = GraphEditSwitchs_5.LNode( 'InitLoop' , PyInitLoop , 'MoreLoop' , PyMoreInitLoop , 'NextLoop' , PyNextInitLoop ) + EndOfInitLoop.SetName( 'EndOfInitLoop' ) + EndOfInitLoop.SetAuthor( '' ) + EndOfInitLoop.SetComment( 'Compute Node' ) + EndOfInitLoop.Coords( 783 , 381 ) + PyEndOfInitLoop = [] + EndOfInitLoop.SetPyFunction( '' , PyEndOfInitLoop ) + IInitLoopDoLoop = InitLoop.GetInPort( 'DoLoop' ) + IInitLoopIndex = InitLoop.InPort( 'Index' , 'long' ) + IInitLoopMin = InitLoop.InPort( 'Min' , 'long' ) + IInitLoopMax = InitLoop.InPort( 'Max' , 'long' ) + IInitLoopGate = InitLoop.GetInPort( 'Gate' ) + OInitLoopDoLoop = InitLoop.GetOutPort( 'DoLoop' ) + OInitLoopIndex = InitLoop.GetOutPort( 'Index' ) + OInitLoopMin = InitLoop.GetOutPort( 'Min' ) + OInitLoopMax = InitLoop.GetOutPort( 'Max' ) + IEndOfInitLoopDoLoop = EndOfInitLoop.GetInPort( 'DoLoop' ) + IEndOfInitLoopIndex = EndOfInitLoop.GetInPort( 'Index' ) + IEndOfInitLoopMin = EndOfInitLoop.GetInPort( 'Min' ) + IEndOfInitLoopMax = EndOfInitLoop.GetInPort( 'Max' ) + IEndOfInitLoopGate = EndOfInitLoop.GetInPort( 'Gate' ) + OEndOfInitLoopDoLoop = EndOfInitLoop.GetOutPort( 'DoLoop' ) + OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) + OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) + OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) + OEndOfInitLoopGate = EndOfInitLoop.GetOutPort( 'Gate' ) + InitLoop.SetName( 'InitLoop' ) + InitLoop.SetAuthor( '' ) + InitLoop.SetComment( 'Compute Node' ) + InitLoop.Coords( 10 , 388 ) + + # Creation of Switch Nodes + PySwitch = [] + PySwitch.append( 'from time import * ' ) + PySwitch.append( 'def Switch(a) : ' ) + PySwitch.append( ' if ( a & 1 ) == 0 : ' ) + PySwitch.append( ' sleep(1) ' ) + PySwitch.append( ' return a & 1,1-(a&1),a ' ) + Switch,EndOfSwitch = GraphEditSwitchs_5.SNode( 'Switch' , PySwitch ) + EndOfSwitch.SetName( 'EndOfSwitch' ) + EndOfSwitch.SetAuthor( '' ) + EndOfSwitch.SetComment( 'Compute Node' ) + EndOfSwitch.Coords( 587 , 126 ) + PyEndOfSwitch = [] + EndOfSwitch.SetPyFunction( '' , PyEndOfSwitch ) + IEndOfSwitcha = EndOfSwitch.InPort( 'a' , 'long' ) + IEndOfSwitchDefault = EndOfSwitch.GetInPort( 'Default' ) + OEndOfSwitcha = EndOfSwitch.OutPort( 'a' , 'long' ) + OEndOfSwitchGate = EndOfSwitch.GetOutPort( 'Gate' ) + Switch.SetName( 'Switch' ) + Switch.SetAuthor( '' ) + Switch.SetComment( 'Compute Node' ) + Switch.Coords( 186 , 130 ) + ISwitcha = Switch.InPort( 'a' , 'long' ) + ISwitchGate = Switch.GetInPort( 'Gate' ) + OSwitchOdd = Switch.OutPort( 'Odd' , 'long' ) + OSwitchEven = Switch.OutPort( 'Even' , 'int' ) + OSwitcha = Switch.OutPort( 'a' , 'int' ) + OSwitchDefault = Switch.GetOutPort( 'Default' ) + + PySwitch_1 = [] + PySwitch_1.append( 'from time import * ' ) + PySwitch_1.append( 'def Switch(a) : ' ) + PySwitch_1.append( ' if ( a & 1 ) == 0 : ' ) + PySwitch_1.append( ' sleep(1) ' ) + PySwitch_1.append( ' return a & 1,1-(a&1),a ' ) + Switch_1,EndSwitch = GraphEditSwitchs_5.SNode( 'Switch' , PySwitch_1 ) + EndSwitch.SetName( 'EndSwitch' ) + EndSwitch.SetAuthor( '' ) + EndSwitch.SetComment( 'Compute Node' ) + EndSwitch.Coords( 605 , 382 ) + PyEndSwitch = [] + EndSwitch.SetPyFunction( '' , PyEndSwitch ) + IEndSwitcha = EndSwitch.InPort( 'a' , 'long' ) + IEndSwitchDefault = EndSwitch.GetInPort( 'Default' ) + OEndSwitcha = EndSwitch.OutPort( 'a' , 'long' ) + OEndSwitchGate = EndSwitch.GetOutPort( 'Gate' ) + Switch_1.SetName( 'Switch_1' ) + Switch_1.SetAuthor( '' ) + Switch_1.SetComment( 'Compute Node' ) + Switch_1.Coords( 193 , 388 ) + ISwitch_1a = Switch_1.InPort( 'a' , 'long' ) + ISwitch_1Gate = Switch_1.GetInPort( 'Gate' ) + OSwitch_1Odd = Switch_1.OutPort( 'Odd' , 'long' ) + OSwitch_1Even = Switch_1.OutPort( 'Even' , 'int' ) + OSwitch_1a = Switch_1.OutPort( 'a' , 'int' ) + OSwitch_1Default = Switch_1.GetOutPort( 'Default' ) + + # Creation of Links + LIsOddaEndOfSwitcha = GraphEditSwitchs_5.Link( OIsOdda , IEndOfSwitcha ) + LIsOddaEndOfSwitcha.AddCoord( 1 , 573 , 160 ) + LIsOddaEndOfSwitcha.AddCoord( 2 , 572 , 130 ) + + LIsEvenaEndSwitcha = GraphEditSwitchs_5.Link( OIsEvena , IEndSwitcha ) + LIsEvenaEndSwitcha.AddCoord( 1 , 599 , 416 ) + LIsEvenaEndSwitcha.AddCoord( 2 , 598 , 389 ) + + LInitLoopIndexSwitch_1a = GraphEditSwitchs_5.Link( OInitLoopIndex , ISwitch_1a ) + + LInitLoopIndexSwitcha = GraphEditSwitchs_5.Link( OInitLoopIndex , ISwitcha ) + + LInitLoopMinEndOfInitLoopMin = GraphEditSwitchs_5.Link( OInitLoopMin , IEndOfInitLoopMin ) + + LInitLoopMaxEndOfInitLoopMax = GraphEditSwitchs_5.Link( OInitLoopMax , IEndOfInitLoopMax ) + + LSwitchOddIsOddGate = GraphEditSwitchs_5.Link( OSwitchOdd , IIsOddGate ) + + LSwitchaIsOdda = GraphEditSwitchs_5.Link( OSwitcha , IIsOdda ) + LSwitchaIsOdda.AddCoord( 1 , 365 , 129 ) + LSwitchaIsOdda.AddCoord( 2 , 365 , 222 ) + + LSwitchDefaultEndOfSwitchDefault = GraphEditSwitchs_5.Link( OSwitchDefault , IEndOfSwitchDefault ) + LSwitchDefaultEndOfSwitchDefault.AddCoord( 1 , 572 , 194 ) + LSwitchDefaultEndOfSwitchDefault.AddCoord( 2 , 571 , 257 ) + + LEndOfSwitchaEndOfInitLoopIndex = GraphEditSwitchs_5.Link( OEndOfSwitcha , IEndOfInitLoopIndex ) + + LSwitch_1EvenIsEvenGate = GraphEditSwitchs_5.Link( OSwitch_1Even , IIsEvenGate ) + + LSwitch_1aIsEvena = GraphEditSwitchs_5.Link( OSwitch_1a , IIsEvena ) + + LSwitch_1DefaultEndSwitchDefault = GraphEditSwitchs_5.Link( OSwitch_1Default , IEndSwitchDefault ) + + LEndSwitchGateEndOfInitLoopGate = GraphEditSwitchs_5.Link( OEndSwitchGate , IEndOfInitLoopGate ) + + # Input datas + IInitLoopIndex.Input( 0 ) + IInitLoopMin.Input( 0 ) + IInitLoopMax.Input( 20 ) + + # Output Ports of the graph + #OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' ) + #OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' ) + #OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' ) + #OSwitchEven = Switch.GetOutPort( 'Even' ) + #OSwitch_1Odd = Switch_1.GetOutPort( 'Odd' ) + #OEndSwitcha = EndSwitch.GetOutPort( 'a' ) + return GraphEditSwitchs_5 + + +GraphEditSwitchs_5 = DefGraphEditSwitchs_5() diff --git a/examples/GraphEditGraphSwitchs_5.xml b/examples/GraphEditGraphSwitchs_5.xml new file mode 100644 index 0000000..3a362c5 --- /dev/null +++ b/examples/GraphEditGraphSwitchs_5.xml @@ -0,0 +1,499 @@ + + + + + +? + ? + GraphEditSwitchs_5 + 1 + ? + +GraphEditSwitchs_5 + + +long + InitLoop__Index + +long + InitLoop__Min + +long + InitLoop__Max + + +long + EndOfInitLoop__Index + +long + EndOfInitLoop__Min + +long + EndOfInitLoop__Max + +int + Switch__Even + +long + Switch_1__Odd + +long + EndSwitch__a + + + 3/2/2005 - 16:14:10 + 3/2/2005 - 17:6:22 + 2.0 + ? + ? + ? + 0 + 0 + + +? + ? + IsOdd + 3 + ? + +IsOdd + + +long + a + + +long + a + + + +IsOdd + + + + + + 3/2/2005 - 17:6:22 + 3/2/2005 - 17:6:22 + 2.0 + ? + ? + Python function + 388 + 50 + +? + ? + IsEven + 3 + ? + +IsEven + + +long + a + + +long + a + + + +IsEven + + + + + + 3/2/2005 - 17:6:22 + 3/2/2005 - 17:6:22 + 2.0 + ? + ? + Python function + 419 + 308 + +? + ? + InitLoop + 4 + EndOfInitLoop + +InitLoop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +InitLoop + + + +MoreLoop + + + + + + + +NextLoop + + + + 3/2/2005 - 17:6:22 + 3/2/2005 - 17:6:22 + 2.0 + ? + ? + Compute Node + 10 + 388 + +? + ? + EndOfInitLoop + 5 + InitLoop + +EndOfInitLoop + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +? + + 3/2/2005 - 17:6:22 + 3/2/2005 - 17:6:22 + 2.0 + ? + ? + Compute Node + 783 + 381 + +? + ? + Switch + 6 + EndOfSwitch + +Switch + + +long + a + + +long + Odd + +int + Even + +int + a + + + +Switch + + + + + + 3/2/2005 - 17:6:22 + 3/2/2005 - 17:6:22 + 2.0 + ? + ? + Compute Node + 186 + 130 + +? + ? + EndOfSwitch + 7 + Switch + +EndOfSwitch + + +long + a + + +long + a + + + +? + + 3/2/2005 - 17:6:22 + 3/2/2005 - 17:6:22 + 2.0 + ? + ? + Compute Node + 587 + 126 + +? + ? + Switch_1 + 6 + EndSwitch + +Switch_1 + + +long + a + + +long + Odd + +int + Even + +int + a + + + +Switch + + + + + + 3/2/2005 - 17:6:22 + 3/2/2005 - 17:6:22 + 2.0 + ? + ? + Compute Node + 193 + 388 + +? + ? + EndSwitch + 7 + Switch_1 + +EndSwitch + + +long + a + + +long + a + + + +? + + 3/2/2005 - 17:6:22 + 3/2/2005 - 17:6:22 + 2.0 + ? + ? + Compute Node + 605 + 382 + + +IsOdd + a + EndOfSwitch + a + + +573 + 160 + +572 + 130 + +IsEven + a + EndSwitch + a + + +599 + 416 + +598 + 389 + +InitLoop + DoLoop + EndOfInitLoop + DoLoop + + +InitLoop + Index + Switch_1 + a + + +InitLoop + Index + Switch + a + + +InitLoop + Min + EndOfInitLoop + Min + + +InitLoop + Max + EndOfInitLoop + Max + + +EndOfInitLoop + DoLoop + InitLoop + DoLoop + + +Switch + Odd + IsOdd + Gate + + +Switch + a + IsOdd + a + + +365 + 129 + +365 + 222 + +Switch + Default + EndOfSwitch + Default + + +572 + 194 + +571 + 257 + +EndOfSwitch + a + EndOfInitLoop + Index + + +Switch_1 + Even + IsEven + Gate + + +Switch_1 + a + IsEven + a + + +Switch_1 + Default + EndSwitch + Default + + +EndSwitch + Gate + EndOfInitLoop + Gate + + + +GraphEditSwitchs_5 + InitLoop__Index + InitLoop + Index + +3 + 0 + + +GraphEditSwitchs_5 + InitLoop__Min + InitLoop + Min + +3 + 0 + + +GraphEditSwitchs_5 + InitLoop__Max + InitLoop + Max + +3 + 20 + -- 2.39.2