]> SALOME platform Git repositories - modules/superv.git/blobdiff - examples/GraphPyFunctions.py
Salome HOME
This commit was generated by cvs2git to create branch 'Tag-First-
[modules/superv.git] / examples / GraphPyFunctions.py
diff --git a/examples/GraphPyFunctions.py b/examples/GraphPyFunctions.py
deleted file mode 100755 (executable)
index ddd184e..0000000
+++ /dev/null
@@ -1,217 +0,0 @@
-
-# Generated python file of Graph GraphSwitch
-
-from SuperV import *
-# Graph creation 
-GraphPyFunctions = Graph( 'GraphPyFunctions' )
-GraphPyFunctions.SetName( 'GraphPyFunctions' )
-GraphPyFunctions.SetAuthor( '' )
-GraphPyFunctions.SetComment( '' )
-GraphPyFunctions.Coords( 0 , 0 )
-
-# Creation of Factory Nodes
-
-# Creation of InLine Nodes
-PyIsOdd = []
-IsOdd = GraphPyFunctions.INode( 'IsOdd' , PyIsOdd )
-IsOdd.SetName( 'IsOdd' )
-IsOdd.SetAuthor( '' )
-IsOdd.SetComment( 'Python function' )
-IsOdd.Coords( 388 , 50 )
-IsOdd.InPort( 'a' , 'long' )
-IsOdd.OutPort( 'a' , 'long' )
-
-PyIsOdd_1 = []
-PyIsOdd_1.append( 'from time import *   ' )
-PyIsOdd_1.append( 'def IsOdd(a) :       ' )
-PyIsOdd_1.append( '    print a,"IsOdd"      ' )
-PyIsOdd_1.append( '    sleep( 1 )   ' )
-PyIsOdd_1.append( '    return a     ' )
-IsOdd_1 = GraphPyFunctions.INode( 'IsOdd' , PyIsOdd_1 )
-IsOdd_1.SetName( 'IsOdd_1' )
-IsOdd_1.SetAuthor( '' )
-IsOdd_1.SetComment( 'Python function' )
-IsOdd_1.Coords( 391 , 288 )
-IsOdd_1.InPort( 'a' , 'long' )
-IsOdd_1.OutPort( 'a' , 'long' )
-
-# Creation of Loop Nodes
-PyInitLoop = []
-PyInitLoop.append( 'def InitLoop(Index,Min,Max) :      ' )
-PyInitLoop.append( '   return Index,Min,Max     ' )
-PyMoreInitLoop = []
-PyMoreInitLoop.append( 'def MoreLoop(Index,Min,Max) :     ' )
-PyMoreInitLoop.append( '       if Index <= Max :   ' )
-PyMoreInitLoop.append( '               DoLoop = 1     ' )
-PyMoreInitLoop.append( '       else :     ' )
-PyMoreInitLoop.append( '               DoLoop = 0     ' )
-PyMoreInitLoop.append( '       return DoLoop,Index,Min,Max     ' )
-PyNextInitLoop = []
-PyNextInitLoop.append( 'def NextLoop(Index,Min,Max) :     ' )
-PyNextInitLoop.append( '       Index = Index + 1     ' )
-PyNextInitLoop.append( '       return Index,Min,Max     ' )
-InitLoop,EndOfInitLoop = GraphPyFunctions.LNode( 'InitLoop' , PyInitLoop , 'MoreLoop' , PyMoreInitLoop , 'NextLoop' , PyNextInitLoop )
-EndOfInitLoop.SetName( 'EndOfInitLoop' )
-EndOfInitLoop.SetAuthor( '' )
-EndOfInitLoop.SetComment( '' )
-EndOfInitLoop.Coords( 766 , 127 )
-PyEndOfInitLoop = []
-EndOfInitLoop.SetPyFunction( 'EndInitLoop' , PyEndOfInitLoop )
-InitLoop.SetName( 'InitLoop' )
-InitLoop.SetAuthor( '' )
-InitLoop.SetComment( '' )
-InitLoop.Coords( 10 , 129 )
-InitLoop.InPort( 'Index' , 'long' )
-InitLoop.InPort( 'Min' , 'long' )
-InitLoop.InPort( 'Max' , 'long' )
-InitLoop.OutPort( 'Index' , 'long' )
-InitLoop.OutPort( 'Min' , 'long' )
-InitLoop.OutPort( 'Max' , 'long' )
-
-PyInitLoop_1 = []
-PyMoreInitLoop_1 = []
-PyMoreInitLoop_1.append( '' )
-PyNextInitLoop_1 = []
-PyNextInitLoop_1.append( '' )
-InitLoop_1,EndOfInitLoop_1 = GraphPyFunctions.LNode( 'InitLoop' , PyInitLoop_1 , 'MoreLoop' , PyMoreInitLoop_1 , 'NextLoop' , PyNextInitLoop_1 )
-EndOfInitLoop_1.SetName( 'EndOfInitLoop_1' )
-EndOfInitLoop_1.SetAuthor( '' )
-EndOfInitLoop_1.SetComment( '' )
-EndOfInitLoop_1.Coords( 784 , 361 )
-PyEndOfInitLoop_1 = []
-EndOfInitLoop_1.SetPyFunction( 'EndInitLoop' , PyEndOfInitLoop_1 )
-InitLoop_1.SetName( 'InitLoop_1' )
-InitLoop_1.SetAuthor( '' )
-InitLoop_1.SetComment( '' )
-InitLoop_1.Coords( 12 , 369 )
-InitLoop_1.InPort( 'Index' , 'long' )
-InitLoop_1.InPort( 'Min' , 'long' )
-InitLoop_1.InPort( 'Max' , 'long' )
-InitLoop_1.OutPort( 'Index' , 'long' )
-InitLoop_1.OutPort( 'Min' , 'long' )
-InitLoop_1.OutPort( 'Max' , 'long' )
-
-# Creation of Switch Nodes
-PySwitch = []
-Switch,EndOfSwitch = GraphPyFunctions.SNode( 'Switch' , PySwitch )
-EndOfSwitch.SetName( 'EndOfSwitch' )
-EndOfSwitch.SetAuthor( '' )
-EndOfSwitch.SetComment( '' )
-EndOfSwitch.Coords( 587 , 126 )
-PyEndOfSwitch = []
-EndOfSwitch.SetPyFunction( 'EndOfSwitch_1' , PyEndOfSwitch )
-EndOfSwitch.InPort( 'a' , 'long' )
-EndOfSwitch.OutPort( 'a' , 'long' )
-Switch.SetName( 'Switch' )
-Switch.SetAuthor( '' )
-Switch.SetComment( '' )
-Switch.Coords( 186 , 130 )
-Switch.InPort( 'a' , 'long' )
-Switch.OutPort( 'Odd' , 'long' )
-Switch.OutPort( 'Even' , 'int' )
-Switch.OutPort( 'a' , 'int' )
-
-PySwitch_1 = []
-PySwitch_1.append( 'from time import *  ' )
-PySwitch_1.append( 'def Switch(a) :    ' )
-PySwitch_1.append( '    if ( a & 1 ) == 0 :  ' )
-PySwitch_1.append( '        sleep(1)  ' )
-PySwitch_1.append( '    return a & 1,1-(a&1),a    ' )
-Switch_1,EndOfSwitch_1 = GraphPyFunctions.SNode( 'Switch' , PySwitch_1 )
-EndOfSwitch_1.SetName( 'EndOfSwitch_1' )
-EndOfSwitch_1.SetAuthor( '' )
-EndOfSwitch_1.SetComment( '' )
-EndOfSwitch_1.Coords( 594 , 362 )
-PyEndOfSwitch_1 = []
-EndOfSwitch_1.SetPyFunction( 'EndOfSwitch_1' , PyEndOfSwitch_1 )
-EndOfSwitch_1.InPort( 'a' , 'long' )
-EndOfSwitch_1.OutPort( 'a' , 'long' )
-Switch_1.SetName( 'Switch_1' )
-Switch_1.SetAuthor( '' )
-Switch_1.SetComment( '' )
-Switch_1.Coords( 185 , 368 )
-Switch_1.InPort( 'a' , 'long' )
-Switch_1.OutPort( 'Odd' , 'long' )
-Switch_1.OutPort( 'Even' , 'int' )
-Switch_1.OutPort( 'a' , 'int' )
-
-# Creation of Links
-IsOdda = IsOdd.Port( 'a' )
-EndOfSwitcha = GraphPyFunctions.Link( IsOdda , EndOfSwitch.Port( 'a' ) )
-EndOfSwitcha.AddCoord( 1 , 571 , 160 )
-EndOfSwitcha.AddCoord( 2 , 571 , 129 )
-
-InitLoopIndex = InitLoop.Port( 'Index' )
-Switcha = GraphPyFunctions.Link( InitLoopIndex , Switch.Port( 'a' ) )
-
-InitLoopMin = InitLoop.Port( 'Min' )
-EndOfInitLoopMin = GraphPyFunctions.Link( InitLoopMin , EndOfInitLoop.Port( 'Min' ) )
-
-InitLoopMax = InitLoop.Port( 'Max' )
-EndOfInitLoopMax = GraphPyFunctions.Link( InitLoopMax , EndOfInitLoop.Port( 'Max' ) )
-
-SwitchOdd = Switch.Port( 'Odd' )
-IsOddInGate = GraphPyFunctions.Link( SwitchOdd , IsOdd.Port( 'InGate' ) )
-
-Switcha = Switch.Port( 'a' )
-IsOdda = GraphPyFunctions.Link( Switcha , IsOdd.Port( 'a' ) )
-IsOdda.AddCoord( 1 , 366 , 131 )
-IsOdda.AddCoord( 2 , 365 , 223 )
-
-SwitchDefault = Switch.Port( 'Default' )
-EndOfSwitchDefault = GraphPyFunctions.Link( SwitchDefault , EndOfSwitch.Port( 'Default' ) )
-EndOfSwitchDefault.AddCoord( 1 , 572 , 194 )
-EndOfSwitchDefault.AddCoord( 2 , 571 , 257 )
-
-EndOfSwitcha = EndOfSwitch.Port( 'a' )
-EndOfInitLoopIndex = GraphPyFunctions.Link( EndOfSwitcha , EndOfInitLoop.Port( 'Index' ) )
-
-IsOdd_1a = IsOdd_1.Port( 'a' )
-EndOfSwitch_1a = GraphPyFunctions.Link( IsOdd_1a , EndOfSwitch_1.Port( 'a' ) )
-EndOfSwitch_1a.AddCoord( 1 , 580 , 396 )
-EndOfSwitch_1a.AddCoord( 2 , 580 , 368 )
-
-InitLoop_1Index = InitLoop_1.Port( 'Index' )
-Switch_1a = GraphPyFunctions.Link( InitLoop_1Index , Switch_1.Port( 'a' ) )
-
-InitLoop_1Min = InitLoop_1.Port( 'Min' )
-EndOfInitLoop_1Min = GraphPyFunctions.Link( InitLoop_1Min , EndOfInitLoop_1.Port( 'Min' ) )
-
-InitLoop_1Max = InitLoop_1.Port( 'Max' )
-EndOfInitLoop_1Max = GraphPyFunctions.Link( InitLoop_1Max , EndOfInitLoop_1.Port( 'Max' ) )
-
-Switch_1Odd = Switch_1.Port( 'Odd' )
-IsOdd_1InGate = GraphPyFunctions.Link( Switch_1Odd , IsOdd_1.Port( 'InGate' ) )
-
-Switch_1Even = Switch_1.Port( 'Even' )
-EndOfSwitch_1Default = GraphPyFunctions.Link( Switch_1Even , EndOfSwitch_1.Port( 'Default' ) )
-
-Switch_1a = Switch_1.Port( 'a' )
-IsOdd_1a = GraphPyFunctions.Link( Switch_1a , IsOdd_1.Port( 'a' ) )
-IsOdd_1a.AddCoord( 1 , 368 , 368 )
-IsOdd_1a.AddCoord( 2 , 367 , 460 )
-
-EndOfSwitch_1a = EndOfSwitch_1.Port( 'a' )
-EndOfInitLoop_1Index = GraphPyFunctions.Link( EndOfSwitch_1a , EndOfInitLoop_1.Port( 'Index' ) )
-
-# Creation of Input datas
-InitLoopIndex = InitLoop.Input( 'Index' , 0)
-InitLoopMin = InitLoop.Input( 'Min' , 0)
-InitLoopMax = InitLoop.Input( 'Max' , 100)
-InitLoop_1Index = InitLoop_1.Input( 'Index' , 0)
-InitLoop_1Min = InitLoop_1.Input( 'Min' , 0)
-InitLoop_1Max = InitLoop_1.Input( 'Max' , 100)
-
-# Creation of Output variables
-EndOfInitLoopIndex = EndOfInitLoop.Port( 'Index' )
-EndOfInitLoopMin = EndOfInitLoop.Port( 'Min' )
-EndOfInitLoopMax = EndOfInitLoop.Port( 'Max' )
-SwitchEven = Switch.Port( 'Even' )
-EndOfInitLoop_1Index = EndOfInitLoop_1.Port( 'Index' )
-EndOfInitLoop_1Min = EndOfInitLoop_1.Port( 'Min' )
-EndOfInitLoop_1Max = EndOfInitLoop_1.Port( 'Max' )
-
-GraphPyFunctions.Run()
-GraphPyFunctions.DoneW()
-GraphPyFunctions.State()
-GraphPyFunctions.PrintPorts()