1 // Copyright (C) 2006-2014 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
20 #ifndef _GUIEXECUTOR_HXX_
21 #define _GUIEXECUTOR_HXX_
46 class GuiExecutor: public QObject
49 GuiExecutor(YACS::ENGINE::Proc* proc);
50 virtual ~GuiExecutor();
54 void startResumeDataflow(bool initialize = false);
55 bool checkEndOfDataflow(bool display = true);
57 void suspendDataflow();
58 void resumeDataflow();
62 void setStepByStepMode();
63 void setContinueMode();
64 void setBreakpointMode();
65 void setStopOnError(bool aMode);
66 void unsetStopOnError();
68 void saveState(const std::string& xmlFile);
69 void setLoadStateFile(std::string xmlFile);
71 YACS_ORB::executionMode getCurrentExecMode();
72 int getExecutorState();
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);
79 void setInPortValue(YACS::ENGINE::DataPort* port, std::string value);
81 void registerStatusObservers();
82 bool isRunning() const { return _isRunning; };
83 bool isStopOnError() const { return _isStopOnError; }
85 void setEngineRef(YACS_ORB::YACS_Gen_ptr ref);
86 YACS::ENGINE::Proc* getProc() { return _proc; };
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);
92 void setShutdownLevel(int level){_shutdownLevel=level;}
93 int getShutdownLevel(){return _shutdownLevel;}
95 YACS::ExecutorState updateSchema(std::string jobState);
97 virtual bool event(QEvent *e);
102 YACS::ENGINE::Proc* _proc;
103 QtGuiContext *_context;
105 YACS_ORB::YACS_Gen_var _engineRef;
106 YACS_ORB::ProcExec_var _procRef;
107 YACS_ORB::Observer_var _observerRef;
109 YACS::ExecutionMode _execMode;
110 GuiObserver_i* _serv;
117 std::list<std::string> _breakpointList;
118 std::string _loadStateFile;