Version: 9.15.0
GuiExecutor.hxx
Go to the documentation of this file.
1 // Copyright (C) 2006-2025 CEA, EDF
2 //
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.
7 //
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.
12 //
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
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 
20 #ifndef _GUIEXECUTOR_HXX_
21 #define _GUIEXECUTOR_HXX_
22 
23 #include "define.hxx"
24 
25 #include <QObject>
26 #include <string>
27 #include <list>
28 
29 
30 #include <yacsgui.hh>
31 
32 namespace YACS
33 {
34  namespace ENGINE
35  {
36  class Proc;
37  class Node;
38  class DataPort;
39  }
40 
41  namespace HMI
42  {
43  class GuiObserver_i;
44  class QtGuiContext;
45 
46  class GuiExecutor: public QObject
47  {
48  public:
50  virtual ~GuiExecutor();
51 
52  void closeContext();
53 
54  void startResumeDataflow(bool initialize = false);
55  bool checkEndOfDataflow(bool display = true);
56  void killDataflow();
57  void suspendDataflow();
58  void resumeDataflow();
59  void stopDataflow();
60  void resetDataflow();
61 
62  void setStepByStepMode();
63  void setContinueMode();
64  void setBreakpointMode();
65  void setStopOnError(bool aMode);
66  void unsetStopOnError();
67 
68  void saveState(const std::string& xmlFile);
69  void setLoadStateFile(std::string xmlFile);
70 
72  int getExecutorState();
73 
74  void setBreakpointList(std::list<std::string> breakpointList);
75  void addBreakpoint(std::string breakpoint);
76  void removeBreakpoint(std::string breakpoint);
77  void setNextStepList(std::list<std::string> nextStepList);
78 
79  void setInPortValue(YACS::ENGINE::DataPort* port, std::string value);
80 
82  bool isRunning() const { return _isRunning; };
83  bool isStopOnError() const { return _isStopOnError; }
84 
85  void setEngineRef(YACS_ORB::YACS_Gen_ptr ref);
87  std::string getErrorDetails(YACS::ENGINE::Node* node);
88  std::string getErrorReport(YACS::ENGINE::Node* node);
89  std::string getContainerLog();
90  std::string getContainerLog(YACS::ENGINE::Node* node);
91  void shutdownProc();
92  void setShutdownLevel(int level){_shutdownLevel=level;}
94 
95  YACS::ExecutorState updateSchema(std::string jobState);
96 
97  virtual bool event(QEvent *e);
98 
99  protected:
100  void setBPList();
101 
104 
105  YACS_ORB::YACS_Gen_var _engineRef;
106  YACS_ORB::ProcExec_var _procRef;
107  YACS_ORB::Observer_var _observerRef;
108 
111 
116 
117  std::list<std::string> _breakpointList;
118  std::string _loadStateFile;
119  };
120  }
121 }
122 
123 #endif
void display(CORBA::Any *data)
Definition: CORBAPorts.cxx:144
Base class for all nodes.
Definition: Node.hxx:70
Base class for all schema objects.
Definition: Proc.hxx:44
void setEngineRef(YACS_ORB::YACS_Gen_ptr ref)
std::string getErrorReport(YACS::ENGINE::Node *node)
GuiExecutor(YACS::ENGINE::Proc *proc)
Definition: GuiExecutor.cxx:46
std::string getContainerLog()
void startResumeDataflow(bool initialize=false)
Definition: GuiExecutor.cxx:85
QtGuiContext * _context
YACS::ExecutorState updateSchema(std::string jobState)
YACS_ORB::ProcExec_var _procRef
virtual bool event(QEvent *e)
bool isStopOnError() const
Definition: GuiExecutor.hxx:83
bool checkEndOfDataflow(bool display=true)
void setShutdownLevel(int level)
Definition: GuiExecutor.hxx:92
void removeBreakpoint(std::string breakpoint)
void setLoadStateFile(std::string xmlFile)
void saveState(const std::string &xmlFile)
void addBreakpoint(std::string breakpoint)
YACS_ORB::Observer_var _observerRef
GuiObserver_i * _serv
YACS::ENGINE::Proc * _proc
YACS::ExecutionMode _execMode
void setStopOnError(bool aMode)
std::string _loadStateFile
void setInPortValue(YACS::ENGINE::DataPort *port, std::string value)
YACS_ORB::YACS_Gen_var _engineRef
bool isRunning() const
Definition: GuiExecutor.hxx:82
void setBreakpointList(std::list< std::string > breakpointList)
std::string getErrorDetails(YACS::ENGINE::Node *node)
YACS::ENGINE::Proc * getProc()
Definition: GuiExecutor.hxx:86
YACS_ORB::executionMode getCurrentExecMode()
void setNextStepList(std::list< std::string > nextStepList)
std::list< std::string > _breakpointList
executionMode
Definition: yacsgui.idl:31
ExecutionMode
Definition: define.hxx:75
ExecutorState
Definition: define.hxx:64
def ref(target, callback=None)
Definition: CONNECTOR.py:120