]> SALOME platform Git repositories - modules/superv.git/blobdiff - examples/GraphSyracuseC_Gate.py
Salome HOME
Merge with version on tag OCC-V2_1_0d
[modules/superv.git] / examples / GraphSyracuseC_Gate.py
diff --git a/examples/GraphSyracuseC_Gate.py b/examples/GraphSyracuseC_Gate.py
deleted file mode 100644 (file)
index 2493180..0000000
+++ /dev/null
@@ -1,203 +0,0 @@
-#  Copyright (C) 2003  CEA/DEN, EDF R&D
-#
-#
-#
-#  File   : GraphSyracuseC_Gate.py
-#  Module : SuperVisionTest
-
-from SuperV import *
-# Graph creation 
-GraphSyracuseC_Gate = Graph( 'GraphSyracuseC_Gate' )
-GraphSyracuseC_Gate.SetName( 'GraphSyracuseC_Gate' )
-GraphSyracuseC_Gate.SetAuthor( 'JR' )
-GraphSyracuseC_Gate.SetComment( 'Syracuse algorithm' )
-GraphSyracuseC_Gate.Coords( 0 , 0 )
-
-# Creation of Factory Nodes
-test_ISEVEN = GraphSyracuseC_Gate.FNode( 'SyrComponent' , 'SyrComponent' , 'C_ISEVEN' )
-test_ISEVEN.SetName( 'test_ISEVEN' )
-test_ISEVEN.SetAuthor( '' )
-test_ISEVEN.SetContainer( 'localhost/FactoryServer' )
-test_ISEVEN.SetComment( 'C_ISEVEN from SyrComponent' )
-test_ISEVEN.Coords( 5 , 416 )
-test_ISONE = GraphSyracuseC_Gate.FNode( 'SyrComponent' , 'SyrComponent' , 'C_ISONE' )
-test_ISONE.SetName( 'test_ISONE' )
-test_ISONE.SetAuthor( '' )
-test_ISONE.SetContainer( 'localhost/FactoryServer' )
-test_ISONE.SetComment( 'C_ISONE from SyrComponent' )
-test_ISONE.Coords( 7 , 232 )
-m3p1 = GraphSyracuseC_Gate.FNode( 'SyrComponent' , 'SyrComponent' , 'C_M3P1' )
-m3p1.SetName( 'm3p1' )
-m3p1.SetAuthor( '' )
-m3p1.SetContainer( 'localhost/FactoryServer' )
-m3p1.SetComment( 'C_M3P1 from SyrComponent' )
-m3p1.Coords( 180 , 417 )
-div2 = GraphSyracuseC_Gate.FNode( 'SyrComponent' , 'SyrComponent' , 'C_DIV2' )
-div2.SetName( 'div2' )
-div2.SetAuthor( '' )
-div2.SetContainer( 'localhost/FactoryServer' )
-div2.SetComment( 'C_DIV2 from SyrComponent' )
-div2.Coords( 435 , 7 )
-div2_ISEVEN = GraphSyracuseC_Gate.FNode( 'SyrComponent' , 'SyrComponent' , 'C_ISEVEN' )
-div2_ISEVEN.SetName( 'div2_ISEVEN' )
-div2_ISEVEN.SetAuthor( '' )
-div2_ISEVEN.SetContainer( 'localhost/FactoryServer' )
-div2_ISEVEN.SetComment( 'C_ISEVEN from SyrComponent' )
-div2_ISEVEN.Coords( 663 , 193 )
-div2_ISONE = GraphSyracuseC_Gate.FNode( 'SyrComponent' , 'SyrComponent' , 'C_ISONE' )
-div2_ISONE.SetName( 'div2_ISONE' )
-div2_ISONE.SetAuthor( '' )
-div2_ISONE.SetContainer( 'localhost/FactoryServer' )
-div2_ISONE.SetComment( 'C_ISONE from SyrComponent' )
-div2_ISONE.Coords( 651 , 6 )
-incr = GraphSyracuseC_Gate.FNode( 'SyrComponent' , 'SyrComponent' , 'C_INCR' )
-incr.SetName( 'incr' )
-incr.SetAuthor( '' )
-incr.SetContainer( 'localhost/FactoryServer' )
-incr.SetComment( 'C_INCR from SyrComponent' )
-incr.Coords( 434 , 193 )
-
-# Creation of intermediate Output variables and of Control Links
-test_ISEVENOutGate = test_ISEVEN.Port( 'OutGate' )
-m3p1InGate = GraphSyracuseC_Gate.Link( test_ISEVENOutGate , m3p1.Port( 'InGate' ) )
-m3p1anEvenInteger = m3p1.Port( 'anEvenInteger' )
-div2anEvenInteger = GraphSyracuseC_Gate.Link( m3p1anEvenInteger , div2.Port( 'anEvenInteger' ) )
-div2anEvenInteger.AddCoord( 1 , 373 , 117 )
-div2anEvenInteger.AddCoord( 2 , 373 , 528 )
-div2anInteger = div2.Port( 'anInteger' )
-div2_ISONEanInteger = GraphSyracuseC_Gate.Link( div2anInteger , div2_ISONE.Port( 'anInteger' ) )
-div2_ISEVENanInteger = GraphSyracuseC_Gate.Link( div2anInteger , div2_ISEVEN.Port( 'anInteger' ) )
-div2_ISEVENanInteger.AddCoord( 1 , 626 , 302 )
-div2_ISEVENanInteger.AddCoord( 2 , 626 , 116 )
-
-# Creation of Input datas
-test_ISEVENanInteger = test_ISEVEN.Input( 'anInteger' , 31)
-test_ISONEanInteger = test_ISONE.Input( 'anInteger' , 31)
-m3p1anOddInteger = m3p1.Input( 'anOddInteger' , 31)
-incraCount = incr.Input( 'aCount' , 0)
-
-# Creation of Output variables
-test_ISEVENBoolEven = test_ISEVEN.Port( 'BoolEven' )
-test_ISONEBoolOne = test_ISONE.Port( 'BoolOne' )
-div2_ISEVENBoolEven = div2_ISEVEN.Port( 'BoolEven' )
-div2_ISONEBoolOne = div2_ISONE.Port( 'BoolOne' )
-incraNewCount = incr.Port( 'aNewCount' )
-
-
-GraphSyracuseC_Gate.Start()
-
-div2InanInteger = div2.Port( 'anEvenInteger' )
-
-m3p1.Suspend()
-
-div2_ISEVEN.SuspendDone()
-div2_ISONE.SuspendDone()
-
-test_ISEVEN.Resume()
-test_ISONE.Resume()
-
-# Attente de fin d'execution de test
-test_ISONE.DoneW()
-test_ISEVEN.DoneW()
-
-m3p1.SuspendedW()
-incr.SuspendedW()
-incr.SuspendDone()
-
-# Etats et Threads des nodes
-GraphSyracuseC_Gate.PrintThreads()
-
-BoolOne = int( test_ISONEBoolOne.ToString() )
-BoolEven = int( test_ISEVENBoolEven.ToString() )
-while BoolOne == 0 :
-    if BoolEven == 0 :
-        sts = div2_ISONE.ReRunAt('m3p1')
-        if sts == 0 :
-            print 'div2_ISONE.ReRunAt error'
-            break
-        sts = incr.ReRun()
-        if sts == 0 :
-            print 'incr.ReRun error'
-            break
-        sts = m3p1.DoneW()
-        if sts == 0 :
-            print 'm3p1.DoneW error'
-            break
-        sts = incr.DoneW()
-        if sts == 0 :
-            print 'incr.DoneW error'
-            break
-        sts = incraCount.Input( int( incraNewCount.ToString() ) + 1 )
-        if sts == 0 :
-            print 'incraCount.Input error'
-            break
-        BoolEven = 1 
-        BoolOne = 0
-        Current = int( m3p1anEvenInteger.ToString() )
-        print incraNewCount.ToString(),"m3p1",Current,BoolEven
-        if Current <= 0 :
-            break
-    if Current <= 0 :
-        break
-    while BoolEven == 1 :
-        sts = incr.ReRun()
-        if sts == 0 :
-            print 'incr.ReRun error'
-            break
-        sts = div2.DoneW()
-        if sts == 0 :
-            print 'div2.DoneW error'
-            break
-        sts = div2_ISEVEN.DoneW()
-        if sts == 0 :
-            print 'div2_ISEVEN.DoneW error'
-            break
-        sts = div2_ISONE.DoneW()
-        if sts == 0 :
-            print 'div2_ISONE.DoneW error'
-            break
-        sts = incr.DoneW()
-        if sts == 0 :
-            print 'incr.DoneW error'
-            break
-        sts = incraCount.Input( incraNewCount.ToString() )
-        if sts == 0 :
-            print 'incraCount.Input error'
-            break
-        BoolOne = int( div2_ISONEBoolOne.ToString() )
-        BoolEven = int( div2_ISEVENBoolEven.ToString() )
-        Current = int( div2anInteger.ToString() )
-        print incraNewCount.ToString(),"div2",Current,BoolEven,BoolOne
-        if Current <= 0 :
-            break
-        if BoolEven == 1 :
-            sts = div2InanInteger.Input( Current )
-            if sts == 0 :
-                print 'div2InanInteger.Input error'
-                break
-            sts = div2_ISONE.ReRunAt('div2')
-            if sts == 0 :
-                print 'div2_ISONE.ReRunAt error'
-                break
-    if Current <= 0 :
-        break
-    sts = m3p1anOddInteger.Input( Current )
-    if sts == 0 :
-        print 'm3p1anOddInteger.Input error'
-        break
-    sts = m3p1InGate.InPort().Input( 1 )
-    if sts == 0 :
-        print 'm3p1InGate.InPort error'
-        break
-
-
-GraphSyracuseC_Gate.PrintThreads()
-m3p1.Resume()
-div2.Resume()
-incr.Resume()
-div2_ISONE.Resume()
-div2_ISEVEN.Resume()
-GraphSyracuseC_Gate.DoneW()
-GraphSyracuseC_Gate.PrintPorts()
-GraphSyracuseC_Gate.PrintThreads()
-