1 # Copyright (C) 2006-2008 CEA/DEN, EDF R&D
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License.
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 # Lesser General Public License for more details.
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
25 comp = salome.lcc.FindOrLoadComponent( "YACSContainer","YACS" )
26 yacsgen = comp._narrow(YACS_ORB.YACS_Gen)
28 # -----------------------------------------------------------------------------
31 procEx = yacsgen.LoadProc("samples/legendre7.xml")
32 procEx.setExecMode(YACS_ORB.CONTINUE)
35 # --- wait until executor is paused, finished or stopped
40 state = procEx.getExecutorState()
41 isRunning = (state < 304)
42 print "executorState: ", state
45 procEx.saveState("res.xml")
46 numids,names = procEx.getIds()
51 dico[name] = numids[i]
55 print procEx.getOutPortValue(dico["poly_7"],"Pn")
56 print procEx.getInPortValue(dico["poly_7"],"x")
57 print procEx.getInPortValue(dico["poly_7"],"notAPort")
58 print procEx.getInPortValue(dico["Legendre.loopIter"],"nsteps")
60 # -----------------------------------------------------------------------------
61 # --- schema with errors (echoSrv must be launched)
63 procEx = yacsgen.LoadProc("samples/aschema.xml")
64 procEx.setExecMode(YACS_ORB.CONTINUE)
67 # --- wait until executor is paused, finised or stopped
72 state = procEx.getExecutorState()
73 isRunning = (state < 304)
74 print "executorState: ", state
77 procEx.saveState("res2.xml")
78 numids,names = procEx.getIds()
83 dico[name] = numids[i]
87 print procEx.getErrorDetails(dico["c1"])
88 print procEx.getErrorDetails(dico["node13"])
90 # -----------------------------------------------------------------------------
91 # --- schema with errors
93 procEx = yacsgen.LoadProc("samples/triangle5error.xml")
94 procEx.setExecMode(YACS_ORB.CONTINUE)
95 procEx.setStopOnError(1,"execError2.xml")
96 #procEx.unsetStopOnError()
102 state = procEx.getExecutorState()
103 isRunning = (state < 304)
104 print "executorState: ", state
107 #procEx.resumeCurrentBreakPoint()
109 procEx.saveState("res3.xml")
111 # -----------------------------------------------------------------------------
112 # --- schema with breakpoints
114 procEx = yacsgen.LoadProc("samples/legendre7.xml")
115 procEx.setListOfBreakPoints(["Legendre.loopIter.deuxIter.iter2"])
116 procEx.setExecMode(YACS_ORB.STOPBEFORENODES)
122 state = procEx.getExecutorState()
123 isRunning = (state < 304)
124 print "executorState: ", state
127 procEx.saveState("partialExec.xml")
129 procEx = yacsgen.LoadProc("samples/legendre7.xml")
130 procEx.setExecMode(YACS_ORB.CONTINUE)
131 procEx.RunFromState("partialExec.xml")
136 state = procEx.getExecutorState()
137 isRunning = (state < 304)
138 print "executorState: ", state
141 procEx.saveState("finishExec.xml")