Salome HOME
Imported using TkCVS
[samples/datafiles.git] / Superv / Python / GraphRunSyr.py
1 #  Copyright (C) 2003  CEA/DEN, EDF R&D
2 #
3 #
4 #
5 #  File   : GraphRunSyr.py
6 #  Module : SuperVisionTest
7
8 from SuperV import *
9
10 # Warning this script has an IOR (object reference) as Input :
11 # You may have to redefine it with the result of :
12 #         SyrStruct.ComponentRef( 'FactoryServer' , 'SyrComponent' )
13 # See the Input Port forN.InPort( 'SyrComponent' , 'ComponentRef' )
14
15 #SyrStruct = Graph('../share/salome/resources/SyrStruct.xml')
16 SyrStruct = Graph('/home/data/jr_HEAD/build/share/salome/resources/SyrStruct.xml')
17
18 exec SyrStruct.ListNodes()
19
20 forN.Input('min',5)
21 forN.Input('max',8)
22
23 SyrStruct.Start()
24
25 endforN.State()
26
27 SyrStruct.State()
28
29 endforN.Suspend()
30
31 forN.State()
32
33 N = forN.Port( 'N' )
34 EndN = endwhileNotOne.Port( 'N' )
35 K = endforN.Port( 'K' )
36
37 forN.Resume()
38
39 while SyrStruct.IsDone() == 0 :
40     endforN.SuspendedW()
41     if SyrStruct.IsDone() == 0 :
42         print N.ToString(),'-->',EndN.ToString(),'with',K.ToString(),'steps'
43         endforN.Resume()
44
45 SyrStruct.State()
46
47 SyrStruct.PrintPorts()