From 40a75c9eb9d2ad826e229f592a977df5ec8e73ae Mon Sep 17 00:00:00 2001 From: rahuel Date: Thu, 26 May 2005 13:07:33 +0000 Subject: [PATCH] Used for debug of PAL8919 : The OutPorts of LoopNodes and the InPorts of the EndLoopNodes may not be in the Service created in the Graph If we delete NodeIncr, that Graph must continue to be executable. --- examples/GraphLoop1.py | 122 ++++++++++++++++ examples/GraphLoop1.xml | 307 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 429 insertions(+) create mode 100644 examples/GraphLoop1.py create mode 100644 examples/GraphLoop1.xml diff --git a/examples/GraphLoop1.py b/examples/GraphLoop1.py new file mode 100644 index 0000000..91b1d72 --- /dev/null +++ b/examples/GraphLoop1.py @@ -0,0 +1,122 @@ + +# Generated python file of Graph GraphLoop_2 + +from SuperV import * + +# Graph creation of GraphLoop_2 +def DefGraphLoop_2() : + GraphLoop_2 = Graph( 'GraphLoop_2' ) + GraphLoop_2.SetName( 'GraphLoop_2' ) + GraphLoop_2.SetAuthor( '' ) + GraphLoop_2.SetComment( '' ) + GraphLoop_2.Coords( 0 , 0 ) + + # Creation of Factory Nodes + + # Creation of InLine Nodes + PyNodeIndex = [] + NodeIndex = GraphLoop_2.INode( '' , PyNodeIndex ) + NodeIndex.SetName( 'NodeIndex' ) + NodeIndex.SetAuthor( '' ) + NodeIndex.SetComment( 'Compute Node' ) + NodeIndex.Coords( 281 , 215 ) + INodeIndexIndex = NodeIndex.InPort( 'Index' , 'long' ) + INodeIndexGate = NodeIndex.GetInPort( 'Gate' ) + ONodeIndexIndex = NodeIndex.OutPort( 'Index' , 'long' ) + ONodeIndexGate = NodeIndex.GetOutPort( 'Gate' ) + + PyNodeIncr = [] + NodeIncr = GraphLoop_2.INode( '' , PyNodeIncr ) + NodeIncr.SetName( 'NodeIncr' ) + NodeIncr.SetAuthor( '' ) + NodeIncr.SetComment( 'Compute Node' ) + NodeIncr.Coords( 278 , 372 ) + INodeIncrIncr = NodeIncr.InPort( 'Incr' , 'long' ) + INodeIncrGate = NodeIncr.GetInPort( 'Gate' ) + ONodeIncrIncr = NodeIncr.OutPort( 'Incr' , 'long' ) + ONodeIncrGate = NodeIncr.GetOutPort( 'Gate' ) + + # Creation of Loop Nodes + PyInit = [] + PyInit.append( 'def Init(Index,Min,Max,Incr) : ' ) + PyInit.append( ' if Min <= Max : ' ) + PyInit.append( ' Index = Min ' ) + PyInit.append( ' else : ' ) + PyInit.append( ' Index = Max ' ) + PyInit.append( ' return Index,Min,Max,Incr ' ) + PyMoreInit = [] + PyMoreInit.append( 'import time ' ) + PyMoreInit.append( 'def More(Index,Min,Max,Incr) : ' ) + PyMoreInit.append( ' time.sleep(2) ' ) + PyMoreInit.append( ' if Index < Max : ' ) + PyMoreInit.append( ' DoLoop = 1 ' ) + PyMoreInit.append( ' else : ' ) + PyMoreInit.append( ' DoLoop = 0 ' ) + PyMoreInit.append( ' return DoLoop,Index,Min,Max,Incr ' ) + PyNextInit = [] + PyNextInit.append( 'def Next(Index,Min,Max,Incr) : ' ) + PyNextInit.append( ' Index = Index + Incr ' ) + PyNextInit.append( ' return Index,Min,Max,Incr ' ) + Init,EndInit = GraphLoop_2.LNode( 'Init' , PyInit , 'More' , PyMoreInit , 'Next' , PyNextInit ) + EndInit.SetName( 'EndInit' ) + EndInit.SetAuthor( '' ) + EndInit.SetComment( 'Compute Node' ) + EndInit.Coords( 555 , 255 ) + PyEndInit = [] + EndInit.SetPyFunction( '' , PyEndInit ) + IInitDoLoop = Init.GetInPort( 'DoLoop' ) + IInitIndex = Init.InPort( 'Index' , 'long' ) + IInitMin = Init.InPort( 'Min' , 'long' ) + IInitMax = Init.InPort( 'Max' , 'long' ) + IInitIncr = Init.InPort( 'Incr' , 'long' ) + IInitGate = Init.GetInPort( 'Gate' ) + OInitDoLoop = Init.GetOutPort( 'DoLoop' ) + OInitIndex = Init.GetOutPort( 'Index' ) + OInitMin = Init.GetOutPort( 'Min' ) + OInitMax = Init.GetOutPort( 'Max' ) + OInitIncr = Init.GetOutPort( 'Incr' ) + IEndInitDoLoop = EndInit.GetInPort( 'DoLoop' ) + IEndInitIndex = EndInit.GetInPort( 'Index' ) + IEndInitMin = EndInit.GetInPort( 'Min' ) + IEndInitMax = EndInit.GetInPort( 'Max' ) + IEndInitIncr = EndInit.GetInPort( 'Incr' ) + IEndInitGate = EndInit.GetInPort( 'Gate' ) + OEndInitDoLoop = EndInit.GetOutPort( 'DoLoop' ) + OEndInitIndex = EndInit.GetOutPort( 'Index' ) + OEndInitMin = EndInit.GetOutPort( 'Min' ) + OEndInitMax = EndInit.GetOutPort( 'Max' ) + OEndInitIncr = EndInit.GetOutPort( 'Incr' ) + OEndInitGate = EndInit.GetOutPort( 'Gate' ) + Init.SetName( 'Init' ) + Init.SetAuthor( '' ) + Init.SetComment( 'Compute Node' ) + Init.Coords( 17 , 257 ) + + # Creation of Links + LInitIndexNodeIndexIndex = GraphLoop_2.Link( OInitIndex , INodeIndexIndex ) + + LInitMinEndInitMin = GraphLoop_2.Link( OInitMin , IEndInitMin ) + + LInitMaxEndInitMax = GraphLoop_2.Link( OInitMax , IEndInitMax ) + + LInitIncrNodeIncrIncr = GraphLoop_2.Link( OInitIncr , INodeIncrIncr ) + + LNodeIndexIndexEndInitIndex = GraphLoop_2.Link( ONodeIndexIndex , IEndInitIndex ) + + LNodeIncrIncrEndInitIncr = GraphLoop_2.Link( ONodeIncrIncr , IEndInitIncr ) + + # Input datas + IInitIndex.Input( 0 ) + IInitMin.Input( 5 ) + IInitMax.Input( 10 ) + IInitIncr.Input( 1 ) + + # Output Ports of the graph + #OEndInitIndex = EndInit.GetOutPort( 'Index' ) + #OEndInitMin = EndInit.GetOutPort( 'Min' ) + #OEndInitMax = EndInit.GetOutPort( 'Max' ) + #OEndInitIncr = EndInit.GetOutPort( 'Incr' ) + return GraphLoop_2 + + +GraphLoop_2 = DefGraphLoop_2() diff --git a/examples/GraphLoop1.xml b/examples/GraphLoop1.xml new file mode 100644 index 0000000..19a8a72 --- /dev/null +++ b/examples/GraphLoop1.xml @@ -0,0 +1,307 @@ + + + + + +? + ? + GraphLoop_2 + 1 + ? + +GraphLoop_2 + + +long + Init__Index + +long + Init__Min + +long + Init__Max + +long + Init__Incr + + +long + EndInit__Index + +long + EndInit__Min + +long + EndInit__Max + +long + EndInit__Incr + + + 24/3/2003 - 14:44:35 + 26/5/2005 - 10:10:48 + 1.04 + ? + ? + ? + 0 + 0 + + +? + ? + Init + 4 + EndInit + +Init + + +long + Index + +long + Min + +long + Max + +long + Incr + + +long + Index + +long + Min + +long + Max + +long + Incr + + + +Init + + + + + + + +More + + + + + + + + + +Next + + + + 26/5/2005 - 10:10:48 + 26/5/2005 - 10:10:48 + 1.04 + ? + ? + Compute Node + 17 + 257 + +? + ? + EndInit + 5 + Init + +EndInit + + +long + Index + +long + Min + +long + Max + +long + Incr + + +long + Index + +long + Min + +long + Max + +long + Incr + + + +? + + 26/5/2005 - 10:10:48 + 26/5/2005 - 10:10:48 + 1.04 + ? + ? + Compute Node + 555 + 255 + +? + ? + NodeIndex + 3 + ? + +NodeIndex + + +long + Index + + +long + Index + + + +? + + 26/5/2005 - 10:10:48 + 26/5/2005 - 10:10:48 + 2.0 + ? + ? + Compute Node + 281 + 215 + +? + ? + NodeIncr + 3 + ? + +NodeIncr + + +long + Incr + + +long + Incr + + + +? + + 26/5/2005 - 10:10:48 + 26/5/2005 - 10:10:48 + 2.0 + ? + ? + Compute Node + 278 + 372 + + +Init + DoLoop + EndInit + DoLoop + + +Init + Index + NodeIndex + Index + + +Init + Min + EndInit + Min + + +Init + Max + EndInit + Max + + +Init + Incr + NodeIncr + Incr + + +EndInit + DoLoop + Init + DoLoop + + +NodeIndex + Index + EndInit + Index + + +NodeIncr + Incr + EndInit + Incr + + + +GraphLoop_2 + Init__Index + Init + Index + +3 + 0 + + +GraphLoop_2 + Init__Min + Init + Min + +3 + 5 + + +GraphLoop_2 + Init__Max + Init + Max + +3 + 10 + + +GraphLoop_2 + Init__Incr + Init + Incr + +3 + 1 + -- 2.39.2