1 # Copyright (C) 2006-2015 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, or (at your option) any later version.
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
26 comp = salome.lcc.FindOrLoadComponent( "YACSContainer","YACS" )
27 yacsgen = comp._narrow(YACS_ORB.YACS_Gen)
29 # -----------------------------------------------------------------------------
32 procEx = yacsgen.LoadProc("samples/legendre7.xml")
33 procEx.setExecMode(YACS_ORB.CONTINUE)
36 # --- wait until executor is paused, finished or stopped
41 state = procEx.getExecutorState()
42 isRunning = (state < 304)
43 print "executorState: ", state
46 procEx.saveState("res.xml")
47 numids,names = procEx.getIds()
52 dico[name] = numids[i]
56 print procEx.getOutPortValue(dico["poly_7"],"Pn")
57 print procEx.getInPortValue(dico["poly_7"],"x")
58 print procEx.getInPortValue(dico["poly_7"],"notAPort")
59 print procEx.getInPortValue(dico["Legendre.loopIter"],"nsteps")
61 # -----------------------------------------------------------------------------
62 # --- schema with errors (echoSrv must be launched)
64 procEx = yacsgen.LoadProc("samples/aschema.xml")
65 procEx.setExecMode(YACS_ORB.CONTINUE)
68 # --- wait until executor is paused, finised or stopped
73 state = procEx.getExecutorState()
74 isRunning = (state < 304)
75 print "executorState: ", state
78 procEx.saveState("res2.xml")
79 numids,names = procEx.getIds()
84 dico[name] = numids[i]
88 print procEx.getErrorDetails(dico["c1"])
89 print procEx.getErrorDetails(dico["node13"])
91 # -----------------------------------------------------------------------------
92 # --- schema with errors
94 procEx = yacsgen.LoadProc("samples/triangle5error.xml")
95 procEx.setExecMode(YACS_ORB.CONTINUE)
96 procEx.setStopOnError(1,"execError2.xml")
97 #procEx.unsetStopOnError()
103 state = procEx.getExecutorState()
104 isRunning = (state < 304)
105 print "executorState: ", state
108 #procEx.resumeCurrentBreakPoint()
110 procEx.saveState("res3.xml")
112 # -----------------------------------------------------------------------------
113 # --- schema with breakpoints
115 procEx = yacsgen.LoadProc("samples/legendre7.xml")
116 procEx.setListOfBreakPoints(["Legendre.loopIter.deuxIter.iter2"])
117 procEx.setExecMode(YACS_ORB.STOPBEFORENODES)
123 state = procEx.getExecutorState()
124 isRunning = (state < 304)
125 print "executorState: ", state
128 procEx.saveState("partialExec.xml")
130 procEx = yacsgen.LoadProc("samples/legendre7.xml")
131 procEx.setExecMode(YACS_ORB.CONTINUE)
132 procEx.RunFromState("partialExec.xml")
137 state = procEx.getExecutorState()
138 isRunning = (state < 304)
139 print "executorState: ", state
142 procEx.saveState("finishExec.xml")