Salome HOME
The order of deletion of Ports (during the deletion of nodes) was wrong.
[modules/superv.git] / examples / GraphBadOutputOfLoop1.py
index 3405c93a7f01d829cd9a57ed1fde9a9384562d70..700af331c4a681f2789c6d58fa0e87bd4d8645af 100755 (executable)
@@ -15,19 +15,17 @@ def DefGraphBadOutputOfLoop1() :
     
     # Creation of InLine Nodes
     PyIsOdd = []
-    PyIsOdd.append( 'from time import *     ' )
-    PyIsOdd.append( 'def IsOdd(a,Even,InputInLoop) :         ' )
-    PyIsOdd.append( '    print a,"IsOdd (GraphLoopSwitch1)"        ' )
-    PyIsOdd.append( '    sleep( 1 )     ' )
-    PyIsOdd.append( '    return a       ' )
+    PyIsOdd.append( 'from time import *       ' )
+    PyIsOdd.append( 'def IsOdd(a) :           ' )
+    PyIsOdd.append( '    print a,"IsOdd (GraphLoopSwitch1)"          ' )
+    PyIsOdd.append( '    sleep( 1 )       ' )
+    PyIsOdd.append( '    return a         ' )
     IsOdd = GraphBadOutputOfLoop1.INode( 'IsOdd' , PyIsOdd )
     IsOdd.SetName( 'IsOdd' )
     IsOdd.SetAuthor( '' )
     IsOdd.SetComment( 'Python function' )
     IsOdd.Coords( 397 , 1 )
     IIsOdda = IsOdd.InPort( 'a' , 'long' )
-    IIsOddEven = IsOdd.InPort( 'Even' , 'boolean' )
-    IIsOddInputInLoop = IsOdd.InPort( 'InputInLoop' , 'boolean' )
     IIsOddGate = IsOdd.GetInPort( 'Gate' )
     OIsOdda = IsOdd.OutPort( 'a' , 'long' )
     OIsOddGate = IsOdd.GetOutPort( 'Gate' )
@@ -65,7 +63,7 @@ def DefGraphBadOutputOfLoop1() :
     PyEndOfInitLoop.append( '          DoLoop = 0     ' )
     PyEndOfInitLoop.append( '  return DoLoop,Index,Min,Max     ' )
     EndOfInitLoop.SetPyFunction( 'EndOfInitLoop' , PyEndOfInitLoop )
-    IInitLoopInitLoop = InitLoop.GetInPort( 'InitLoop' )
+    IInitLoopDoLoop = InitLoop.GetInPort( 'DoLoop' )
     IInitLoopIndex = InitLoop.InPort( 'Index' , 'long' )
     IInitLoopMin = InitLoop.InPort( 'Min' , 'long' )
     IInitLoopMax = InitLoop.InPort( 'Max' , 'long' )
@@ -83,6 +81,7 @@ def DefGraphBadOutputOfLoop1() :
     OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' )
     OEndOfInitLoopMin = EndOfInitLoop.GetOutPort( 'Min' )
     OEndOfInitLoopMax = EndOfInitLoop.GetOutPort( 'Max' )
+    OEndOfInitLoopGate = EndOfInitLoop.GetOutPort( 'Gate' )
     InitLoop.SetName( 'InitLoop' )
     InitLoop.SetAuthor( '' )
     InitLoop.SetComment( 'Compute Node' )
@@ -123,8 +122,6 @@ def DefGraphBadOutputOfLoop1() :
     
     # Creation of Links
     LIsOddaEndSwitcha = GraphBadOutputOfLoop1.Link( OIsOdda , IEndSwitcha )
-    LIsOddaEndSwitcha.AddCoord( 1 , 576 , 136 )
-    LIsOddaEndSwitcha.AddCoord( 2 , 575 , 81 )
     
     LInitLoopIndexSwitcha = GraphBadOutputOfLoop1.Link( OInitLoopIndex , ISwitcha )
     
@@ -136,22 +133,14 @@ def DefGraphBadOutputOfLoop1() :
     
     LSwitchEvenEndSwitchDefault = GraphBadOutputOfLoop1.Link( OSwitchEven , IEndSwitchDefault )
     
-    LSwitchEvenIsOddEven = GraphBadOutputOfLoop1.Link( OSwitchEven , IIsOddEven )
-    LSwitchEvenIsOddEven.AddCoord( 1 , 375 , 111 )
-    LSwitchEvenIsOddEven.AddCoord( 2 , 375 , 172 )
-    
     LSwitchaIsOdda = GraphBadOutputOfLoop1.Link( OSwitcha , IIsOdda )
-    LSwitchaIsOdda.AddCoord( 1 , 362 , 82 )
-    LSwitchaIsOdda.AddCoord( 2 , 360 , 201 )
     
     LEndSwitchaEndOfInitLoopIndex = GraphBadOutputOfLoop1.Link( OEndSwitcha , IEndOfInitLoopIndex )
     
     # Input datas
-    IIsOddInputInLoop.Input( 136306160 )
     IInitLoopIndex.Input( 0 )
     IInitLoopMin.Input( 0 )
     IInitLoopMax.Input( 100 )
-    IEndOfInitLoopMax.Input( 136221856 )
     
     # Output Ports of the graph
     #OEndOfInitLoopIndex = EndOfInitLoop.GetOutPort( 'Index' )