From: rahuel Date: Wed, 12 Jan 2005 13:35:31 +0000 (+0000) Subject: More than one branch of a switch is activated, the SwitchNode is aborted X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b2bc92ad54400cd9c557dc9d1feadd83bc74c7b7;p=modules%2Fsuperv.git More than one branch of a switch is activated, the SwitchNode is aborted --- diff --git a/examples/GraphSwitchErrExec.py b/examples/GraphSwitchErrExec.py new file mode 100644 index 0000000..4706bb0 --- /dev/null +++ b/examples/GraphSwitchErrExec.py @@ -0,0 +1,164 @@ + +# Generated python file of Graph GraphSwitch_1 + +from SuperV import * + +# Graph creation of GraphSwitch_1 +def DefGraphSwitch_1() : + GraphSwitch_1 = Graph( 'GraphSwitch_1' ) + GraphSwitch_1.SetName( 'GraphSwitch_1' ) + GraphSwitch_1.SetAuthor( '' ) + GraphSwitch_1.SetComment( '' ) + GraphSwitch_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.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.INode( 'IsEven' , PyIsEven ) + IsEven.SetName( 'IsEven' ) + IsEven.SetAuthor( '' ) + IsEven.SetComment( 'Compute Node' ) + IsEven.Coords( 397 , 279 ) + IIsEvena = IsEven.InPort( 'a' , 'long' ) + IIsEvenGate = IsEven.GetInPort( 'Gate' ) + OIsEvena = IsEven.OutPort( 'a' , 'long' ) + OIsEvenGate = IsEven.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.LNode( 'InitLoop' , PyInitLoopSwitch , 'MoreLoop' , PyMoreInitLoopSwitch , 'NextLoop' , PyNextInitLoopSwitch ) + EndOfInitLoopSwitch.SetName( 'EndOfInitLoopSwitch' ) + EndOfInitLoopSwitch.SetAuthor( '' ) + EndOfInitLoopSwitch.SetComment( 'Compute Node' ) + EndOfInitLoopSwitch.Coords( 766 , 127 ) + 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( ' if a == 0 : ' ) + PySwitch.append( ' return 0,0,a ' ) + PySwitch.append( ' if a < 0 : ' ) + PySwitch.append( ' return 1,1,a ' ) + PySwitch.append( ' if ( a & 1 ) == 0 : ' ) + PySwitch.append( ' sleep(1) ' ) + PySwitch.append( ' return a & 1,1-(a&1),a ' ) + Switch,EndOfSwitch = GraphSwitch_1.SNode( 'Switch' , PySwitch ) + EndOfSwitch.SetName( 'EndOfSwitch' ) + EndOfSwitch.SetAuthor( '' ) + EndOfSwitch.SetComment( 'Compute Node' ) + EndOfSwitch.Coords( 580 , 147 ) + 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' ) + OSwitchDefault = Switch.GetOutPort( 'Default' ) + + # Creation of Links + LIsOddaEndOfSwitcha = GraphSwitch_1.Link( OIsOdda , IEndOfSwitcha ) + + LInitLoopSwitchIndexSwitcha = GraphSwitch_1.Link( OInitLoopSwitchIndex , ISwitcha ) + + LInitLoopSwitchMinEndOfInitLoopSwitchMin = GraphSwitch_1.Link( OInitLoopSwitchMin , IEndOfInitLoopSwitchMin ) + + LInitLoopSwitchMaxEndOfInitLoopSwitchMax = GraphSwitch_1.Link( OInitLoopSwitchMax , IEndOfInitLoopSwitchMax ) + + LIsEvenaEndOfSwitcha = GraphSwitch_1.Link( OIsEvena , IEndOfSwitcha ) + + LSwitchOddIsOddGate = GraphSwitch_1.Link( OSwitchOdd , IIsOddGate ) + + LSwitchEvenIsEvenGate = GraphSwitch_1.Link( OSwitchEven , IIsEvenGate ) + + LSwitchaIsOdda = GraphSwitch_1.Link( OSwitcha , IIsOdda ) + + LSwitchaIsEvena = GraphSwitch_1.Link( OSwitcha , IIsEvena ) + + LSwitchDefaultEndOfSwitchDefault = GraphSwitch_1.Link( OSwitchDefault , IEndOfSwitchDefault ) + + LEndOfSwitchaEndOfInitLoopSwitchIndex = GraphSwitch_1.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 GraphSwitch_1 + + +GraphSwitch_1 = DefGraphSwitch_1() diff --git a/examples/GraphSwitchErrExec.xml b/examples/GraphSwitchErrExec.xml new file mode 100644 index 0000000..e588ff6 --- /dev/null +++ b/examples/GraphSwitchErrExec.xml @@ -0,0 +1,385 @@ + + + + + +? + ? + GraphSwitch_1 + 1 + ? + +GraphSwitch_1 + + +long + InitLoopSwitch__Index + +long + InitLoopSwitch__Min + +long + InitLoopSwitch__Max + + +long + EndOfInitLoopSwitch__Index + +long + EndOfInitLoopSwitch__Min + +long + EndOfInitLoopSwitch__Max + + + 1/10/2003 - 17:23:54 + 12/1/2005 - 16:10:58 + 1.05 + ? + ? + ? + 0 + 0 + + +? + ? + IsOdd + 3 + ? + +IsOdd + + +long + a + + +long + a + + + +IsOdd + + + + + + 12/1/2005 - 16:10:58 + 12/1/2005 - 16:10:58 + 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 + + + + 12/1/2005 - 16:10:58 + 12/1/2005 - 16:10:58 + 1.05 + ? + ? + Compute Node + 10 + 129 + +? + ? + EndOfInitLoopSwitch + 5 + InitLoopSwitch + +EndOfInitLoopSwitch + + +long + Index + +long + Min + +long + Max + + +long + Index + +long + Min + +long + Max + + + +? + + 12/1/2005 - 16:10:58 + 12/1/2005 - 16:10:58 + 1.05 + ? + ? + Compute Node + 766 + 127 + +? + ? + IsEven + 3 + ? + +IsEven + + +long + a + + +long + a + + + +IsEven + + + + + + 12/1/2005 - 16:10:58 + 12/1/2005 - 16:10:58 + 2.0 + ? + ? + Compute Node + 397 + 279 + +? + ? + Switch + 6 + EndOfSwitch + +Switch + + +long + a + + +long + Odd + +int + Even + +int + a + + + +Switch + + + + + + + + + + 12/1/2005 - 16:10:58 + 12/1/2005 - 16:10:58 + 2.0 + ? + ? + Compute Node + 195 + 129 + +? + ? + EndOfSwitch + 7 + Switch + +EndOfSwitch + + +long + a + + +long + a + + + +EndSwitch_1 + + 12/1/2005 - 16:10:58 + 12/1/2005 - 16:10:58 + 2.0 + ? + ? + Compute Node + 580 + 147 + + +IsOdd + a + EndOfSwitch + a + + +InitLoopSwitch + DoLoop + EndOfInitLoopSwitch + DoLoop + + +InitLoopSwitch + Index + Switch + a + + +InitLoopSwitch + Min + EndOfInitLoopSwitch + Min + + +InitLoopSwitch + Max + EndOfInitLoopSwitch + Max + + +EndOfInitLoopSwitch + DoLoop + InitLoopSwitch + DoLoop + + +IsEven + a + EndOfSwitch + a + + +Switch + Odd + IsOdd + Gate + + +Switch + Even + IsEven + Gate + + +Switch + a + IsOdd + a + + +Switch + a + IsEven + a + + +Switch + Default + EndOfSwitch + Default + + +EndOfSwitch + a + EndOfInitLoopSwitch + Index + + + +GraphSwitch_1 + InitLoopSwitch__Index + InitLoopSwitch + Index + +3 + 0 + + +GraphSwitch_1 + InitLoopSwitch__Min + InitLoopSwitch + Min + +3 + -5 + + +GraphSwitch_1 + InitLoopSwitch__Max + InitLoopSwitch + Max + +3 + 10 +