2 # Check the Merge of two graphs and python functions definitions
4 # Creation of GraphSwitch
5 from GraphSwitch import *
7 # Creation of GraphSwitch1
8 from GraphSwitch1 import *
10 # Merge of GraphSwitch1 in GraphSwitch
11 GraphSwitch.Merge( GraphSwitch1 )
13 # Create a variable for each node of GraphSwitch :
14 # IsOdd,IsOdd_1,InitLoopSwitch,InitLoop,EndOfInitLoopSwitch,EndOfInitLoop,Switch,Switch_1,EndOfSwitch,EndSwitch
15 exec GraphSwitch.ListNodes()
17 funcname = InitLoopSwitch.PyInitName()
18 funcname1 = InitLoop.PyInitName()
19 print "Init python function names of InitLoopSwitch and InitLoop :",funcname,funcname1
21 # Erase python functions of InitLoop
22 InitLoop.SetPyInit( funcname , [] )
24 InitLoop.SetPyMore( InitLoop.PyMoreName() , [] )
26 InitLoop.SetPyNext( InitLoop.PyNextName() , [] )
29 IsOdd.SetPyFunction( IsOdd.PyFuncName() , [] )
32 # Print Input and Output Ports values of InitLoopSwitch
33 InitLoopSwitch.PrintPorts()
35 # Print Input and Output Ports values of InitLoop
38 # Print Input and Output Ports values of GraphSwitch
39 GraphSwitch.PrintPorts()
41 # Start asynchronous execution of GraphSwitch
44 # Wait for completion of GraphSwitch
47 # Print the state of GraphSwitch
50 # Print the results of GraphSwitch
51 GraphSwitch.PrintPorts()
53 GraphSwitch.Export( "../GraphPyFunctions.xml" )