From 2243f51f8a67ea12a6709054fab6f72c1d0e68da Mon Sep 17 00:00:00 2001 From: rahuel Date: Thu, 13 Jan 2005 13:39:36 +0000 Subject: [PATCH] Graphs for tests of Switchs --- examples/GraphSwitchCheck.py | 268 +++++++++ examples/GraphSwitchCheck.xml | 628 ++++++++++++++++++++ examples/GraphSwitchCheckDefault.py | 299 ++++++++++ examples/GraphSwitchCheckDefault.xml | 708 +++++++++++++++++++++++ examples/GraphSwitchCheckDefault1.py | 298 ++++++++++ examples/GraphSwitchCheckDefault1.xml | 705 +++++++++++++++++++++++ examples/GraphSwitchCheckDefault2.py | 334 +++++++++++ examples/GraphSwitchCheckDefault2.xml | 787 ++++++++++++++++++++++++++ examples/GraphSwitchOutput.py | 211 +++++++ examples/GraphSwitchOutput.xml | 500 ++++++++++++++++ 10 files changed, 4738 insertions(+) create mode 100644 examples/GraphSwitchCheck.py create mode 100644 examples/GraphSwitchCheck.xml create mode 100644 examples/GraphSwitchCheckDefault.py create mode 100644 examples/GraphSwitchCheckDefault.xml create mode 100644 examples/GraphSwitchCheckDefault1.py create mode 100644 examples/GraphSwitchCheckDefault1.xml create mode 100644 examples/GraphSwitchCheckDefault2.py create mode 100644 examples/GraphSwitchCheckDefault2.xml create mode 100644 examples/GraphSwitchOutput.py create mode 100644 examples/GraphSwitchOutput.xml diff --git a/examples/GraphSwitchCheck.py b/examples/GraphSwitchCheck.py new file mode 100644 index 0000000..c060357 --- /dev/null +++ b/examples/GraphSwitchCheck.py @@ -0,0 +1,268 @@ + +# Generated python file of Graph GraphSwitchCheck + +from SuperV import * + +# Graph creation of GraphSwitchCheck +def DefGraphSwitchCheck() : + GraphSwitchCheck = Graph( 'GraphSwitchCheck' ) + GraphSwitchCheck.SetName( 'GraphSwitchCheck' ) + GraphSwitchCheck.SetAuthor( 'JR' ) + GraphSwitchCheck.SetComment( '' ) + GraphSwitchCheck.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 = GraphSwitchCheck.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 = GraphSwitchCheck.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 = GraphSwitchCheck.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 = GraphSwitchCheck.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 = GraphSwitchCheck.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' ) + + # 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 = GraphSwitchCheck.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 = GraphSwitchCheck.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( 195 , 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 = GraphSwitchCheck.Link( OIsOdda , IEmptyNodea ) + LIsOddaEmptyNodea.AddCoord( 1 , 646 , 78 ) + + LIsEvenaEndOfSwitcha = GraphSwitchCheck.Link( OIsEvena , IEndOfSwitcha ) + + LPrintOddBranchEmptyNodeBranch = GraphSwitchCheck.Link( OPrintOddBranch , IEmptyNodeBranch ) + + LPrintEvenBranchEndOfSwitchBranch = GraphSwitchCheck.Link( OPrintEvenBranch , IEndOfSwitchBranch ) + + LEmptyNodeaEndOfSwitcha = GraphSwitchCheck.Link( OEmptyNodea , IEndOfSwitcha ) + + LEmptyNodeBranchEndOfSwitchBranch = GraphSwitchCheck.Link( OEmptyNodeBranch , IEndOfSwitchBranch ) + + LInitLoopSwitchIndexSwitcha = GraphSwitchCheck.Link( OInitLoopSwitchIndex , ISwitcha ) + + LInitLoopSwitchMinEndOfInitLoopSwitchMin = GraphSwitchCheck.Link( OInitLoopSwitchMin , IEndOfInitLoopSwitchMin ) + + LInitLoopSwitchMaxEndOfInitLoopSwitchMax = GraphSwitchCheck.Link( OInitLoopSwitchMax , IEndOfInitLoopSwitchMax ) + + LSwitchOddIsOddGate = GraphSwitchCheck.Link( OSwitchOdd , IIsOddGate ) + LSwitchOddIsOddGate.AddCoord( 1 , 401 , 101 ) + LSwitchOddIsOddGate.AddCoord( 2 , 401 , 160 ) + + LSwitchOddPrintOddGate = GraphSwitchCheck.Link( OSwitchOdd , IPrintOddGate ) + LSwitchOddPrintOddGate.AddCoord( 1 , 401 , 245 ) + LSwitchOddPrintOddGate.AddCoord( 2 , 401 , 159 ) + + LSwitchEvenIsEvenGate = GraphSwitchCheck.Link( OSwitchEven , IIsEvenGate ) + LSwitchEvenIsEvenGate.AddCoord( 1 , 392 , 533 ) + LSwitchEvenIsEvenGate.AddCoord( 2 , 392 , 182 ) + + LSwitchEvenPrintEvenGate = GraphSwitchCheck.Link( OSwitchEven , IPrintEvenGate ) + LSwitchEvenPrintEvenGate.AddCoord( 1 , 392 , 403 ) + LSwitchEvenPrintEvenGate.AddCoord( 2 , 392 , 181 ) + + LSwitchaIsOdda = GraphSwitchCheck.Link( OSwitcha , IIsOdda ) + LSwitchaIsOdda.AddCoord( 1 , 382 , 78 ) + LSwitchaIsOdda.AddCoord( 2 , 382 , 199 ) + + LSwitchaIsEvena = GraphSwitchCheck.Link( OSwitcha , IIsEvena ) + LSwitchaIsEvena.AddCoord( 1 , 381 , 509 ) + LSwitchaIsEvena.AddCoord( 2 , 382 , 200 ) + + LSwitchaPrintOdda = GraphSwitchCheck.Link( OSwitcha , IPrintOdda ) + + LSwitchaPrintEvena = GraphSwitchCheck.Link( OSwitcha , IPrintEvena ) + LSwitchaPrintEvena.AddCoord( 1 , 381 , 361 ) + LSwitchaPrintEvena.AddCoord( 2 , 382 , 200 ) + + LSwitchBranchPrintOddBranch = GraphSwitchCheck.Link( OSwitchBranch , IPrintOddBranch ) + + LSwitchBranchPrintEvenBranch = GraphSwitchCheck.Link( OSwitchBranch , IPrintEvenBranch ) + LSwitchBranchPrintEvenBranch.AddCoord( 1 , 369 , 381 ) + LSwitchBranchPrintEvenBranch.AddCoord( 2 , 369 , 219 ) + + LSwitchDefaultEndOfSwitchDefault = GraphSwitchCheck.Link( OSwitchDefault , IEndOfSwitchDefault ) + + LEndOfSwitchaEndOfInitLoopSwitchIndex = GraphSwitchCheck.Link( OEndOfSwitcha , IEndOfInitLoopSwitchIndex ) + + # 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' ) + #OSwitchdefault = Switch.GetOutPort( 'default' ) + return GraphSwitchCheck + + +GraphSwitchCheck = DefGraphSwitchCheck() diff --git a/examples/GraphSwitchCheck.xml b/examples/GraphSwitchCheck.xml new file mode 100644 index 0000000..4587b78 --- /dev/null +++ b/examples/GraphSwitchCheck.xml @@ -0,0 +1,628 @@ + + + + + +? + ? + GraphSwitchCheck + 1 + ? + +GraphSwitchCheck + + +long + InitLoopSwitch__Index + +long + InitLoopSwitch__Min + +long + InitLoopSwitch__Max + + +long + EndOfInitLoopSwitch__Index + +long + EndOfInitLoopSwitch__Min + +long + EndOfInitLoopSwitch__Max + +boolean + Switch__default + + + 13/1/2005 - 11:48:50 + 13/1/2005 - 11:51:24 + 2.0 + JR + ? + ? + 0 + 0 + + +? + ? + IsOdd + 3 + ? + +IsOdd + + +long + a + + +long + a + + + +IsOdd + + + + + + 13/1/2005 - 11:50:18 + 13/1/2005 - 11:50:18 + 2.0 + ? + ? + Python function + 415 + 7 + +? + ? + IsEven + 3 + ? + +IsEven + + +long + a + + +long + a + + + +IsEven + + + + + + 13/1/2005 - 11:50:18 + 13/1/2005 - 11:50:18 + 2.0 + ? + ? + Compute Node + 421 + 438 + +? + ? + PrintOdd + 3 + ? + +Print + + +long + a + +string + Branch + + +string + Branch + + + +Print + + + + + + 13/1/2005 - 11:50:18 + 13/1/2005 - 11:50:18 + 2.0 + ? + ? + Compute Node + 415 + 130 + +? + ? + PrintEven + 3 + ? + +Print_1 + + +long + a + +string + Branch + + +string + Branch + + + +Print_1 + + + + + + 13/1/2005 - 11:50:18 + 13/1/2005 - 11:50:18 + 2.0 + ? + ? + Compute Node + 423 + 289 + +? + ? + EmptyNode + 3 + ? + +EmptyNode + + +long + a + +string + Branch + + +long + a + +string + Branch + + + +EmptyNode + + + + + 13/1/2005 - 11:50:18 + 13/1/2005 - 11:50:18 + 2.0 + ? + ? + Compute Node + 652 + 110 + +? + ? + InitLoopSwitch + 4 + EndOfInitLoopSwitch + +InitLoopSwitch + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +InitLoop + + + + +MoreLoop + + + + = Min : ]]> + + + + + +NextLoop + + + + 13/1/2005 - 11:50:18 + 13/1/2005 - 11:50:18 + 2.0 + ? + ? + Compute Node + 10 + 129 + +? + ? + EndOfInitLoopSwitch + 5 + InitLoopSwitch + +EndOfInitLoopSwitch + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +EndOfInitLoopSwitch + + + + + 13/1/2005 - 11:50:18 + 13/1/2005 - 11:50:18 + 2.0 + ? + ? + Compute Node + 1074 + 194 + +? + ? + Switch + 6 + EndOfSwitch + +Switch + + +long + a + + +long + Odd + +int + Even + +int + a + +string + Branch + +boolean + default + + + +Switch + + + + + + + + + + + + 13/1/2005 - 11:50:18 + 13/1/2005 - 11:50:18 + 2.0 + ? + ? + Compute Node + 195 + 129 + +? + ? + EndOfSwitch + 7 + Switch + +EndOfSwitch + + +long + a + +string + Branch + + +long + a + + + +EndOfSwitch + + + + + 13/1/2005 - 11:50:18 + 13/1/2005 - 11:50:18 + 2.0 + ? + ? + Compute Node + 882 + 194 + + +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 + + +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 + Branch + PrintOdd + Branch + + +Switch + Branch + PrintEven + Branch + + +369 + 381 + +369 + 219 + +Switch + Default + EndOfSwitch + Default + + +EndOfSwitch + a + EndOfInitLoopSwitch + Index + + + +GraphSwitchCheck + InitLoopSwitch__Index + InitLoopSwitch + Index + +3 + 0 + + +GraphSwitchCheck + InitLoopSwitch__Min + InitLoopSwitch + Min + +3 + -5 + + +GraphSwitchCheck + InitLoopSwitch__Max + InitLoopSwitch + Max + +3 + 10 + diff --git a/examples/GraphSwitchCheckDefault.py b/examples/GraphSwitchCheckDefault.py new file mode 100644 index 0000000..8232e30 --- /dev/null +++ b/examples/GraphSwitchCheckDefault.py @@ -0,0 +1,299 @@ + +# Generated python file of Graph GraphSwitchCheckDefault + +from SuperV import * + +# Graph creation of GraphSwitchCheckDefault +def DefGraphSwitchCheckDefault() : + GraphSwitchCheckDefault = Graph( 'GraphSwitchCheckDefault' ) + GraphSwitchCheckDefault.SetName( 'GraphSwitchCheckDefault' ) + GraphSwitchCheckDefault.SetAuthor( 'JR' ) + GraphSwitchCheckDefault.SetComment( '' ) + GraphSwitchCheckDefault.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 = GraphSwitchCheckDefault.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 = GraphSwitchCheckDefault.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 = GraphSwitchCheckDefault.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 = GraphSwitchCheckDefault.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 = GraphSwitchCheckDefault.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 = GraphSwitchCheckDefault.INode( 'Default' , PyDefault ) + Default.SetName( 'Default' ) + Default.SetAuthor( '' ) + Default.SetComment( 'Compute Node' ) + Default.Coords( 421 , 592 ) + IDefaulta = Default.InPort( 'a' , 'long' ) + IDefaultBranch = Default.InPort( 'Branch' , 'string' ) + IDefaultGate = Default.GetInPort( 'Gate' ) + ODefaulta = Default.OutPort( 'a' , 'long' ) + ODefaultBranch = Default.OutPort( 'Branch' , 'string' ) + ODefaultGate = Default.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyInitLoopSwitch = [] + PyInitLoopSwitch.append( 'def InitLoop(Index,Min,Max) : ' ) + 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 = GraphSwitchCheckDefault.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 = GraphSwitchCheckDefault.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 = GraphSwitchCheckDefault.Link( OIsOdda , IEmptyNodea ) + LIsOddaEmptyNodea.AddCoord( 1 , 646 , 78 ) + + LIsEvenaEndOfSwitcha = GraphSwitchCheckDefault.Link( OIsEvena , IEndOfSwitcha ) + + LPrintOddBranchEmptyNodeBranch = GraphSwitchCheckDefault.Link( OPrintOddBranch , IEmptyNodeBranch ) + + LPrintEvenBranchEndOfSwitchBranch = GraphSwitchCheckDefault.Link( OPrintEvenBranch , IEndOfSwitchBranch ) + + LEmptyNodeaEndOfSwitcha = GraphSwitchCheckDefault.Link( OEmptyNodea , IEndOfSwitcha ) + + LEmptyNodeBranchEndOfSwitchBranch = GraphSwitchCheckDefault.Link( OEmptyNodeBranch , IEndOfSwitchBranch ) + + LDefaultaEndOfSwitcha = GraphSwitchCheckDefault.Link( ODefaulta , IEndOfSwitcha ) + + LDefaultBranchEndOfSwitchBranch = GraphSwitchCheckDefault.Link( ODefaultBranch , IEndOfSwitchBranch ) + + LInitLoopSwitchIndexSwitcha = GraphSwitchCheckDefault.Link( OInitLoopSwitchIndex , ISwitcha ) + + LInitLoopSwitchMinEndOfInitLoopSwitchMin = GraphSwitchCheckDefault.Link( OInitLoopSwitchMin , IEndOfInitLoopSwitchMin ) + + LInitLoopSwitchMaxEndOfInitLoopSwitchMax = GraphSwitchCheckDefault.Link( OInitLoopSwitchMax , IEndOfInitLoopSwitchMax ) + + LSwitchOddIsOddGate = GraphSwitchCheckDefault.Link( OSwitchOdd , IIsOddGate ) + LSwitchOddIsOddGate.AddCoord( 1 , 401 , 101 ) + LSwitchOddIsOddGate.AddCoord( 2 , 401 , 160 ) + + LSwitchOddPrintOddGate = GraphSwitchCheckDefault.Link( OSwitchOdd , IPrintOddGate ) + LSwitchOddPrintOddGate.AddCoord( 1 , 401 , 245 ) + LSwitchOddPrintOddGate.AddCoord( 2 , 401 , 159 ) + + LSwitchEvenIsEvenGate = GraphSwitchCheckDefault.Link( OSwitchEven , IIsEvenGate ) + LSwitchEvenIsEvenGate.AddCoord( 1 , 392 , 533 ) + LSwitchEvenIsEvenGate.AddCoord( 2 , 392 , 182 ) + + LSwitchEvenPrintEvenGate = GraphSwitchCheckDefault.Link( OSwitchEven , IPrintEvenGate ) + LSwitchEvenPrintEvenGate.AddCoord( 1 , 392 , 403 ) + LSwitchEvenPrintEvenGate.AddCoord( 2 , 392 , 181 ) + + LSwitchaIsOdda = GraphSwitchCheckDefault.Link( OSwitcha , IIsOdda ) + LSwitchaIsOdda.AddCoord( 1 , 382 , 78 ) + LSwitchaIsOdda.AddCoord( 2 , 382 , 199 ) + + LSwitchaIsEvena = GraphSwitchCheckDefault.Link( OSwitcha , IIsEvena ) + LSwitchaIsEvena.AddCoord( 1 , 381 , 509 ) + LSwitchaIsEvena.AddCoord( 2 , 382 , 200 ) + + LSwitchaPrintOdda = GraphSwitchCheckDefault.Link( OSwitcha , IPrintOdda ) + + LSwitchaPrintEvena = GraphSwitchCheckDefault.Link( OSwitcha , IPrintEvena ) + LSwitchaPrintEvena.AddCoord( 1 , 381 , 361 ) + LSwitchaPrintEvena.AddCoord( 2 , 382 , 200 ) + + LSwitchaDefaulta = GraphSwitchCheckDefault.Link( OSwitcha , IDefaulta ) + LSwitchaDefaulta.AddCoord( 1 , 382 , 663 ) + LSwitchaDefaulta.AddCoord( 2 , 382 , 199 ) + + LSwitchBranchPrintOddBranch = GraphSwitchCheckDefault.Link( OSwitchBranch , IPrintOddBranch ) + + LSwitchBranchPrintEvenBranch = GraphSwitchCheckDefault.Link( OSwitchBranch , IPrintEvenBranch ) + LSwitchBranchPrintEvenBranch.AddCoord( 1 , 369 , 381 ) + LSwitchBranchPrintEvenBranch.AddCoord( 2 , 369 , 219 ) + + LSwitchBranchDefaultBranch = GraphSwitchCheckDefault.Link( OSwitchBranch , IDefaultBranch ) + LSwitchBranchDefaultBranch.AddCoord( 1 , 370 , 683 ) + LSwitchBranchDefaultBranch.AddCoord( 2 , 370 , 220 ) + + LSwitchDefaultDefaultGate = GraphSwitchCheckDefault.Link( OSwitchDefault , IDefaultGate ) + LSwitchDefaultDefaultGate.AddCoord( 1 , 360 , 707 ) + LSwitchDefaultDefaultGate.AddCoord( 2 , 360 , 263 ) + + LEndOfSwitchaEndOfInitLoopSwitchIndex = GraphSwitchCheckDefault.Link( OEndOfSwitcha , IEndOfInitLoopSwitchIndex ) + + # 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' ) + #OSwitchdefault = Switch.GetOutPort( 'default' ) + return GraphSwitchCheckDefault + + +GraphSwitchCheckDefault = DefGraphSwitchCheckDefault() diff --git a/examples/GraphSwitchCheckDefault.xml b/examples/GraphSwitchCheckDefault.xml new file mode 100644 index 0000000..81e7ab6 --- /dev/null +++ b/examples/GraphSwitchCheckDefault.xml @@ -0,0 +1,708 @@ + + + + + +? + ? + GraphSwitchCheckDefault + 1 + ? + +GraphSwitchCheck_2 + + +long + InitLoopSwitch__Index + +long + InitLoopSwitch__Min + +long + InitLoopSwitch__Max + + +long + EndOfInitLoopSwitch__Index + +long + EndOfInitLoopSwitch__Min + +long + EndOfInitLoopSwitch__Max + +boolean + Switch__default + + + 13/1/2005 - 12:21:43 + 13/1/2005 - 12:23:17 + 2.0 + JR + ? + ? + 0 + 0 + + +? + ? + IsOdd + 3 + ? + +IsOdd + + +long + a + + +long + a + + + +IsOdd + + + + + + 13/1/2005 - 12:23:17 + 13/1/2005 - 12:23:17 + 2.0 + ? + ? + Python function + 415 + 7 + +? + ? + IsEven + 3 + ? + +IsEven + + +long + a + + +long + a + + + +IsEven + + + + + + 13/1/2005 - 12:23:17 + 13/1/2005 - 12:23:17 + 2.0 + ? + ? + Compute Node + 421 + 438 + +? + ? + PrintOdd + 3 + ? + +PrintOdd + + +long + a + +string + Branch + + +string + Branch + + + +Print + + + + + + 13/1/2005 - 12:23:17 + 13/1/2005 - 12:23:17 + 2.0 + ? + ? + Compute Node + 415 + 130 + +? + ? + PrintEven + 3 + ? + +PrintEven + + +long + a + +string + Branch + + +string + Branch + + + +Print_1 + + + + + + 13/1/2005 - 12:23:17 + 13/1/2005 - 12:23:17 + 2.0 + ? + ? + Compute Node + 423 + 289 + +? + ? + EmptyNode + 3 + ? + +EmptyNode + + +long + a + +string + Branch + + +long + a + +string + Branch + + + +EmptyNode + + + + + 13/1/2005 - 12:23:17 + 13/1/2005 - 12:23:17 + 2.0 + ? + ? + Compute Node + 652 + 110 + +? + ? + Default + 3 + ? + +Default + + +long + a + +string + Branch + + +long + a + +string + Branch + + + +Default + + + + + 13/1/2005 - 12:23:17 + 13/1/2005 - 12:23:17 + 2.0 + ? + ? + Compute Node + 421 + 592 + +? + ? + InitLoopSwitch + 4 + EndOfInitLoopSwitch + +InitLoopSwitch + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +InitLoop + + + + +MoreLoop + + + + = Min : ]]> + + + + + +NextLoop + + + + 13/1/2005 - 12:23:17 + 13/1/2005 - 12:23:17 + 2.0 + ? + ? + Compute Node + 10 + 129 + +? + ? + EndOfInitLoopSwitch + 5 + InitLoopSwitch + +EndOfInitLoopSwitch + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +EndOfInitLoopSwitch + + + + + 13/1/2005 - 12:23:17 + 13/1/2005 - 12:23:17 + 2.0 + ? + ? + Compute Node + 1074 + 194 + +? + ? + Switch + 6 + EndOfSwitch + +Switch + + +long + a + + +long + Odd + +int + Even + +int + a + +string + Branch + +boolean + default + + + +Switch + + + + + + + + + + + + 13/1/2005 - 12:23:17 + 13/1/2005 - 12:23:17 + 2.0 + ? + ? + Compute Node + 190 + 129 + +? + ? + EndOfSwitch + 7 + Switch + +EndOfSwitch + + +long + a + +string + Branch + + +long + a + + + +EndOfSwitch + + + + + 13/1/2005 - 12:23:17 + 13/1/2005 - 12:23:17 + 2.0 + ? + ? + Compute Node + 882 + 194 + + +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 + EndOfSwitch + a + + +Default + 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 + 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 + + +360 + 707 + +360 + 263 + +EndOfSwitch + a + EndOfInitLoopSwitch + Index + + + +GraphSwitchCheckDefault + InitLoopSwitch__Index + InitLoopSwitch + Index + +3 + 0 + + +GraphSwitchCheckDefault + InitLoopSwitch__Min + InitLoopSwitch + Min + +3 + -5 + + +GraphSwitchCheckDefault + InitLoopSwitch__Max + InitLoopSwitch + Max + +3 + 10 + diff --git a/examples/GraphSwitchCheckDefault1.py b/examples/GraphSwitchCheckDefault1.py new file mode 100644 index 0000000..a7cbc2a --- /dev/null +++ b/examples/GraphSwitchCheckDefault1.py @@ -0,0 +1,298 @@ + +# Generated python file of Graph GraphSwitchCheckDefault1 + +from SuperV import * + +# Graph creation of GraphSwitchCheckDefault1 +def DefGraphSwitchCheckDefault1() : + GraphSwitchCheckDefault1 = Graph( 'GraphSwitchCheckDefault1' ) + GraphSwitchCheckDefault1.SetName( 'GraphSwitchCheckDefault1' ) + GraphSwitchCheckDefault1.SetAuthor( 'JR' ) + GraphSwitchCheckDefault1.SetComment( '' ) + GraphSwitchCheckDefault1.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 = GraphSwitchCheckDefault1.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 = GraphSwitchCheckDefault1.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 = GraphSwitchCheckDefault1.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 = GraphSwitchCheckDefault1.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 = GraphSwitchCheckDefault1.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 = GraphSwitchCheckDefault1.INode( 'Default' , PyDefault ) + Default.SetName( 'Default' ) + Default.SetAuthor( '' ) + Default.SetComment( 'Compute Node' ) + Default.Coords( 421 , 592 ) + IDefaulta = Default.InPort( 'a' , 'long' ) + IDefaultBranch = Default.InPort( 'Branch' , 'string' ) + IDefaultGate = Default.GetInPort( 'Gate' ) + ODefaulta = Default.OutPort( 'a' , 'long' ) + ODefaultBranch = Default.OutPort( 'Branch' , 'string' ) + ODefaultGate = Default.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyInitLoopSwitch = [] + PyInitLoopSwitch.append( 'def InitLoop(Index,Min,Max) : ' ) + 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 = GraphSwitchCheckDefault1.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 = GraphSwitchCheckDefault1.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 = GraphSwitchCheckDefault1.Link( OIsOdda , IEmptyNodea ) + LIsOddaEmptyNodea.AddCoord( 1 , 646 , 78 ) + + LIsEvenaEndOfSwitcha = GraphSwitchCheckDefault1.Link( OIsEvena , IEndOfSwitcha ) + + LPrintOddBranchEmptyNodeBranch = GraphSwitchCheckDefault1.Link( OPrintOddBranch , IEmptyNodeBranch ) + + LPrintEvenBranchEndOfSwitchBranch = GraphSwitchCheckDefault1.Link( OPrintEvenBranch , IEndOfSwitchBranch ) + + LEmptyNodeaEndOfSwitcha = GraphSwitchCheckDefault1.Link( OEmptyNodea , IEndOfSwitcha ) + + LEmptyNodeBranchEndOfSwitchBranch = GraphSwitchCheckDefault1.Link( OEmptyNodeBranch , IEndOfSwitchBranch ) + + LDefaultaEndOfSwitcha = GraphSwitchCheckDefault1.Link( ODefaulta , IEndOfSwitcha ) + + LDefaultBranchEndOfSwitchBranch = GraphSwitchCheckDefault1.Link( ODefaultBranch , IEndOfSwitchBranch ) + + LInitLoopSwitchIndexSwitcha = GraphSwitchCheckDefault1.Link( OInitLoopSwitchIndex , ISwitcha ) + + LInitLoopSwitchMinEndOfInitLoopSwitchMin = GraphSwitchCheckDefault1.Link( OInitLoopSwitchMin , IEndOfInitLoopSwitchMin ) + + LInitLoopSwitchMaxEndOfInitLoopSwitchMax = GraphSwitchCheckDefault1.Link( OInitLoopSwitchMax , IEndOfInitLoopSwitchMax ) + + LSwitchOddIsOddGate = GraphSwitchCheckDefault1.Link( OSwitchOdd , IIsOddGate ) + LSwitchOddIsOddGate.AddCoord( 1 , 401 , 101 ) + LSwitchOddIsOddGate.AddCoord( 2 , 401 , 160 ) + + LSwitchOddPrintOddGate = GraphSwitchCheckDefault1.Link( OSwitchOdd , IPrintOddGate ) + LSwitchOddPrintOddGate.AddCoord( 1 , 401 , 245 ) + LSwitchOddPrintOddGate.AddCoord( 2 , 401 , 159 ) + + LSwitchEvenIsEvenGate = GraphSwitchCheckDefault1.Link( OSwitchEven , IIsEvenGate ) + LSwitchEvenIsEvenGate.AddCoord( 1 , 392 , 533 ) + LSwitchEvenIsEvenGate.AddCoord( 2 , 392 , 182 ) + + LSwitchEvenPrintEvenGate = GraphSwitchCheckDefault1.Link( OSwitchEven , IPrintEvenGate ) + LSwitchEvenPrintEvenGate.AddCoord( 1 , 392 , 403 ) + LSwitchEvenPrintEvenGate.AddCoord( 2 , 392 , 181 ) + + LSwitchaIsOdda = GraphSwitchCheckDefault1.Link( OSwitcha , IIsOdda ) + LSwitchaIsOdda.AddCoord( 1 , 382 , 78 ) + LSwitchaIsOdda.AddCoord( 2 , 382 , 199 ) + + LSwitchaIsEvena = GraphSwitchCheckDefault1.Link( OSwitcha , IIsEvena ) + LSwitchaIsEvena.AddCoord( 1 , 381 , 509 ) + LSwitchaIsEvena.AddCoord( 2 , 382 , 200 ) + + LSwitchaPrintOdda = GraphSwitchCheckDefault1.Link( OSwitcha , IPrintOdda ) + + LSwitchaPrintEvena = GraphSwitchCheckDefault1.Link( OSwitcha , IPrintEvena ) + LSwitchaPrintEvena.AddCoord( 1 , 381 , 361 ) + LSwitchaPrintEvena.AddCoord( 2 , 382 , 200 ) + + LSwitchaDefaulta = GraphSwitchCheckDefault1.Link( OSwitcha , IDefaulta ) + LSwitchaDefaulta.AddCoord( 1 , 382 , 663 ) + LSwitchaDefaulta.AddCoord( 2 , 382 , 199 ) + + LSwitchBranchPrintOddBranch = GraphSwitchCheckDefault1.Link( OSwitchBranch , IPrintOddBranch ) + + LSwitchBranchPrintEvenBranch = GraphSwitchCheckDefault1.Link( OSwitchBranch , IPrintEvenBranch ) + LSwitchBranchPrintEvenBranch.AddCoord( 1 , 369 , 381 ) + LSwitchBranchPrintEvenBranch.AddCoord( 2 , 369 , 219 ) + + LSwitchBranchDefaultBranch = GraphSwitchCheckDefault1.Link( OSwitchBranch , IDefaultBranch ) + LSwitchBranchDefaultBranch.AddCoord( 1 , 370 , 683 ) + LSwitchBranchDefaultBranch.AddCoord( 2 , 370 , 220 ) + + LSwitchdefaultDefaultGate = GraphSwitchCheckDefault1.Link( OSwitchdefault , IDefaultGate ) + LSwitchdefaultDefaultGate.AddCoord( 1 , 363 , 707 ) + LSwitchdefaultDefaultGate.AddCoord( 2 , 362 , 239 ) + + LEndOfSwitchaEndOfInitLoopSwitchIndex = GraphSwitchCheckDefault1.Link( OEndOfSwitcha , IEndOfInitLoopSwitchIndex ) + + # 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 GraphSwitchCheckDefault1 + + +GraphSwitchCheckDefault1 = DefGraphSwitchCheckDefault1() diff --git a/examples/GraphSwitchCheckDefault1.xml b/examples/GraphSwitchCheckDefault1.xml new file mode 100644 index 0000000..317bc92 --- /dev/null +++ b/examples/GraphSwitchCheckDefault1.xml @@ -0,0 +1,705 @@ + + + + + +? + ? + GraphSwitchCheckDefault1 + 1 + ? + +GraphSwitchCheckDefault + + +long + InitLoopSwitch__Index + +long + InitLoopSwitch__Min + +long + InitLoopSwitch__Max + + +long + EndOfInitLoopSwitch__Index + +long + EndOfInitLoopSwitch__Min + +long + EndOfInitLoopSwitch__Max + + + 13/1/2005 - 12:21:43 + 13/1/2005 - 12:28:19 + 2.0 + JR + ? + ? + 0 + 0 + + +? + ? + IsOdd + 3 + ? + +IsOdd + + +long + a + + +long + a + + + +IsOdd + + + + + + 13/1/2005 - 12:23:17 + 13/1/2005 - 12:23:17 + 2.0 + ? + ? + Python function + 415 + 7 + +? + ? + IsEven + 3 + ? + +IsEven + + +long + a + + +long + a + + + +IsEven + + + + + + 13/1/2005 - 12:23:17 + 13/1/2005 - 12:23:17 + 2.0 + ? + ? + Compute Node + 421 + 438 + +? + ? + PrintOdd + 3 + ? + +PrintOdd + + +long + a + +string + Branch + + +string + Branch + + + +Print + + + + + + 13/1/2005 - 12:23:17 + 13/1/2005 - 12:23:17 + 2.0 + ? + ? + Compute Node + 415 + 130 + +? + ? + PrintEven + 3 + ? + +PrintEven + + +long + a + +string + Branch + + +string + Branch + + + +Print_1 + + + + + + 13/1/2005 - 12:23:17 + 13/1/2005 - 12:23:17 + 2.0 + ? + ? + Compute Node + 423 + 289 + +? + ? + EmptyNode + 3 + ? + +EmptyNode + + +long + a + +string + Branch + + +long + a + +string + Branch + + + +EmptyNode + + + + + 13/1/2005 - 12:23:17 + 13/1/2005 - 12:23:17 + 2.0 + ? + ? + Compute Node + 652 + 110 + +? + ? + Default + 3 + ? + +Default + + +long + a + +string + Branch + + +long + a + +string + Branch + + + +Default + + + + + 13/1/2005 - 12:23:17 + 13/1/2005 - 12:23:17 + 2.0 + ? + ? + Compute Node + 421 + 592 + +? + ? + InitLoopSwitch + 4 + EndOfInitLoopSwitch + +InitLoopSwitch + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +InitLoop + + + + +MoreLoop + + + + = Min : ]]> + + + + + +NextLoop + + + + 13/1/2005 - 12:23:17 + 13/1/2005 - 12:23:17 + 2.0 + ? + ? + Compute Node + 10 + 129 + +? + ? + EndOfInitLoopSwitch + 5 + InitLoopSwitch + +EndOfInitLoopSwitch + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +EndOfInitLoopSwitch + + + + + 13/1/2005 - 12:23:17 + 13/1/2005 - 12:23:17 + 2.0 + ? + ? + Compute Node + 1074 + 194 + +? + ? + Switch + 6 + EndOfSwitch + +Switch + + +long + a + + +long + Odd + +int + Even + +int + a + +string + Branch + +boolean + default + + + +Switch + + + + + + + + + + + + 13/1/2005 - 12:23:17 + 13/1/2005 - 12:23:17 + 2.0 + ? + ? + Compute Node + 190 + 129 + +? + ? + EndOfSwitch + 7 + Switch + +EndOfSwitch + + +long + a + +string + Branch + + +long + a + + + +EndOfSwitch + + + + + 13/1/2005 - 12:23:17 + 13/1/2005 - 12:23:17 + 2.0 + ? + ? + Compute Node + 882 + 194 + + +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 + EndOfSwitch + a + + +Default + 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 + 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 + + + +GraphSwitchCheckDefault1 + InitLoopSwitch__Index + InitLoopSwitch + Index + +3 + 0 + + +GraphSwitchCheckDefault1 + InitLoopSwitch__Min + InitLoopSwitch + Min + +3 + -5 + + +GraphSwitchCheckDefault1 + InitLoopSwitch__Max + InitLoopSwitch + Max + +3 + 10 + diff --git a/examples/GraphSwitchCheckDefault2.py b/examples/GraphSwitchCheckDefault2.py new file mode 100644 index 0000000..e26b64a --- /dev/null +++ b/examples/GraphSwitchCheckDefault2.py @@ -0,0 +1,334 @@ + +# Generated python file of Graph GraphSwitchCheckDefault1 + +from SuperV import * + +# Graph creation of GraphSwitchCheckDefault1 +def DefGraphSwitchCheckDefault1() : + GraphSwitchCheckDefault1 = Graph( 'GraphSwitchCheckDefault1' ) + GraphSwitchCheckDefault1.SetName( 'GraphSwitchCheckDefault1' ) + GraphSwitchCheckDefault1.SetAuthor( 'JR' ) + GraphSwitchCheckDefault1.SetComment( '' ) + GraphSwitchCheckDefault1.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 = GraphSwitchCheckDefault1.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 = GraphSwitchCheckDefault1.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 = GraphSwitchCheckDefault1.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 = GraphSwitchCheckDefault1.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 = GraphSwitchCheckDefault1.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 = GraphSwitchCheckDefault1.INode( 'Default' , PyDefault ) + Default.SetName( 'Default' ) + Default.SetAuthor( '' ) + Default.SetComment( 'Compute Node' ) + Default.Coords( 421 , 592 ) + IDefaulta = Default.InPort( 'a' , 'long' ) + IDefaultBranch = Default.InPort( 'Branch' , 'string' ) + IDefaultGate = Default.GetInPort( 'Gate' ) + ODefaulta = Default.OutPort( 'a' , 'long' ) + ODefaultBranch = Default.OutPort( 'Branch' , 'string' ) + ODefaultGate = Default.GetOutPort( 'Gate' ) + + PyPuta = [] + PyPuta.append( 'from time import * ' ) + PyPuta.append( 'def Puta(a) : ' ) + PyPuta.append( ' sleep(1) ' ) + PyPuta.append( ' return a ' ) + Puta = GraphSwitchCheckDefault1.INode( 'Puta' , PyPuta ) + Puta.SetName( 'Puta' ) + Puta.SetAuthor( '' ) + Puta.SetComment( 'Compute Node' ) + Puta.Coords( 658 , 472 ) + 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 = GraphSwitchCheckDefault1.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 = GraphSwitchCheckDefault1.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 = GraphSwitchCheckDefault1.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 = GraphSwitchCheckDefault1.Link( OIsOdda , IEmptyNodea ) + LIsOddaEmptyNodea.AddCoord( 1 , 646 , 78 ) + + LPrintOddBranchEmptyNodeBranch = GraphSwitchCheckDefault1.Link( OPrintOddBranch , IEmptyNodeBranch ) + + LEmptyNodeaEndOfSwitcha = GraphSwitchCheckDefault1.Link( OEmptyNodea , IEndOfSwitcha ) + + LEmptyNodeBranchEndOfSwitchBranch = GraphSwitchCheckDefault1.Link( OEmptyNodeBranch , IEndOfSwitchBranch ) + + LDefaultaEndOfSwitcha = GraphSwitchCheckDefault1.Link( ODefaulta , IEndOfSwitcha ) + + LDefaultaPutaa = GraphSwitchCheckDefault1.Link( ODefaulta , IPutaa ) + + LDefaultBranchEndOfSwitchBranch = GraphSwitchCheckDefault1.Link( ODefaultBranch , IEndOfSwitchBranch ) + + LDefaultBranchPutBranchBranch = GraphSwitchCheckDefault1.Link( ODefaultBranch , IPutBranchBranch ) + + LInitLoopSwitchIndexSwitcha = GraphSwitchCheckDefault1.Link( OInitLoopSwitchIndex , ISwitcha ) + + LInitLoopSwitchMinEndOfInitLoopSwitchMin = GraphSwitchCheckDefault1.Link( OInitLoopSwitchMin , IEndOfInitLoopSwitchMin ) + + LInitLoopSwitchMaxEndOfInitLoopSwitchMax = GraphSwitchCheckDefault1.Link( OInitLoopSwitchMax , IEndOfInitLoopSwitchMax ) + + LSwitchOddIsOddGate = GraphSwitchCheckDefault1.Link( OSwitchOdd , IIsOddGate ) + LSwitchOddIsOddGate.AddCoord( 1 , 401 , 101 ) + LSwitchOddIsOddGate.AddCoord( 2 , 401 , 160 ) + + LSwitchOddPrintOddGate = GraphSwitchCheckDefault1.Link( OSwitchOdd , IPrintOddGate ) + LSwitchOddPrintOddGate.AddCoord( 1 , 401 , 245 ) + LSwitchOddPrintOddGate.AddCoord( 2 , 401 , 159 ) + + LSwitchEvenIsEvenGate = GraphSwitchCheckDefault1.Link( OSwitchEven , IIsEvenGate ) + LSwitchEvenIsEvenGate.AddCoord( 1 , 392 , 533 ) + LSwitchEvenIsEvenGate.AddCoord( 2 , 392 , 182 ) + + LSwitchEvenPrintEvenGate = GraphSwitchCheckDefault1.Link( OSwitchEven , IPrintEvenGate ) + LSwitchEvenPrintEvenGate.AddCoord( 1 , 392 , 403 ) + LSwitchEvenPrintEvenGate.AddCoord( 2 , 392 , 181 ) + + LSwitchaIsOdda = GraphSwitchCheckDefault1.Link( OSwitcha , IIsOdda ) + LSwitchaIsOdda.AddCoord( 1 , 382 , 78 ) + LSwitchaIsOdda.AddCoord( 2 , 382 , 199 ) + + LSwitchaIsEvena = GraphSwitchCheckDefault1.Link( OSwitcha , IIsEvena ) + LSwitchaIsEvena.AddCoord( 1 , 381 , 509 ) + LSwitchaIsEvena.AddCoord( 2 , 382 , 200 ) + + LSwitchaPrintOdda = GraphSwitchCheckDefault1.Link( OSwitcha , IPrintOdda ) + + LSwitchaPrintEvena = GraphSwitchCheckDefault1.Link( OSwitcha , IPrintEvena ) + LSwitchaPrintEvena.AddCoord( 1 , 381 , 361 ) + LSwitchaPrintEvena.AddCoord( 2 , 382 , 200 ) + + LSwitchaDefaulta = GraphSwitchCheckDefault1.Link( OSwitcha , IDefaulta ) + LSwitchaDefaulta.AddCoord( 1 , 382 , 663 ) + LSwitchaDefaulta.AddCoord( 2 , 382 , 199 ) + + LSwitchBranchPrintOddBranch = GraphSwitchCheckDefault1.Link( OSwitchBranch , IPrintOddBranch ) + + LSwitchBranchPrintEvenBranch = GraphSwitchCheckDefault1.Link( OSwitchBranch , IPrintEvenBranch ) + LSwitchBranchPrintEvenBranch.AddCoord( 1 , 369 , 381 ) + LSwitchBranchPrintEvenBranch.AddCoord( 2 , 369 , 219 ) + + LSwitchBranchDefaultBranch = GraphSwitchCheckDefault1.Link( OSwitchBranch , IDefaultBranch ) + LSwitchBranchDefaultBranch.AddCoord( 1 , 370 , 683 ) + LSwitchBranchDefaultBranch.AddCoord( 2 , 370 , 220 ) + + LSwitchdefaultDefaultGate = GraphSwitchCheckDefault1.Link( OSwitchdefault , IDefaultGate ) + LSwitchdefaultDefaultGate.AddCoord( 1 , 363 , 707 ) + LSwitchdefaultDefaultGate.AddCoord( 2 , 362 , 239 ) + + LEndOfSwitchaEndOfInitLoopSwitchIndex = GraphSwitchCheckDefault1.Link( OEndOfSwitcha , IEndOfInitLoopSwitchIndex ) + + LPutaaEndOfSwitcha = GraphSwitchCheckDefault1.Link( OPutaa , IEndOfSwitcha ) + + LPutBranchBranchEndOfSwitchBranch = GraphSwitchCheckDefault1.Link( OPutBranchBranch , IEndOfSwitchBranch ) + + # Input datas + IInitLoopSwitchIndex.Input( 0 ) + IInitLoopSwitchMin.Input( -5 ) + IInitLoopSwitchMax.Input( 10 ) + + # Output Ports of the graph + #OIsEvena = IsEven.GetOutPort( 'a' ) + #OPrintEvenBranch = PrintEven.GetOutPort( 'Branch' ) + #OEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetOutPort( 'Index' ) + #OEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetOutPort( 'Min' ) + #OEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetOutPort( 'Max' ) + return GraphSwitchCheckDefault1 + + +GraphSwitchCheckDefault1 = DefGraphSwitchCheckDefault1() diff --git a/examples/GraphSwitchCheckDefault2.xml b/examples/GraphSwitchCheckDefault2.xml new file mode 100644 index 0000000..3022d34 --- /dev/null +++ b/examples/GraphSwitchCheckDefault2.xml @@ -0,0 +1,787 @@ + + + + + +? + ? + GraphSwitchCheckDefault1 + 1 + ? + +GraphSwitchCheckDefault1 + + +long + InitLoopSwitch__Index + +long + InitLoopSwitch__Min + +long + InitLoopSwitch__Max + + +long + IsEven__a + +string + PrintEven__Branch + +long + EndOfInitLoopSwitch__Index + +long + EndOfInitLoopSwitch__Min + +long + EndOfInitLoopSwitch__Max + + + 13/1/2005 - 12:21:43 + 13/1/2005 - 12:33:25 + 2.0 + JR + ? + ? + 0 + 0 + + +? + ? + IsOdd + 3 + ? + +IsOdd + + +long + a + + +long + a + + + +IsOdd + + + + + + 13/1/2005 - 12:23:17 + 13/1/2005 - 12:23:17 + 2.0 + ? + ? + Python function + 415 + 7 + +? + ? + IsEven + 3 + ? + +IsEven + + +long + a + + +long + a + + + +IsEven + + + + + + 13/1/2005 - 12:23:17 + 13/1/2005 - 12:23:17 + 2.0 + ? + ? + Compute Node + 421 + 438 + +? + ? + PrintOdd + 3 + ? + +PrintOdd + + +long + a + +string + Branch + + +string + Branch + + + +Print + + + + + + 13/1/2005 - 12:23:17 + 13/1/2005 - 12:23:17 + 2.0 + ? + ? + Compute Node + 415 + 130 + +? + ? + PrintEven + 3 + ? + +PrintEven + + +long + a + +string + Branch + + +string + Branch + + + +Print_1 + + + + + + 13/1/2005 - 12:23:17 + 13/1/2005 - 12:23:17 + 2.0 + ? + ? + Compute Node + 423 + 289 + +? + ? + EmptyNode + 3 + ? + +EmptyNode + + +long + a + +string + Branch + + +long + a + +string + Branch + + + +EmptyNode + + + + + 13/1/2005 - 12:23:17 + 13/1/2005 - 12:23:17 + 2.0 + ? + ? + Compute Node + 652 + 110 + +? + ? + Default + 3 + ? + +Default + + +long + a + +string + Branch + + +long + a + +string + Branch + + + +Default + + + + + 13/1/2005 - 12:23:17 + 13/1/2005 - 12:23:17 + 2.0 + ? + ? + Compute Node + 421 + 592 + +? + ? + InitLoopSwitch + 4 + EndOfInitLoopSwitch + +InitLoopSwitch + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +InitLoop + + + + +MoreLoop + + + + = Min : ]]> + + + + + +NextLoop + + + + 13/1/2005 - 12:23:17 + 13/1/2005 - 12:23:17 + 2.0 + ? + ? + Compute Node + 10 + 129 + +? + ? + EndOfInitLoopSwitch + 5 + InitLoopSwitch + +EndOfInitLoopSwitch + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +EndOfInitLoopSwitch + + + + + 13/1/2005 - 12:23:17 + 13/1/2005 - 12:23:17 + 2.0 + ? + ? + Compute Node + 1074 + 194 + +? + ? + Switch + 6 + EndOfSwitch + +Switch + + +long + a + + +long + Odd + +int + Even + +int + a + +string + Branch + +boolean + default + + + +Switch + + + + + + + + + + + + 13/1/2005 - 12:23:17 + 13/1/2005 - 12:23:17 + 2.0 + ? + ? + Compute Node + 190 + 129 + +? + ? + EndOfSwitch + 7 + Switch + +EndOfSwitch + + +long + a + +string + Branch + + +long + a + + + +EndOfSwitch + + + + + 13/1/2005 - 12:23:17 + 13/1/2005 - 12:23:17 + 2.0 + ? + ? + Compute Node + 882 + 194 + +? + ? + Puta + 3 + ? + +Puta + + +long + a + + +long + a + + + +Puta + + + + + 13/1/2005 - 12:31:48 + 13/1/2005 - 12:31:48 + 2.0 + ? + ? + Compute Node + 658 + 472 + +? + ? + PutBranch + 3 + ? + +PutBranch + + +string + Branch + + +string + Branch + + + +PutBranch + + + + + 13/1/2005 - 12:32:11 + 13/1/2005 - 12:32:11 + 2.0 + ? + ? + Compute Node + 662 + 613 + + +IsOdd + a + EmptyNode + a + + +646 + 78 + +PrintOdd + Branch + EmptyNode + Branch + + +EmptyNode + a + EndOfSwitch + a + + +EmptyNode + Branch + EndOfSwitch + Branch + + +Default + a + EndOfSwitch + a + + +Default + a + Puta + a + + +Default + Branch + EndOfSwitch + Branch + + +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 + + + +GraphSwitchCheckDefault1 + InitLoopSwitch__Index + InitLoopSwitch + Index + +3 + 0 + + +GraphSwitchCheckDefault1 + InitLoopSwitch__Min + InitLoopSwitch + Min + +3 + -5 + + +GraphSwitchCheckDefault1 + InitLoopSwitch__Max + InitLoopSwitch + Max + +3 + 10 + diff --git a/examples/GraphSwitchOutput.py b/examples/GraphSwitchOutput.py new file mode 100644 index 0000000..2c9c777 --- /dev/null +++ b/examples/GraphSwitchOutput.py @@ -0,0 +1,211 @@ + +# Generated python file of Graph GraphSwitch_1_1 + +from SuperV import * + +# Graph creation of GraphSwitch_1_1 +def DefGraphSwitch_1_1() : + GraphSwitch_1_1 = Graph( 'GraphSwitch_1_1' ) + GraphSwitch_1_1.SetName( 'GraphSwitch_1_1' ) + GraphSwitch_1_1.SetAuthor( '' ) + GraphSwitch_1_1.SetComment( '' ) + GraphSwitch_1_1.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyIsOdd = [] + PyIsOdd.append( 'from time import * ' ) + PyIsOdd.append( 'def IsOdd(a) : ' ) + PyIsOdd.append( ' print a,"IsOdd (GraphSwitch)" ' ) + PyIsOdd.append( ' sleep( 1 ) ' ) + PyIsOdd.append( ' return a ' ) + IsOdd = GraphSwitch_1_1.INode( 'IsOdd' , PyIsOdd ) + 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 (GraphSwitch)" ' ) + PyIsEven.append( ' sleep( 1 ) ' ) + PyIsEven.append( ' return a ' ) + IsEven = GraphSwitch_1_1.INode( 'IsEven' , PyIsEven ) + IsEven.SetName( 'IsEven' ) + IsEven.SetAuthor( '' ) + IsEven.SetComment( 'Compute Node' ) + IsEven.Coords( 395 , 334 ) + IIsEvena = IsEven.InPort( 'a' , 'long' ) + IIsEvenGate = IsEven.GetInPort( 'Gate' ) + OIsEvena = IsEven.OutPort( 'a' , 'long' ) + OIsEvenGate = IsEven.GetOutPort( 'Gate' ) + + PyPrint = [] + PyPrint.append( 'def Print(a,Branch) : ' ) + PyPrint.append( ' print "Print ",Branch ' ) + PyPrint.append( ' return a,Branch ' ) + Print = GraphSwitch_1_1.INode( 'Print' , PyPrint ) + Print.SetName( 'Print' ) + Print.SetAuthor( '' ) + Print.SetComment( 'Compute Node' ) + Print.Coords( 639 , 63 ) + IPrinta = Print.InPort( 'a' , 'long' ) + IPrintBranch = Print.InPort( 'Branch' , 'string' ) + IPrintGate = Print.GetInPort( 'Gate' ) + OPrinta = Print.OutPort( 'a' , 'long' ) + OPrintBranch = Print.OutPort( 'Branch' , 'string' ) + OPrintGate = Print.GetOutPort( 'Gate' ) + + PyPrint_1 = [] + PyPrint_1.append( 'def Print_1(a,Branch) : ' ) + PyPrint_1.append( ' print "Print ",Branch ' ) + PyPrint_1.append( ' return a,Branch ' ) + Print_1 = GraphSwitch_1_1.INode( 'Print_1' , PyPrint_1 ) + Print_1.SetName( 'Print_1' ) + Print_1.SetAuthor( '' ) + Print_1.SetComment( 'Compute Node' ) + Print_1.Coords( 639 , 263 ) + IPrint_1a = Print_1.InPort( 'a' , 'long' ) + IPrint_1Branch = Print_1.InPort( 'Branch' , 'string' ) + IPrint_1Gate = Print_1.GetInPort( 'Gate' ) + OPrint_1a = Print_1.OutPort( 'a' , 'long' ) + OPrint_1Branch = Print_1.OutPort( 'Branch' , 'string' ) + OPrint_1Gate = Print_1.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( 'def MoreLoop(Index,Min,Max) : ' ) + 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 = GraphSwitch_1_1.LNode( 'InitLoop' , PyInitLoopSwitch , 'MoreLoop' , PyMoreInitLoopSwitch , 'NextLoop' , PyNextInitLoopSwitch ) + EndOfInitLoopSwitch.SetName( 'EndOfInitLoopSwitch' ) + EndOfInitLoopSwitch.SetAuthor( '' ) + EndOfInitLoopSwitch.SetComment( 'Compute Node' ) + EndOfInitLoopSwitch.Coords( 1082 , 150 ) + PyEndOfInitLoopSwitch = [] + EndOfInitLoopSwitch.SetPyFunction( '' , PyEndOfInitLoopSwitch ) + IInitLoopSwitchDoLoop = InitLoopSwitch.GetInPort( 'DoLoop' ) + IInitLoopSwitchIndex = InitLoopSwitch.InPort( 'Index' , 'long' ) + IInitLoopSwitchMin = InitLoopSwitch.InPort( 'Min' , 'long' ) + IInitLoopSwitchMax = InitLoopSwitch.InPort( 'Max' , 'long' ) + IInitLoopSwitchGate = InitLoopSwitch.GetInPort( 'Gate' ) + OInitLoopSwitchDoLoop = InitLoopSwitch.GetOutPort( 'DoLoop' ) + OInitLoopSwitchIndex = InitLoopSwitch.GetOutPort( 'Index' ) + OInitLoopSwitchMin = InitLoopSwitch.GetOutPort( 'Min' ) + OInitLoopSwitchMax = InitLoopSwitch.GetOutPort( 'Max' ) + IEndOfInitLoopSwitchDoLoop = EndOfInitLoopSwitch.GetInPort( 'DoLoop' ) + IEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetInPort( 'Index' ) + IEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetInPort( 'Min' ) + IEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetInPort( 'Max' ) + IEndOfInitLoopSwitchGate = EndOfInitLoopSwitch.GetInPort( 'Gate' ) + OEndOfInitLoopSwitchDoLoop = EndOfInitLoopSwitch.GetOutPort( 'DoLoop' ) + OEndOfInitLoopSwitchIndex = EndOfInitLoopSwitch.GetOutPort( 'Index' ) + OEndOfInitLoopSwitchMin = EndOfInitLoopSwitch.GetOutPort( 'Min' ) + OEndOfInitLoopSwitchMax = EndOfInitLoopSwitch.GetOutPort( 'Max' ) + OEndOfInitLoopSwitchGate = EndOfInitLoopSwitch.GetOutPort( 'Gate' ) + InitLoopSwitch.SetName( 'InitLoopSwitch' ) + InitLoopSwitch.SetAuthor( '' ) + InitLoopSwitch.SetComment( 'Compute Node' ) + InitLoopSwitch.Coords( 10 , 129 ) + + # Creation of Switch Nodes + PySwitch = [] + PySwitch.append( 'from time import * ' ) + PySwitch.append( 'def Switch(a) : ' ) + PySwitch.append( ' 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( ' sleep(1) ' ) + PySwitch.append( ' return a & 1,1-(a&1),a,Branch,0 ' ) + Switch,EndOfSwitch = GraphSwitch_1_1.SNode( 'Switch' , PySwitch ) + EndOfSwitch.SetName( 'EndOfSwitch' ) + EndOfSwitch.SetAuthor( '' ) + EndOfSwitch.SetComment( 'Compute Node' ) + EndOfSwitch.Coords( 880 , 150 ) + 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( 195 , 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 + LIsOddaPrinta = GraphSwitch_1_1.Link( OIsOdda , IPrinta ) + + LInitLoopSwitchIndexSwitcha = GraphSwitch_1_1.Link( OInitLoopSwitchIndex , ISwitcha ) + + LInitLoopSwitchMinEndOfInitLoopSwitchMin = GraphSwitch_1_1.Link( OInitLoopSwitchMin , IEndOfInitLoopSwitchMin ) + + LInitLoopSwitchMaxEndOfInitLoopSwitchMax = GraphSwitch_1_1.Link( OInitLoopSwitchMax , IEndOfInitLoopSwitchMax ) + + LIsEvenaPrint_1a = GraphSwitch_1_1.Link( OIsEvena , IPrint_1a ) + + LSwitchOddIsOddGate = GraphSwitch_1_1.Link( OSwitchOdd , IIsOddGate ) + + LSwitchEvenIsEvenGate = GraphSwitch_1_1.Link( OSwitchEven , IIsEvenGate ) + + LSwitchaIsOdda = GraphSwitch_1_1.Link( OSwitcha , IIsOdda ) + + LSwitchaIsEvena = GraphSwitch_1_1.Link( OSwitcha , IIsEvena ) + + LSwitchBranchPrintBranch = GraphSwitch_1_1.Link( OSwitchBranch , IPrintBranch ) + + LSwitchBranchPrint_1Branch = GraphSwitch_1_1.Link( OSwitchBranch , IPrint_1Branch ) + + LSwitchDefaultEndOfSwitchDefault = GraphSwitch_1_1.Link( OSwitchDefault , IEndOfSwitchDefault ) + + LEndOfSwitchaEndOfInitLoopSwitchIndex = GraphSwitch_1_1.Link( OEndOfSwitcha , IEndOfInitLoopSwitchIndex ) + + LPrintaEndOfSwitcha = GraphSwitch_1_1.Link( OPrinta , IEndOfSwitcha ) + + LPrint_1aEndOfSwitcha = GraphSwitch_1_1.Link( OPrint_1a , 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' ) + #OSwitchdefault = Switch.GetOutPort( 'default' ) + #OPrintBranch = Print.GetOutPort( 'Branch' ) + #OPrint_1Branch = Print_1.GetOutPort( 'Branch' ) + return GraphSwitch_1_1 + + +GraphSwitch_1_1 = DefGraphSwitch_1_1() diff --git a/examples/GraphSwitchOutput.xml b/examples/GraphSwitchOutput.xml new file mode 100644 index 0000000..86d6720 --- /dev/null +++ b/examples/GraphSwitchOutput.xml @@ -0,0 +1,500 @@ + + + + + +? + ? + GraphSwitch_1_1 + 1 + ? + +GraphSwitch_1_1 + + +long + InitLoopSwitch__Index + +long + InitLoopSwitch__Min + +long + InitLoopSwitch__Max + + +long + EndOfInitLoopSwitch__Index + +long + EndOfInitLoopSwitch__Min + +long + EndOfInitLoopSwitch__Max + +boolean + Switch__default + +string + Print__Branch + +string + Print_1__Branch + + + 1/10/2003 - 17:23:54 + 13/1/2005 - 11:21:30 + 1.05 + ? + ? + ? + 0 + 0 + + +? + ? + IsOdd + 3 + ? + +IsOdd + + +long + a + + +long + a + + + +IsOdd + + + + + + 13/1/2005 - 11:17:18 + 13/1/2005 - 11:17:18 + 1.05 + ? + ? + Python function + 388 + 50 + +? + ? + InitLoopSwitch + 4 + EndOfInitLoopSwitch + +InitLoopSwitch + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +InitLoop + + + + +MoreLoop + + = Min : ]]> + + + + + +NextLoop + + + + 13/1/2005 - 11:17:18 + 13/1/2005 - 11:17:18 + 1.05 + ? + ? + Compute Node + 10 + 129 + +? + ? + EndOfInitLoopSwitch + 5 + InitLoopSwitch + +EndOfInitLoopSwitch + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +? + + 13/1/2005 - 11:17:18 + 13/1/2005 - 11:17:18 + 1.05 + ? + ? + Compute Node + 1082 + 150 + +? + ? + IsEven + 3 + ? + +IsEven + + +long + a + + +long + a + + + +IsEven + + + + + + 13/1/2005 - 11:17:18 + 13/1/2005 - 11:17:18 + 2.0 + ? + ? + Compute Node + 395 + 334 + +? + ? + Switch + 6 + EndOfSwitch + +Switch + + +long + a + + +long + Odd + +int + Even + +int + a + +string + Branch + +boolean + default + + + +Switch + + + + + + + + + + + + 13/1/2005 - 11:17:18 + 13/1/2005 - 11:17:18 + 2.0 + ? + ? + Compute Node + 195 + 129 + +? + ? + EndOfSwitch + 7 + Switch + +EndOfSwitch + + +long + a + + +long + a + + + +EndSwitch_1 + + 13/1/2005 - 11:17:18 + 13/1/2005 - 11:17:18 + 2.0 + ? + ? + Compute Node + 880 + 150 + +? + ? + Print + 3 + ? + +Void + + +long + a + +string + Branch + + +long + a + +string + Branch + + + +Print + + + + 13/1/2005 - 11:17:18 + 13/1/2005 - 11:17:18 + 2.0 + ? + ? + Compute Node + 639 + 63 + +? + ? + Print_1 + 3 + ? + +Print_1 + + +long + a + +string + Branch + + +long + a + +string + Branch + + + +Print_1 + + + + 13/1/2005 - 11:20:58 + 13/1/2005 - 11:20:58 + 2.0 + ? + ? + Compute Node + 639 + 263 + + +IsOdd + a + Print + a + + +InitLoopSwitch + DoLoop + EndOfInitLoopSwitch + DoLoop + + +InitLoopSwitch + Index + Switch + a + + +InitLoopSwitch + Min + EndOfInitLoopSwitch + Min + + +InitLoopSwitch + Max + EndOfInitLoopSwitch + Max + + +EndOfInitLoopSwitch + DoLoop + InitLoopSwitch + DoLoop + + +IsEven + a + Print_1 + a + + +Switch + Odd + IsOdd + Gate + + +Switch + Even + IsEven + Gate + + +Switch + a + IsOdd + a + + +Switch + a + IsEven + a + + +Switch + Branch + Print + Branch + + +Switch + Branch + Print_1 + Branch + + +Switch + Default + EndOfSwitch + Default + + +EndOfSwitch + a + EndOfInitLoopSwitch + Index + + +Print + a + EndOfSwitch + a + + +Print_1 + a + EndOfSwitch + a + + + +GraphSwitch_1_1 + InitLoopSwitch__Index + InitLoopSwitch + Index + +3 + 0 + + +GraphSwitch_1_1 + InitLoopSwitch__Min + InitLoopSwitch + Min + +3 + -5 + + +GraphSwitch_1_1 + InitLoopSwitch__Max + InitLoopSwitch + Max + +3 + 10 + -- 2.39.2