Salome HOME
DCQ : Merge with Ecole_Ete_a6.
[modules/superv.git] / examples / GraphMerge1.py
1
2 # Check the Merge of two graphs and python functions definitions
3
4 # Creation of GraphSwitch
5 from GraphSwitch import *
6
7 # Creation of GraphSwitch1
8 from GraphSwitch1 import *
9
10 # Merge of GraphSwitch1 in GraphSwitch
11 GraphSwitch.Merge( GraphSwitch1 )
12
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()
16
17 funcname = InitLoopSwitch.PyInitName()
18 funcname1 = InitLoop.PyInitName()
19 print "Init python function names of InitLoopSwitch and InitLoop :",funcname,funcname1
20 InitLoop.PyInit()
21 # Erase python functions of InitLoop
22 InitLoop.SetPyInit( funcname , [] )
23 InitLoop.PyInit()
24 InitLoop.SetPyMore( InitLoop.PyMoreName() , [] )
25 InitLoop.PyMore()
26 InitLoop.SetPyNext( InitLoop.PyNextName() , [] )
27 InitLoop.PyNext()
28
29 IsOdd.SetPyFunction( IsOdd.PyFuncName() , [] )
30 IsOdd.PyFunction()
31
32 # Print Input and Output Ports values of InitLoopSwitch
33 InitLoopSwitch.PrintPorts()
34
35 # Print Input and Output Ports values of InitLoop
36 InitLoop.PrintPorts()
37
38 # Print Input and Output Ports values of GraphSwitch
39 GraphSwitch.PrintPorts()
40
41 # Start asynchronous execution of GraphSwitch
42 GraphSwitch.Run()
43
44 # Wait for completion of GraphSwitch
45 GraphSwitch.DoneW()
46
47 # Print the state of GraphSwitch
48 GraphSwitch.State()
49
50 # Print the results of GraphSwitch
51 GraphSwitch.PrintPorts()
52
53 GraphSwitch.Export( "../GraphPyFunctions.xml" )
54